Closed fonix232 closed 5 months ago
I don't think this is something we would particularly want, but FYI, before I wrote the GUI version, the prototype was just a shell script which ran from the command-line and did pretty much all the same operations. That script is still in the project - look for "backup" in the src subdirectory. You might find with a few tweaks that does what you want - it's not been maintained, but most of the core functionality should be in there.
I don't think there is anything in the application that can't be done from a shell script command - if you did want to work on a pure CLI version, then I'd recommend that rather than trying to reverse the GUI version into a CLI binary.
Ah true, makes sense. I was thinking that an officially published package would be easier to maintain (at least locally, for installs) than copying a script manually.
With the Pi5 introduced with PCIe SSD support, and a bunch of cases utilising various mounting strategies that make it hard to access the M.2 drives, there's now a need to be able to re-image those SSDs from an SD card easily.
The easiest approach would be using the logic of piclone, however... It's a GTK app. Many of us are running Pis in headless mode, using the Lite Debian images, generally accessed over SSH, without any desktop/GUI. This means that one needs to manually do the cloning process, which is quite tedious.
I think it would be great if the core of piclone could be broken out into a CLI tool, allowing these headless units to utilise the cloning, and even automate it (by setting the boot order to SD-NVMe-USB, and inserting/removing a prepared SD card, one could run a service which does the usual APT upgrade, then detects the NVMe drive, and clones the contents of the SD card to it, essentially automating the process of getting the latest Debian, completely clean, onto the SSD without disassembly).
Since the code is relatively well separated already, I think this could be done by moving the handful of methods into a separate C/H fileset (say,
piclone-core.[c|h]
), and adding apiclone-cli.[c|h]
wrapper that exposes the GTK options as CLI flags, allowing to run the core functions easily, without installing nearly 800MB of unnecessary desktop libraries.Right now, trying to install piclone on a Lite Debian image pulls in these dependencies:
Totalling a 219MB download and 784MB disk space after install.
I think I could be up for the task of separating the core functions, and adding the CLI wrapper, however I'm not familiar with the autogen/automake framework enough to confidently change the script to build the CLI and GUI binaries separately.
Would this be a welcome addition to this project, or should I just fork the repo and DIY it?