From: Harald Hoyer Date: Wed, 20 Mar 2013 05:41:25 +0000 (+0100) Subject: 51-dracut-rescue-postinst.sh,51-dracut-rescue.install: use systemd-machine-id-setup X-Git-Tag: 027~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=478aa7dac12fbbb01161a9bc78b70b8f7746fef9;p=thirdparty%2Fdracut.git 51-dracut-rescue-postinst.sh,51-dracut-rescue.install: use systemd-machine-id-setup if /etc/machine-id is empty, use systemd-machine-id-setup --- diff --git a/51-dracut-rescue-postinst.sh b/51-dracut-rescue-postinst.sh index 8b4e6c3da..e290f1a17 100755 --- a/51-dracut-rescue-postinst.sh +++ b/51-dracut-rescue-postinst.sh @@ -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 diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install index 1c0a6e111..39d01a76e 100755 --- a/51-dracut-rescue.install +++ b/51-dracut-rescue.install @@ -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