Skip to contentSkip to conversation

grub-efi, gummiboot: Emit correct path in startup.nsh

PATCH New Khem Raj 1 participant 1 message Oct 10, 2015

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 grub-efi, gummiboot: Emit correct path in startup.nsh

when we generate hddimage and use it to prepare SD card using scripts/contrib/mkefidisk.sh as described here

http://elinux.org/Minnowboard:MinnowMaxYoctoProject

The content of startup.nsh contains

bootx64.efi

but this file is actually not in same dir as startup.nsh its in /EFI/BOOT so for this to work entry in startup.nsh should be

fs0:\EFI\BOOT\bootx64.efi

Otherwise the image is D-O-A

---
 meta/classes/grub-efi.bbclass  | 3 ++-
 meta/classes/gummiboot.bbclass | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
meta/classes/grub-efi.bbclass +2 -1
index 4ddc2bb..9a4220a 100644
@@ -52,7 +52,8 @@ efi_iso_populate() {
 	mkdir -p ${EFIIMGDIR}/${EFIDIR}
 	cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
 	cp $iso_dir/vmlinuz ${EFIIMGDIR}
-	echo "${GRUB_IMAGE}" > ${EFIIMGDIR}/startup.nsh
+	EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
+	echo "fs0:${EFIPATH}\\${GRUB_IMAGE}" > ${EFIIMGDIR}/startup.nsh
 	if [ -f "$iso_dir/initrd" ] ; then
 		cp $iso_dir/initrd ${EFIIMGDIR}
 	fi
meta/classes/gummiboot.bbclass +2 -1
index 3d9c08b..9a97ac1 100644
@@ -46,7 +46,8 @@ efi_iso_populate() {
         mkdir -p ${EFIIMGDIR}/${EFIDIR}
         cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
         cp $iso_dir/vmlinuz ${EFIIMGDIR}
-        echo "${DEST_EFI_IMAGE}" > ${EFIIMGDIR}/startup.nsh
+        EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
+        echo "fs0:${EFIPATH}\\${DEST_EFI_IMAGE}" > ${EFIIMGDIR}/startup.nsh
         if [ -f "$iso_dir/initrd" ] ; then
             cp $iso_dir/initrd ${EFIIMGDIR}
         fi
Signature · 1 line
2.6.1