[systemd-devel] need some help understanding systemd-based initramfs

Ellis contact at xogium.me
Sun Apr 28 17:42:36 UTC 2019


Hi,
subject pretty much says it all. I am currently working on an embeded 
system and wish to use systemd in both the rootfs and the initramfs. 
These are both built via buildroot, making a full rootfs for one and a 
minimal rootfs for the other. However the documentation on how to make a 
proper initramfs seems to be very sparse, and I wish to understand this 
process better. Note that I am manually creating a cpio archive 
containing a minimal OS in this case, as buildroot can't make use of 
dracut or any tools to generate a proper initramfs. I did get quite far 
already, but I'm still missing one important thing it seems.

I am using systemd 242 in both initramfs and full rootfs. The rootfs is 
a squashfs filesystem, hence read-only. I wish to use the new overlayfs 
support to provide a writable layer on top of the filesystem, and I do 
think I've gotten it working quite well. However I don't know if this is 
as a result of using 'systemd.volatile=overlay' on my kernel command 
line, or if I really am missing something inside my initramfs, but when 
the initramfs terminates itself and switches to the real root, obviously 
systemd-journald is getting killed and then a new one spawns in the real 
root, with all the messages from the boot to the termination of the 
initramfs missing if I consult journalctl. The journal on the real root 
starts off with 'Received sigterm from PID 1'. So, what is going on 
here, and how could I fix this ?

The only documentation I found was about the boot up process in man 
bootup(7), and some kind of wiki article on freedesktop describing the 
initrd interface of systemd which seemed rather vague, located at 
https://www.freedesktop.org/wiki/Software/systemd/InitrdInterface/
. I'd really appreciate any insight into this, and would be glad to 
document the process in the end, for other people possibly struggling 
with the same use case as I.
Thanks !


More information about the systemd-devel mailing list