fosslinux / live-bootstrap

Use of a Linux initramfs to fully automate the bootstrapping process
501 stars 35 forks source link

After bootstrap, drop to a shell if needed, then shut down cleanly #389

Closed Googulator closed 9 months ago

Googulator commented 9 months ago

Do we have the sync command working?

As for mounts, the only thing that really needs remounting is the root file system, as the rest is just tmpfs & "technical" file systems like procfs. Would "mount -o remount,ro /" be sufficient maybe?

fosslinux commented 9 months ago

Do we have the sync command working?

Yes, it is used in steps/jump/linux.sh.

Would "mount -o remount,ro /" be sufficient maybe?

I think so. We only have that one disk based filesystem so it should be ok to do that. Technically we probably dont need it at all, but I'd prefer it to be safer...

Googulator commented 9 months ago

Updated to use sync and mount instead of sysrq-trigger.

Googulator commented 9 months ago

Testing the new implementation with explicit "mount" revealed that it unfortunately doesn't work. Apparently that's because the mount was made as "/newroot", before calling switch_root - and so "mount" won't recognize the root as a valid mount point.

Googulator commented 9 months ago

This new version should work, although it's a bit ugly:

fosslinux commented 9 months ago

That all makes sense. It is a bit messy as you said but I really can't think of anything better.