Blame 0010-lsinitrd.sh-fix-for-default-initrd-not-found-but-ima.patch

Harald Hoyer 52ce14
From 727e68d0b5cb93eb6c6e00f0541b8519657a2597 Mon Sep 17 00:00:00 2001
Harald Hoyer 52ce14
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 52ce14
Date: Sun, 10 Mar 2013 14:44:32 +0100
Harald Hoyer 52ce14
Subject: [PATCH] lsinitrd.sh: fix for default initrd not found, but image
Harald Hoyer 52ce14
 given
Harald Hoyer 52ce14
Harald Hoyer 52ce14
---
Harald Hoyer 52ce14
 lsinitrd.sh | 15 ++++++++-------
Harald Hoyer 52ce14
 1 file changed, 8 insertions(+), 7 deletions(-)
Harald Hoyer 52ce14
Harald Hoyer 52ce14
diff --git a/lsinitrd.sh b/lsinitrd.sh
Harald Hoyer 52ce14
index 7a09423..4b8a7e2 100755
Harald Hoyer 52ce14
--- a/lsinitrd.sh
Harald Hoyer 52ce14
+++ b/lsinitrd.sh
Harald Hoyer 52ce14
@@ -54,16 +54,17 @@ if [[ "$1" ]]; then
Harald Hoyer 52ce14
         usage
Harald Hoyer 52ce14
         exit 1
Harald Hoyer 52ce14
     fi
Harald Hoyer 52ce14
-fi
Harald Hoyer 52ce14
-
Harald Hoyer 52ce14
-[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
Harald Hoyer 52ce14
-
Harald Hoyer 52ce14
-if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
Harald Hoyer 52ce14
-    image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
Harald Hoyer 52ce14
 else
Harald Hoyer 52ce14
-    image="/boot/initramfs-${KERNEL_VERSION}.img}"
Harald Hoyer 52ce14
+    [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
Harald Hoyer 52ce14
+
Harald Hoyer 52ce14
+    if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
Harald Hoyer 52ce14
+        image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
Harald Hoyer 52ce14
+    else
Harald Hoyer 52ce14
+        image="/boot/initramfs-${KERNEL_VERSION}.img}"
Harald Hoyer 52ce14
+    fi
Harald Hoyer 52ce14
 fi
Harald Hoyer 52ce14
 
Harald Hoyer 52ce14
+
Harald Hoyer 52ce14
 if ! [[ -f "$image" ]]; then
Harald Hoyer 52ce14
     {
Harald Hoyer 52ce14
         echo "No <initramfs file> specified and the default image '$image' cannot be accessed!"