[systemd-devel] How to factory reset?
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Fri Mar 13 06:28:39 PDT 2015
On Fri, Mar 13, 2015 at 02:20:04PM +0100, Tobias Hunger wrote:
> Hi Zbyszek,
>
> I would expect the machine-id to be written before mount units are
> processed, so for that to work I would need to mount /var in the
> initrd, wouldn't I?
(Without looking at the code again) I don't think so. machine-id-setup
is performed by PID1 itself, and I think it does it quite early.
> Currently I am trying to just write the machine-id to /etc in the
> initrd. This makes systemd loose the understanding that /etc is empty
> though, which might have some side-effects that I am not yet
> anticipating.
Yeah, that does not seem like the right approach.
> Isn't systemd started from inside the initrd once the new root has
> been set up? Maybe I could set $container_uuid and feed the machine-id
> to systemd that way? I am afraid that this will lead to some other
> side-effects, because systemd might assume to be running inside a
> container. Looks like I will have to do some testing over the
> weekend:-)
>
> Maybe I am lucky and /sys/class/dmi/id/product_uuid is set.
>
> Best Regards,
> Tobias
Zbyszek
More information about the systemd-devel
mailing list