commit c817ba1 - test for systemd-machine-id-setup

andrew bezella abezella at
Fri Jan 24 01:58:27 CET 2020

hello -

i'm in the process of upgrading from fai 5.0.3 to fai 5.8.9.  as part
of that i'm looking over updates to the fai-config repo and i noticed
that in commit c817ba1 [1] this change was made:

diff --git a/scripts/DEBIAN/40-misc b/scripts/DEBIAN/40-misc
index 8308bbe..d1c3108 100755
--- a/scripts/DEBIAN/40-misc
+++ b/scripts/DEBIAN/40-misc
@@ -28,7 +28,8 @@ elif [ -f $target/lib/systemd/system/getty at .service ]; then
     sed -i -e 's#sbin/agetty --noclear#sbin/agetty -f /etc/issue.linuxlogo --noclear#' $target/lib/systemd/system/getty at .service
-if [ ! -f $target/etc/machine-id -a -f $target/bin/systemd-machine-id-setup ]; then
+# recreate machine-id if the file is empty
+if [ X"$(stat -c '%s' $target/etc/machine-id 2>/dev/null)"  = X0 -a -f /bin/systemd-machine-id-setup ]; then
     $ROOTCMD systemd-machine-id-setup

and i was wondering if the removal of "$target" in the "-f" test for
`systemd-machine-id-setup` was intentional?  since the next line is
"$ROOTCMD systemd-machine-id-setup" it would seem that the test should
still be for "-f $target/bin/systemd-machine-id-setup"?

sorry for the noise if i'm just missing something obvious, i'm still
getting my head back into the world of fai.




andrew bezella <abezella at>
internet archive

More information about the linux-fai mailing list