[oe-commits] Drew Moseley : init-install.sh: Verify / sys based files exist before displaying them
git at git.openembedded.org
git at git.openembedded.org
Thu Jul 10 16:40:09 UTC 2014
Module: openembedded-core.git
Branch: master
Commit: 1d73e3f9d9977382efdb0c111c556c6048bd60b4
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=1d73e3f9d9977382efdb0c111c556c6048bd60b4
Author: Drew Moseley <drew_moseley at mentor.com>
Date: Sun Jul 6 20:43:00 2014 -0400
init-install.sh: Verify /sys based files exist before displaying them
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 at mentor.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>
---
meta/recipes-core/initrdscripts/files/init-install.sh | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index 0a1141a..486c9f2 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -46,9 +46,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
More information about the Openembedded-commits
mailing list