[systemd-devel] no installed machine-id vs systemd-in-initramfs

Colin Walters walters at verbum.org
Wed Jul 10 08:26:09 PDT 2013


The gnome-ostree build system generates disk images that can be
downloaded directly; there is no installer.

In the old model of "dracut shell script + systemd", systemd's main.c
has:
if (arg_running_as == SYSTEMD_SYSTEM ...) {
  ...
  machine_id_setup();
  ...
}

So after mounting the rootfs, we'd end up writing one to /etc (at least
in gnome-ostree which comes with a writable copy of /etc), and it would
persist across reboots, and all would be well with the world.

In the new systemd-in-initramfs model, journald is now launched in the
initramfs.  Dracut will copy the host's machine id into the initramfs
if it exists, but in the gnome-ostree case (or more generally
"pre-canned OS" case), there isn't one.  journald will attempt to start,
and fail.

One thought I had is to say:  If there's no /etc/machine-id in the
initramfs, write one to /run/machine-id.  After mounting the rootfs,
persist that to /etc.

Except to really make that work, we'd need to regenerate the initramfs
client side after doing this.  I'd really like to avoid rebuilding the
initramfs on the client.

My instinct at this point is to just generate a new
default /etc/machine-id for each build.  That would have the unfortunate
consequence of not being globally unique.  But...I could just overwrite
that default machine ID with a new one in an installer type program.
Which would be mostly OK, but still feels like a hack.

Any other thoughts on this?




More information about the systemd-devel mailing list