]> code.ossystems Code Review - openembedded-core.git/commitdiff
mkefidsk: fix bash/dash shell quoting problem
authorSaul Wold <sgw@linux.intel.com>
Thu, 29 Jun 2017 20:46:18 +0000 (13:46 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Jun 2017 07:44:09 +0000 (08:44 +0100)
mkefidsk currently writes a startup.nsh with embedded control characters.
This happens because \b etc are control sequences to the shell echo
command when using dash. The resulting startup.nsh causes the bootup
to fail, and the user is dropped into the EFI shell to manually run
startup.nsh.

Patch originally provided by Troy D. Hanson <troy.hanson@jhuapl.edu>

[YOCTO #9665]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/contrib/mkefidisk.sh

index 800733f0afdabb33b963caa515ed8a80f24a7a17..ac4ec9c7fba949abc0809d959f629f7de243844b 100755 (executable)
@@ -444,7 +444,7 @@ if [ -d $ROOTFS_MNT/etc/udev/ ] ; then
 fi
 
 # Add startup.nsh script for automated boot
-echo "fs0:\EFI\BOOT\bootx64.efi" > $BOOTFS_MNT/startup.nsh
+printf "fs0:\%s\BOOT\%s\n" "EFI" "bootx64.efi" > $BOOTFS_MNT/startup.nsh
 
 
 # Call cleanup to unmount devices and images and remove the TMPDIR