<p dir="ltr">Hi,</p>
<p dir="ltr">systemd definitely already has all the stuff in place to do this on it's own.<br>
The stuff creating the root partition would be sd-repart which just needs a corresponding partition description.</p>
<p dir="ltr">A good example of how this can be used is particleOS <a href="https://github.com/systemd/particleos">https://github.com/systemd/particleos</a><br>
which is an experiment to implement a OS based on the blog post you mentioned.<br>
It uses mkosi <a href="https://github.com/systemd/mkosi">https://github.com/systemd/mkosi</a> to create the image<br>
which in turn will generate a purely systemd based initrd.</p>
<p dir="ltr">Cheers, Nils</p>
<br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Mar 3, 2025, 11:45 Emanuele Giuseppe Esposito <<a href="mailto:eesposit@redhat.com">eesposit@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello everyone,<br>
<br>
As you might know already, I tried to submit a new dracut module that<br>
implements the hermetic-usr approach described by Lennart in his<br>
blogpost "Fitting everything together":<br>
<a href="https://0pointer.net/blog/fitting-everything-together.html" rel="noreferrer noreferrer" target="_blank">https://0pointer.net/blog/fitting-everything-together.html</a>.<br>
<br>
The PR is here: <a href="https://github.com/dracut-ng/dracut-ng/pull/1234" rel="noreferrer noreferrer" target="_blank">https://github.com/dracut-ng/dracut-ng/pull/1234</a><br>
<br>
While there are some small things to fix, it works well, at least in the<br>
environments that I tried.<br>
<br>
It is able to recreate the whole root from scratch, provided that /usr<br>
is existing in a separate partition.It creates a LUKS as well as<br>
plaintext root, and supports plaintext /usr as well as dm-verity<br>
protected one.<br>
<br>
Zbigniew pointed me that a dracut module might not be the best way to<br>
achieve this, and there might be work in progress already in systemd to<br>
achieve the same goal with a separate systemd component.<br>
<br>
Can you point me to the work that is being done in systemd? More<br>
specifically, if there is something similar to what I implemented that<br>
puts together systemd-repart with systemd-tmpfiles and sysusers and<br>
creates a root. Is there some project already going on that does this?<br>
<br>
My module uses only 3 systemd units, and most of this stuff could be<br>
reused, if you want. Or maybe is it better to continue the work on dracut?<br>
<br>
Let me know,<br>
Emanuele<br>
<br>
</blockquote></div>