From: Harald Hoyer Date: Sun, 10 Mar 2013 13:44:32 +0000 (+0100) Subject: lsinitrd.sh: fix for default initrd not found, but image given X-Git-Tag: 027~71 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=727e68d0b5cb93eb6c6e00f0541b8519657a2597;p=thirdparty%2Fdracut.git lsinitrd.sh: fix for default initrd not found, but image given --- diff --git a/lsinitrd.sh b/lsinitrd.sh index 7a09423f9..4b8a7e24b 100755 --- a/lsinitrd.sh +++ b/lsinitrd.sh @@ -54,16 +54,17 @@ if [[ "$1" ]]; then usage exit 1 fi -fi - -[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id - -if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then - image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" else - image="/boot/initramfs-${KERNEL_VERSION}.img}" + [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id + + if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then + image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" + else + image="/boot/initramfs-${KERNEL_VERSION}.img}" + fi fi + if ! [[ -f "$image" ]]; then { echo "No specified and the default image '$image' cannot be accessed!"