Skip to content

Commit

Permalink
make sure an machine-id exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lange committed Sep 21, 2017
1 parent d729871 commit 02a648b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/simple/scripts/DEBIAN/40-misc
Expand Up @@ -28,6 +28,10 @@ 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

# 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
Expand Down

0 comments on commit 02a648b

Please sign in to comment.