X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FDEBIAN%2F40-misc;h=78773f35458e6f79ed797d1522600efdece768fb;hp=8308bbe33dae7b662437697b6d7959cfc11d5ce4;hb=2773c14668a490a1254a63541e1ef9fd3377104b;hpb=7024f2155d8d5e4754d5c1ce0ccf8352149f81cd diff --git a/fai/config/scripts/DEBIAN/40-misc b/fai/config/scripts/DEBIAN/40-misc index 8308bbe..78773f3 100755 --- a/fai/config/scripts/DEBIAN/40-misc +++ b/fai/config/scripts/DEBIAN/40-misc @@ -28,7 +28,12 @@ elif [ -f $target/lib/systemd/system/getty@.service ]; then sed -i -e 's#sbin/agetty --noclear#sbin/agetty -f /etc/issue.linuxlogo --noclear#' $target/lib/systemd/system/getty@.service fi -if [ ! -f $target/etc/machine-id -a -f $target/bin/systemd-machine-id-setup ]; then +# make sure a machine-id exists +if [ ! -f $target/etc/machine-id ]; then + > $target/etc/machine-id +fi +# 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 fi