]> code.ossystems Code Review - openembedded-core.git/commitdiff
init-install-efi.sh: Verify /sys based files exist before displaying them
authorDrew Moseley <drew_moseley@mentor.com>
Thu, 31 Jul 2014 00:49:30 +0000 (20:49 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 2 Aug 2014 08:25:34 +0000 (09:25 +0100)
Some mmc cards do not have all the data files in /sys/block
populated.  Check for existence before displaying the files
to avoid erroring out of the install process.

Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-core/initrdscripts/files/init-install-efi.sh

index fcf21cd2f97ecba3607b6f317cdcb80ba4563918..b142ed4915b5f735e17260a86c91e63ab0ccc1a6 100644 (file)
@@ -47,9 +47,14 @@ for hdname in $hdnamelist; do
        echo -n "VENDOR="
        cat /sys/block/$hdname/device/vendor
     fi
-    echo -n "MODEL="
-    cat /sys/block/$hdname/device/model
-    cat /sys/block/$hdname/device/uevent
+    if [ -r /sys/block/$hdname/device/model ]; then
+        echo -n "MODEL="
+        cat /sys/block/$hdname/device/model
+    fi
+    if [ -r /sys/block/$hdname/device/uevent ]; then
+        echo -n "UEVENT="
+        cat /sys/block/$hdname/device/uevent
+    fi
     echo
     # Get user choice
     while true; do