I have a working liveboot usb, with persistence. It has two partitions, one being the actual os, the other containing an image file that is the persistence.
The desired result is a live usb with one partition, and in the root of that partition is an image that is mounted read only to
/home. This is so I can easily swap out configs in
/home/user, without having to run
lb build each time, and then
dd it to each flash drive.
I've spent a bit of time trying to get it working with persistence, but there are two problems. Firstly, when booting, live debian seems to not check for a persistence file in the root of the live medium. Furthermore, I can't get it to do persistence read only. I had been trying with the persistent-read-only boot flag. Couldn't find much documentation on it, but it's mentioned here. Does not work, however.
At this point, I'm pretty sure persistence is not the correct way to go, and the better option would be some kind of boot script to mount an image to /home. This is theoretically simple enough, as the root of the medium is always at
/lib/live/mount/medium, but I'm unsure of the correct way to go about actually mounting an image. The two options as I see them are:
- a boot script
- If I were to try to use init.d, it needs you to run update-rc.d, which I can't do here
- silly option would be to put a script in /etc/skel/.bashrc or whatever, and have it rm everything in /home and then mount the image, but that's a wee bit horrifying.
- Live-Build startup scripts are only mentioned here , which is extremely outdated, and obviously useless. This looks to have been replaced by boot hooks, but I don't have
/lib/live/config/to examine, and I'm going to wait on a suggestion for the proper method before attempting to follow up on this
- Unsure if using fstab to mount an image to /home would happen before or after live debian creates a new user from /etc/skel, as trying to mount to a populated directory isn't going to work.
So either how do I get a boot script to run in a not horrifying way, or would just copying the fstab from a running live version, modifying it to have an image, and putting that in
So I tried using
fstab, and it was mounted read only, and then I couldn't login on the gui portion of the system as it couldn't lock
.Xauthority. Unsure how to proceed, I think it will be learning how the live system can pretend to accept changes, and then not write them and do that. Unsure how to do that or word the query, however.