Open visit1985 opened 11 years ago
@visit1985 from AUR: "nice idea, but it will not work with btrfs set-default, since the initrd present in __rollback will be used after a rollback and can contain a version without the stub.
Also we would need a reliable way to install to subvolid=0 which can not be guarantied on initial setup.
Another idea which came to my mind is, to upgrade the initrd while snapshotting to __rollback. But I'm not sure if we're able to execute chrooted commands at this boot stage."
yes you would need to ensure the stub existed in all snapshots, but that is no more/less difficult than the current situation. i don't think it is unreasonable to require the user mount the root-subvol (id=0) to a known or configurable location either (per the other ticket, my intention was to require this). if it were mounted, it would then be trivial to install.
i do like the upgrade-before-rollback idea though, but i dont think you'll want to rebuild the initramfs completely (even though it should work fine, as i have recovered from problems in exactly this way). IIRC, cpio is similar to tar in that you can just append new files to the archive, and the latest file becomes the "real" file... IOW, you should be able to simply decompress and append and updated copy of mkinitcpio-btrfs, optionally recompress (but why? probably just with gz, no reason(?) to use original compression), then call it a day :)
@xtfxme from AUR: "hmm... booting older copies of the mkinitcpio-btrfs script is an interesting problem... i wonder if it should try and copy itself to the btrfs-root, ie. subvolid=0, and then place a stub in /usr/lib/initcpio/hooks?"