From 4ad66243dc0fb8d6514c25a5f33e17c86e954731 Mon Sep 17 00:00:00 2001 From: Vladimir Oltean Date: Mon, 10 Mar 2025 00:06:40 +0200 Subject: [PATCH] package/util-linux: add uuidd user and group When util-linux is compiled with the uuidd daemon and with systemd init, the rootfs creation fails in fakeroot as follows: printf 'host/bin/systemctl --root=build/buildroot-fs/ext2/target preset-all\n' >> build/buildroot-fs/ext2/fakeroot [...] FAKEROOTDONTTRYCHOWN=1 host/bin/fakeroot -- build/buildroot-fs/ext2/fakeroot rootdir=build/buildroot-fs/ext2/target table='build/buildroot-fs/full_devices_table.txt' ignored spec: h /var/log/journal/%m - - - - +C ignored spec: x /var/tmp/systemd-private-%b-* ignored spec: X /var/tmp/systemd-private-%b-*/tmp ignored spec: x /var/lib/systemd/coredump/.#core*.%b* ignored spec: z /var/log/journal/%m 2755 root systemd-journal - - ignored spec: z /var/log/journal/%m/system.journal 0640 root systemd-journal - - :37: Failed to resolve user 'uuidd': No such process make[1]: *** [fs/ext2/ext2.mk:66: images/rootfs.ext2] Error 65 make: *** [Makefile:83: _all] Error 2 This error can be reproduced with the commands: cat <.config BR2_aarch64=y BR2_TOOLCHAIN_EXTERNAL=y BR2_PACKAGE_UTIL_LINUX=y BR2_PACKAGE_UTIL_LINUX_UUIDD=y BR2_INIT_SYSTEMD=y BR2_TARGET_ROOTFS_EXT2=y EOF make olddefconfig make The error comes from systemctl, which cannot find the uuidd user in the target rootfs, needed in the uuidd.service unit file [1]. This commit fixes the issue by adding the uuidd user and group in support/scripts/mkusers syntax. [1] https://web.git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/misc-utils/uuidd.service.in?h=v2.40.2 Signed-off-by: Vladimir Oltean [Julien: add commands to reproduce the issue in commit log] Signed-off-by: Julien Olivain (cherry picked from commit 4809690d42f9b395ccb76ee7583c199fdd8d42c5) Signed-off-by: Peter Korsgaard --- package/util-linux/util-linux.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk index 7a143290eb..ed30c0b107 100644 --- a/package/util-linux/util-linux.mk +++ b/package/util-linux/util-linux.mk @@ -60,6 +60,12 @@ HOST_UTIL_LINUX_CONF_OPTS = \ --with-systemdsystemunitdir=no \ --without-python +ifeq ($(BR2_PACKAGE_UTIL_LINUX_UUIDD),y) +define UTIL_LINUX_USERS + uuidd -1 uuidd -1 * - - - uuidd user +endef +endif + ifneq ($(BR2_PACKAGE_UTIL_LINUX_BINARIES)$(BR2_PACKAGE_UTIL_LINUX_CRAMFS)$(BR2_PACKAGE_UTIL_LINUX_FSCK)$(BR2_PACKAGE_UTIL_LINUX_LOSETUP),) UTIL_LINUX_SELINUX_MODULES = fstools endif