<div>On Fri, 31 Dec 2021 at 20:46, Albert Brox <albert@exypno.tech> wrote:<br></div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I'm interested in working on this item from the TODO file:<br>
<br>
* add concept for "exitrd" as inverse of "initrd", that we can <br>
transition to at<br>
shutdown, and has similar security semantics. This should then take <br>
the place<br>
of dracut's shutdown logic. Should probably support sysexts too. Care <br>
needs<br>
to be taken that the resulting logic ends up in RAM, i.e. is copied <br>
out of<br>
on-disk storage.<br>
<br>
I'm wondering if anyone can elaborate/give context for this. <br>
Specifically, what is the motivation for replacing the dracut shutdown <br>
logic with exitrd? It seems like dracut already handles shutdown <br>
processes within a ramdisk/fs. And as I understand, initrd is not part <br>
of systemd (merely interfaced with), so why are we bringing this <br>
"exitrd" under the umbrella of systemd?</blockquote><div dir="auto"><br></div><div dir="auto">If I remember right, this whole concept of having init pivot_root back into /run to let root be unmounted (aka "shutdown initramfs") *was* originally introduced by systemd in the first place.</div><div dir="auto"><br></div><div dir="auto">(Init has to be involved because it's the one process that can't be killed to relinquish its open handles on /, it has to be nicely asked to do so. Sysvinit didn't have such a thing as far as I remember, but systemd was changed in 2011 to optionally pivot_root to /run/initramfs and execute the 'shutdown' binary found there instead of powering off. That's what allows dracut shutdown logic to be run.)</div><div dir="auto"><br></div><div dir="auto">But while the initramfs is a pre-built image that can be distributed and signed, the shutdown logic is not; it's instead unpacked or even generated on the fly by an ordinary .service that runs before every shutdown. At least on Arch it literally runs mkinitcpio; not sure about dracut.</div><div dir="auto"><br></div><div dir="auto">So I'm assuming that the whole idea of "exitrd" is just to make the same "initramfs update" process generate both halves as static cpio images at the same time, so that it would become systemd's job to simply unpack it to /run (and maybe validate a signature or two).</div></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div>