fix overlayfs #39

Open xogium opened this issue on 31 May 2021 - 2 comments

@xogium xogium commented on 31 May 2021

Currently, the overlayfs is setup by our pre-init script in a way we thought did not necessitate an initramfs.

But this now seems to be a bad thing to do as during shutdown, systemd does not know about the upper and lower layer of the overlayfs, and thus only succeeds in unmounting the overlayfs itself. It doesn't notice the still mounted partitions, which means the upper layer of the overlayfs gets corrupted at every boot.

So I think the best approache to this would be to build a minimal dracut initramfs that systemd can then pivot to during shutdown, see the systemd documentation for its initrd interface.

@xogium xogium change priority from default to high on 31 May 2021

I will try to get in touch with my buildroot mentor to see if he could help with this.

So, after much work with @Jookia, I finally managed to figure out how to get an initramfs working for us using something my buildroot mentor created. He added support for dracut. This is, of course quite experimental and I am still working on it with him. I am not sure if this will ever be merged into the upstream project, but at least we have a way of creating a systemd-based initramfs without relying on a second defconfig that would always require to be built first.

As for @Jookia's work, we figured out how to setup proper overlayfs filesystem management with dracut, with a custom dracut module. There is still a lack of documentation, but this should definitely be hosted here, in case it is useful to some other projects of us or other people in the future.

I now will integrate all of this in an experimental WIP branch that might eventually get merged, if we judge it to be stable.


No milestone
No one
1 participant