rockedge wrote: Sun Mar 20, 2022 10:46 pmEDIT-1: Same behavior in VirtualBox as in QEMU. /upper_changes
is being written too at shutdown/reboot without any prompt. So if the logic works in a frugal install but not when booting from an ISO in a virtual machine (with a formatted drive available) the script snap-ex must be being by-passed or as mentioned before, snapmergepuppy
is being run directly.
Well it is good that that behaviour is consistent. I'll boot up KLV in qemu again later today and study that snap-ex/snapmergepuppy issue then.
But this particular post is for lovers of SG2D (mention no names...):
In a recent post regarding the previous WDL initrd (ver rc2; there was no rc3 release) I tested and documented how KLV-Airedale iso worked fine placed in SG2D /BOOTISOS directory. Even RAM2 (save2flash mode), or default w_changes="media", worked fine with upper_changes persistence folder being auto-written and used in same /BOOTISOS folder, and even external w_init written into /BOOTISOS worked(!) so really all pretty good. But I mentioned one issue/limitation:
If user put more than one WDL-related iso into SG2D /BOOTISOS only one could use save persistence with one of these since they cannot of course share the same upper_changes folder or w_init. If any SG2D user craved more that unfortunately raised the major potential issue - making uniquely different upper_changes folder somehow... One method would be, like puppy save files - use different filenames somehow named after the different iso, but there are huge weaknesses in that method:
1. Requires lots of auto-renaming changes to upper_changes in the complex initrd/init script (but could be done, though hardly worth the effort, and dangerous since initrd/init is such a critical component).
2. Most app/utility writers that take advantage of WDL's flexible layering facilities rely on the fact that upper_changes is a reliable name - rather than somehow having to always take care to take into account some special name related to the distro name. For example, utilities that provide rollback functionality lose ease of use, which currently is simply a matter of renaming that known and trusted upper_changes name into NNupper_changes (where NN is an appropriate doubt-digit layer name).
3. It's not just upper_changes that would need some kind of unique name for each different distro. WDL provides other facilities, such as that very powerful external w_init capability - that would need unique naming too. The overall complexity additions involved become painful.
But then I thought, that's not the way to do it. WDL needs to keep naming consistency for upper_changes and w_init for all of the above reasons. Rather we need to be able to use separate subdirectories for each iso and then the saved upper_changes and w_init files will not clash with each other. ALAS, SG2D itself only looks in a few directories for the iso files (e.g. in /BOOTISOS, and /bootisos and a few others). I don't blame SG2D design for that limitation - it only makes sense that its code does NOT need to search through other hierarchies of directories looking for isos - that would be terribly slow and complex. So... what I've done in WDL initrd/init rc4 (which is the current initrd being used in KLV-Airedale) is to support symlinks placed in /BOOTISOS to remove the limitation of SG2D's own search algorithm. Just tested that new facility and it works beautifully.
So how to use several WDL initrd using distros in SG2D such that save persistence (and external w_init) works for all of them?:
Simple. You can now put the WDL-related distro inside its own subdirectory under /BOOTISOS and alongside that put a symlink to the iso itself (which is in the subdirectory). SG2D thinks the symlink is the iso (and hence manages to find it) and WDL initrd/init sorts out where the actual iso is (i.e. follows the symlink) and sets that subdirectory as the play to save upper_changes and to read any external w_init.
For example:
1. Create a subdirectory for storing, say, KLV-Airedale iso in (any name you like):
2. Copy the iso into that klv subdirectory. For example, KLV-Airedale-beta10.iso
3. In BOOTISOS directory simply make a symlink to KLV-Airedale-beta10.iso
e.g. Assuming at terminal in BOOTISOS:
Code: Select all
ln -s klv/KLV-Airedale-beta10.iso klv.iso
or use your filemanager to make that simple symlink (that symlink's filename is irrelevant as long as it ends with .iso).
4. Repeat similar process for any other WDL-initrd-using distro.
Now SGD2 will find all these isos (even though it really only finds the symlink (which must end with filename .iso) and WDL initrd/init sets up the system to use put save persistence folder upper_changes inside the individual subdirectories being used for each distros iso. So with WDL systems, SG2D is now working just like any other psubdir-type traditional frugal install, with no limitation at all.
This is certainly convenient and powerful, and logically tidy moreover in terms of distro organisation.
I do hope SG2D continues to be maintained therefore, though the symlink capability of WDL can also be used with direct grub2 boot from iso as well, so a useful development anyway.