[systemd-devel] [PATCH 0/3] using firstboot and sysusers to construct an initramfs

Ivan Shapovalov intelfx100 at gmail.com
Wed Feb 25 15:46:22 PST 2015


Hi there.

These patches allow using firstboot and sysusers together to construct an
initramfs with a fully functional emergency.service and rescue.service.

Moreover, they allow to build a "clean" passwd for the initramfs and don't
resort to copying it from the host system (as it has been done in Arch's
mkinitcpio).

The first one allows sysusers to take configuration from the real root
but to apply it to a specified alternate root.

The next two patches fix an apparent integration problem between firstboot
and sysusers, as previously described here:
http://lists.freedesktop.org/archives/systemd-devel/2015-February/028355.html

All in all, with this series I'm able to do a simple

	systemd-firstboot --root="$BUILDROOT" --root-password=""
	systemd-sysusers --dest-root="$BUILDROOT"

and, after adding respective units and /sbin/sulogin to the initramfs,
to use "rd.systemd.unit=rescue.target" as a complete alternative to pre-systemd
arch-specific "break=premount" kernel parameter.

Ivan Shapovalov (3):
  sysusers: allow separate alternate roots for configs and modifications
  firstboot: set all spwd fields to -1 for consistency with sysusers
  sysusers: do not reject users with already present /etc/shadow entries

 src/firstboot/firstboot.c |   6 +--
 src/sysusers/sysusers.c   | 120 +++++++++++++++++++++++++++++-----------------
 2 files changed, 78 insertions(+), 48 deletions(-)

-- 
2.3.0



More information about the systemd-devel mailing list