]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
51-dracut-rescue-postinst.sh,51-dracut-rescue.install: use systemd-machine-id-setup
authorHarald Hoyer <harald@redhat.com>
Wed, 20 Mar 2013 05:41:25 +0000 (06:41 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 20 Mar 2013 06:08:29 +0000 (07:08 +0100)
if /etc/machine-id is empty, use systemd-machine-id-setup

51-dracut-rescue-postinst.sh
51-dracut-rescue.install

index 8b4e6c3da80f65971cb03d5ef8438a2ffbecd1f2..e290f1a17163a4a4ea57ea632329d04b73313c27 100755 (executable)
@@ -8,6 +8,11 @@ KERNEL_VERSION="$1"
 KERNEL_IMAGE="$2"
 
 [[ -f /etc/os-release ]] && . /etc/os-release
+
+if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then
+    systemd-machine-id-setup
+fi
+
 [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
 
 [[ $MACHINE_ID ]] || exit 1
index 1c0a6e111fd41069f8b8c3bf253e135053785e4f..39d01a76e10c34c386909e2d6fe320ad672d2438 100755 (executable)
@@ -31,7 +31,13 @@ dropindirs_sort()
 }
 
 [[ -f /etc/os-release ]] && . /etc/os-release
+
+if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then
+    systemd-machine-id-setup
+fi
+
 [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
+
 if [[ -f /etc/kernel/cmdline ]]; then
     readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
 fi