Skip to contentSkip to conversation

wic/isoimage-isohybrid.py: fix booting from removable media

PATCH In review Arsalan Awan 3 participants 9 messages Nov 2, 2018 – Nov 13, 2018

lore
Share & tools
lore
#0 lore raw

cover wic/isoimage-isohybrid.py: fix booting from removable media

From: "Arsalan H. Awan" <[email protected]>

The mkhybridiso image created using the isoimage-isohybrid.py WIC source plugin fails to boot from a removable storage media such as USB. This is due to the grub-efi bootloader filename being deployed i.e.: "grub-efi-bootx64.efi" which must be "bootx64.efi" in this case of a removable media.

Source: https://www.rodsbooks.com/efi-bootloaders/principles.html
Quote: "The fallback boot loader mentioned earlier (EFI/BOOT/bootx64.efi,
or variants of that, depending on the architecture) is something of a special case. This filename was originally intended for use only on removable media, so that they could be booted to install an OS. (If not for that fixed filename, a factory-fresh computer wouldn't be able to boot anything!)"

The following changes since commit 30b055d2296f060a4ca054d042f353a2153fdd4e:

externalsrc.bbclass: Set BB_DONT_CACHE for non-target recipes (2018-10-18 11:08:46 +0100)

are available in the git repository at:

git://github.com/ArsalanHAwan/openembedded-core sumo
https://github.com/ArsalanHAwan/openembedded-core/tree/sumo

Arsalan H. Awan (1):
wic/isoimage-isohybrid.py: fix booting from removable media

 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 wic/isoimage-isohybrid.py: fix booting from removable media

From: "Arsalan H. Awan" <[email protected]>

The EFI bootloader name and path for being able to boot from a removable storage media - such as USB - must be like:

/EFI/BOOT/boot<arch>.efi
/EFI/BOOT/bootx64.efi
/EFI/BOOT/bootia32.efi
/EFI/BOOT/bootaa64.efi

otherwise system will not be able to boot from it.

This commit fixes the grub-efi bootloader destination image name accordingly just like efi_populate() function does it in meta/classes/grub-efi.bbclass.

---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/lib/wic/plugins/source/isoimage-isohybrid.py +3 -1
index d6bd3bf..9a30713 100644
@@ -329,13 +329,15 @@ class IsoImagePlugin(SourcePlugin):
 
                 if re.match("x86_64", target_arch):
                     grub_image = "grub-efi-bootx64.efi"
+                    grub_image_dst = "bootx64.efi"
                 elif re.match('i.86', target_arch):
                     grub_image = "grub-efi-bootia32.efi"
+                    grub_image_dst = "bootia32.efi"
                 else:
                     raise WicError("grub-efi is incompatible with target %s" %
                                    target_arch)
 
-                grub_target = os.path.join(target_dir, grub_image)
+                grub_target = os.path.join(target_dir, grub_image_dst)
                 if not os.path.isfile(grub_target):
                     grub_src = os.path.join(deploy_dir, grub_image)
                     if not os.path.exists(grub_src):
Signature · 1 line
2.7.4
#2 lore raw

Arsalan,

Quoted 11 lines · Arsalan Awan

From: "Arsalan H. Awan" <[email protected]>

The EFI bootloader name and path for being able to boot from a removable storage media - such as USB - must be like:

/EFI/BOOT/boot<arch>.efi
/EFI/BOOT/bootx64.efi
/EFI/BOOT/bootia32.efi
/EFI/BOOT/bootaa64.efi

otherwise system will not be able to boot from it.

Is this fixed in Master & Thud ?

- armin

Quoted 31 lines

This commit fixes the grub-efi bootloader destination image name accordingly just like efi_populate() function does it in meta/classes/grub-efi.bbclass.

---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/lib/wic/plugins/source/isoimage-isohybrid.py +3 -1
index d6bd3bf..9a30713 100644
@@ -329,13 +329,15 @@ class IsoImagePlugin(SourcePlugin):
 
                 if re.match("x86_64", target_arch):
                     grub_image = "grub-efi-bootx64.efi"
+                    grub_image_dst = "bootx64.efi"
                 elif re.match('i.86', target_arch):
                     grub_image = "grub-efi-bootia32.efi"
+                    grub_image_dst = "bootia32.efi"
                 else:
                     raise WicError("grub-efi is incompatible with target %s" %
                                    target_arch)
 
-                grub_target = os.path.join(target_dir, grub_image)
+                grub_target = os.path.join(target_dir, grub_image_dst)
                 if not os.path.isfile(grub_target):
                     grub_src = os.path.join(deploy_dir, grub_image)
                     if not os.path.exists(grub_src):
#3 lore raw
Quoted 14 lines

Arsalan,

Quoted 10 lines · Arsalan Awan

From: "Arsalan H. Awan" <[email protected]>

The EFI bootloader name and path for being able to boot from a removable storage media - such as USB - must be like:

/EFI/BOOT/boot<arch>.efi
/EFI/BOOT/bootx64.efi
/EFI/BOOT/bootia32.efi
/EFI/BOOT/bootaa64.efi

Quoted 5 lines
Quoted 1 line

otherwise system will not be able to boot from it.

Is this fixed in Master & Thud ?

- armin

Yes Armin! It is fixed in Thud and Master.

-
Arsalan

Quoted 32 lines
Quoted 32 lines

This commit fixes the grub-efi bootloader destination image name accordingly just like efi_populate() function does it in meta/classes/grub-efi.bbclass.

---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/lib/wic/plugins/source/isoimage-isohybrid.py +3 -1
index d6bd3bf..9a30713 100644
@@ -329,13 +329,15 @@ class IsoImagePlugin(SourcePlugin):
 
                 if re.match("x86_64", target_arch):
                     grub_image = "grub-efi-bootx64.efi"
+                    grub_image_dst = "bootx64.efi"
                 elif re.match('i.86', target_arch):
                     grub_image = "grub-efi-bootia32.efi"
+                    grub_image_dst = "bootia32.efi"
                 else:
                     raise WicError("grub-efi is incompatible with target %s" %
                                    target_arch)
 
-                grub_target = os.path.join(target_dir, grub_image)
+                grub_target = os.path.join(target_dir, grub_image_dst)
                 if not os.path.isfile(grub_target):
                     grub_src = os.path.join(deploy_dir, grub_image)
                     if not os.path.exists(grub_src):
#4 lore raw

ping

Quoted 57 lines
Quoted 14 lines

Arsalan,

Quoted 10 lines · Arsalan Awan

From: "Arsalan H. Awan" <[email protected]>

The EFI bootloader name and path for being able to boot from a removable storage media - such as USB - must be like:

/EFI/BOOT/boot<arch>.efi
/EFI/BOOT/bootx64.efi
/EFI/BOOT/bootia32.efi
/EFI/BOOT/bootaa64.efi

Quoted 5 lines
Quoted 1 line

otherwise system will not be able to boot from it.

Is this fixed in Master & Thud ?

- armin

Yes Armin! It is fixed in Thud and Master.

-
Arsalan

Quoted 32 lines
Quoted 32 lines

This commit fixes the grub-efi bootloader destination image name accordingly just like efi_populate() function does it in meta/classes/grub-efi.bbclass.

---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/lib/wic/plugins/source/isoimage-isohybrid.py +3 -1
index d6bd3bf..9a30713 100644
@@ -329,13 +329,15 @@ class IsoImagePlugin(SourcePlugin):
 
                 if re.match("x86_64", target_arch):
                     grub_image = "grub-efi-bootx64.efi"
+                    grub_image_dst = "bootx64.efi"
                 elif re.match('i.86', target_arch):
                     grub_image = "grub-efi-bootia32.efi"
+                    grub_image_dst = "bootia32.efi"
                 else:
                     raise WicError("grub-efi is incompatible with target %s" %
                                    target_arch)
 
-                grub_target = os.path.join(target_dir, grub_image)
+                grub_target = os.path.join(target_dir, grub_image_dst)
                 if not os.path.isfile(grub_target):
                     grub_src = os.path.join(deploy_dir, grub_image)
                     if not os.path.exists(grub_src):
#5 lore raw
Quoted 24 lines · Arsalan

ping

Quoted 22 lines
Quoted 14 lines

Arsalan,

Quoted 10 lines · Arsalan Awan

From: "Arsalan H. Awan" <[email protected]>

The EFI bootloader name and path for being able to boot from a removable storage media - such as USB - must be like:

   /EFI/BOOT/boot<arch>.efi
   /EFI/BOOT/bootx64.efi
   /EFI/BOOT/bootia32.efi
   /EFI/BOOT/bootaa64.efi
Quoted 5 lines
Quoted 1 line

otherwise system will not be able to boot from it.

Is this fixed in Master & Thud ?

- armin

Yes Armin! It is fixed in Thud and Master.

Would it make more sense to simply backport:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit?id=b591fb889b02ba82e6e35bb64b9fcb313f4bb5cb

#6 lore raw
Quoted 22 lines
Quoted 22 lines

ping

Quoted 20 lines
Quoted 19 lines

Arsalan,

Quoted 11 lines · Arsalan Awan

From: "Arsalan H. Awan" <[email protected]>

The EFI bootloader name and path for being able to boot from a removable storage media - such as USB - must be like:

   /EFI/BOOT/boot<arch>.efi
   /EFI/BOOT/bootx64.efi
   /EFI/BOOT/bootia32.efi
   /EFI/BOOT/bootaa64.efi

otherwise system will not be able to boot from it.

Is this fixed in Master & Thud ?

- armin

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

Yes Armin! It is fixed in Thud and Master.

Would it make more sense to simply backport:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit?id=b591fb889b02ba82e6e35bb64b9fcb313f4bb5cb

Yes!
That would be fine.

#7 lore raw
Quoted 19 lines · Arsalan
Quoted 19 lines
Quoted 19 lines

ping

Quoted 17 lines
Quoted 17 lines

Arsalan,

Quoted 11 lines · Arsalan Awan

From: "Arsalan H. Awan" <[email protected]>

The EFI bootloader name and path for being able to boot from a removable storage media - such as USB - must be like:

   /EFI/BOOT/boot<arch>.efi
   /EFI/BOOT/bootx64.efi
   /EFI/BOOT/bootia32.efi
   /EFI/BOOT/bootaa64.efi

otherwise system will not be able to boot from it.

Is this fixed in Master & Thud ?

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

- armin

Yes Armin! It is fixed in Thud and Master.

Would it make more sense to simply backport:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit?id=b591fb889b02ba82e6e35bb64b9fcb313f4bb5cb

got it thanks.

- armin

Quoted 2 lines

Yes!
That would be fine.

#8 lore raw
In reply to Awan, Arsalan
Quoted 1 line · Arsalan

ping

It is stagged for the next build

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=stable/sumo-nmut

- armin

Quoted 53 lines
Quoted 53 lines
Quoted 14 lines

Arsalan,

Quoted 10 lines · Arsalan Awan

From: "Arsalan H. Awan" <[email protected]>

The EFI bootloader name and path for being able to boot from a removable storage media - such as USB - must be like:

/EFI/BOOT/boot<arch>.efi
/EFI/BOOT/bootx64.efi
/EFI/BOOT/bootia32.efi
/EFI/BOOT/bootaa64.efi

Quoted 4 lines
Quoted 1 line

otherwise system will not be able to boot from it.

Is this fixed in Master & Thud ?

- armin

Yes Armin! It is fixed in Thud and Master.

-
Arsalan

Quoted 30 lines
Quoted 30 lines

This commit fixes the grub-efi bootloader destination image name accordingly just like efi_populate() function does it in meta/classes/grub-efi.bbclass.

---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/lib/wic/plugins/source/isoimage-isohybrid.py +3 -1
index d6bd3bf..9a30713 100644
@@ -329,13 +329,15 @@ class IsoImagePlugin(SourcePlugin):
 
                 if re.match("x86_64", target_arch):
                     grub_image = "grub-efi-bootx64.efi"
+                    grub_image_dst = "bootx64.efi"
                 elif re.match('i.86', target_arch):
                     grub_image = "grub-efi-bootia32.efi"
+                    grub_image_dst = "bootia32.efi"
                 else:
                     raise WicError("grub-efi is incompatible with target %s" %
                                    target_arch)
 
-                grub_target = os.path.join(target_dir, grub_image)
+                grub_target = os.path.join(target_dir, grub_image_dst)
                 if not os.path.isfile(grub_target):
                     grub_src = os.path.join(deploy_dir, grub_image)
                     if not os.path.exists(grub_src):