From: Darren Hart Date: Mon, 23 Jun 2014 21:44:41 +0000 (-0700) Subject: mkefidisk.sh: Allow symlink for device X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~33342 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67bbfac55555c4e35ed9a84409aedb9b278b3de9;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git mkefidisk.sh: Allow symlink for device 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 Signed-off-by: Richard Purdie --- diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh index c86849d3957..1992d6c6cb0 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