[OE-core] [PATCH] mkefidisk.sh: Allow symlink for device
Darren Hart
dvhart at linux.intel.com
Mon Jun 23 21:44:41 UTC 2014
Allow the user to specify a symlink as the host device. If a link is
used, mkefidisk will now dereference it and use the link target when
looking for sysfs information.
Signed-off-by: Darren Hart <dvhart at linux.intel.com>
---
scripts/contrib/mkefidisk.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index c86849d..1992d6c 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -98,6 +98,11 @@ DEVICE=$1
HDDIMG=$2
TARGET_DEVICE=$3
+LINK=$(readlink $DEVICE)
+if [ $? -eq 0 ]; then
+ DEVICE="$LINK"
+fi
+
if [ ! -w "$DEVICE" ]; then
echo "ERROR: Device $DEVICE does not exist or is not writable"
usage
--
2.0.0
More information about the Openembedded-core
mailing list