Skip to contentSkip to conversation

mkefidsk: fix bash/dash shell quoting problem

PATCH New Saul Wold 1 participant 1 message Jun 29, 2017

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

PATCH 1/1 mkefidsk: fix bash/dash shell quoting problem

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 <[email protected]>

[YOCTO #9665]

---
Tested with both bash and dash

 scripts/contrib/mkefidisk.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/contrib/mkefidisk.sh +1 -1
index 800733f..ac4ec9c 100755
@@ -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
Signature · 1 line
2.7.5