]> code.ossystems Code Review - openembedded-core.git/commitdiff
mkefidisk.sh: Allow symlink for device
authorDarren Hart <dvhart@linux.intel.com>
Mon, 23 Jun 2014 21:44:41 +0000 (14:44 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 24 Jun 2014 18:53:01 +0000 (19:53 +0100)
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@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/contrib/mkefidisk.sh

index c86849d395743527a0aeea3e5ff1846dd4770389..1992d6c6cb007438427bdd0a217afdd43de7a6c2 100755 (executable)
@@ -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