From 1e2b5c305e79ac6998d4d59f64c6dee285214057 Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan Date: Fri, 3 May 2024 20:41:13 +0200 Subject: [PATCH] fix(35-network-manager): let the kernel generate a UUID for /etc/machine-id This allows the module to work without systemd. See-also: https://github.com/dracutdevs/dracut/pull/534 Bug: https://bugs.gentoo.org/677554 Co-authored-by: Mike Gilbert Signed-off-by: Andrew Ammerlaan --- modules.d/35network-manager/module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules.d/35network-manager/module-setup.sh b/modules.d/35network-manager/module-setup.sh index a813bf5b5..67144f36f 100755 --- a/modules.d/35network-manager/module-setup.sh +++ b/modules.d/35network-manager/module-setup.sh @@ -72,7 +72,9 @@ install() { elif ! [[ -e "$initdir/etc/machine-id" ]]; then # The internal DHCP client silently fails if we # have no machine-id - systemd-machine-id-setup --root="$initdir" + local UUID + UUID=$(< /proc/sys/kernel/random/uuid) + echo "${UUID//-/}" > "$initdir/etc/machine-id" fi # We don't install the ifcfg files from the host automatically.