[Bug 1202438] New: grub2 can no longer boot from an ISO
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 Bug ID: 1202438 Summary: grub2 can no longer boot from an ISO Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: x86-64 OS: openSUSE Tumbleweed Status: NEW Severity: Normal Priority: P5 - None Component: Other Assignee: screening-team-bugs@suse.de Reporter: Hansi.Meir@gmx.de QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Long tiem ago, I have build a menu item in 40_custom where I boot Rescuezilla 2.3 from an ISO file. After the update from 2.06-25.2 to 2.06-26.1, however grub2 no longer finds the file, the entry is unusable: --------------------------------------------------------------------------------- #!/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry 'Rescuezilla' { # load_video # insmod loopback # insmod iso9660 # insmod part_gpt # insmod part_msdos # insmod gzio # insmod ntfs insmod ext2 ISO_FILE="/boot/iso/rescuezilla.iso" locale_dir=/boot/iso search --no-floppy --file $ISO_FILE --set loopback loop $ISO_FILE echo '... loading linux for rescuezilla' linux (loop)/casper/vmlinuz boot=casper isofrom_device=/dev/nvme1n1p5 iso-scan/filename=$ISO_FILE \ xforcevesa nomodeset vga=791 fsck.mode=skip noprompt edd=on ${locale_opts} -- echo '... loading initial ramdisk' initrd (loop)/casper/initrd.lz } menuentry 'System ausschalten' { echo "System shutdown initiated ..." halt } --------------------------------------------------------------------------------- I tried to change the search (via the UUID) or set root via the device, but no success. I restored the old version 2.06-25.2 and now I may boot this ISO file again. May be there is ab Bug in grub2 2.06-26.1? Or is there a mistake in my code above? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c1 --- Comment #1 from Hansi Meir <Hansi.Meir@gmx.de> --- Meanwhile grub2 version 2.06-27.1 is offered so I tried again. Unfortunately the problem persists. Maybe the important messages are helpful:
error: ../../grub-core/commands/search.c:296:no such device: /boot/iso/rescuezilla.iso. error: ../../grub-core/fs/fshelp.c:257:file '/boot/iso/rescuezilla.iso'not found.
Hint: this /boot/iso in error message is exist on a second NVMe, but system with grub and openSUSE is installed on first NVMe of a Lenovo Thinkbook 16p Gen2 Since there hasn't been any reaction so far, is someone on the matter? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c3 --- Comment #3 from Hansi Meir <Hansi.Meir@gmx.de> --- Please remember my first statement: it works until version 25, it fails since version 26. So of course I've installed version 25 currently. To your hints: 1. in UEFI-BIOS I can see both NVMe in the menu where I can select the boot order. So both NVMe should be bootable. 2. I entered grub command line from boot menu with version 25: 2.1 grub> ls shows both NVMe devices as (hd0) and (hd1) and all partitions on both. The rescuezilla.iso is in (hd1,gpt5). So I started with grub> ls (hd1,gpt5) that shows long technical data with fs, mod time, UUID, startpoint and capacity. Then I continued with grub> ls (hd1,gpt5)/boot/iso/rescuezilla.iso with this result: rescuezilla.iso grub> 3. Now I installed grub version 27 and repeated the procedure 3.1 same result as 2.1 with grub> ls and grub> ls (hd1,gpt5) But grub> ls (hd1,gpt5)/boot/iso/rescuezilla.iso now shows an error: error: ../../grub-core/kern/mm.c:372:out of memory That confirms my assumption: since version 26 something has changed and it's not a problem on my notebook. Meanwhile version 25 is active again and everything works fine. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c4 Michael Chang <mchang@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Hansi.Meir@gmx.de Flags| |needinfo?(Hansi.Meir@gmx.de | |) --- Comment #4 from Michael Chang <mchang@suse.com> --- The major change from 25 to 26 was adding tpm support to efi grub image and no change to existing ext2 module. Maybe the out of memory was caused by bigger memory consumption at run time due to additional memory allocation for measurement ? Anyway please help to check if your UEFI bios have tpm enabled ? If so, is it helpful to disable it ? Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c5 --- Comment #5 from Hansi Meir <Hansi.Meir@gmx.de> --- Yes, there is tpm enabled but as the AMD counterpart. Disabling is not helpful, but grub> ls (hd1,gpt5)/boot/iso/rescuezilla.iso now shows an this error: error: ../../grub-core/fs/fshelp.c:257:file '/boot/iso/rescuezilla.iso' not found btw: because the notebook is used with dual boot (Windows 11 and openSUSE Tumbleweed) may be it is no goood idea in principle to disable tpm? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c6 --- Comment #6 from Michael Chang <mchang@suse.com> --- (In reply to Hansi Meir from comment #5)
Yes, there is tpm enabled but as the AMD counterpart. Disabling is not helpful, but
grub> ls (hd1,gpt5)/boot/iso/rescuezilla.iso now shows an this error:
error: ../../grub-core/fs/fshelp.c:257:file '/boot/iso/rescuezilla.iso' not found
It is getting more strange. Is there any other file in your second NVME disk can be used to test file access other than the iso ? Or the file can be listed by grub> ls (hd1,gpt5)/boot/iso or even grub> ls (hd1,gpt5)/
btw: because the notebook is used with dual boot (Windows 11 and openSUSE Tumbleweed) may be it is no goood idea in principle to disable tpm?
Certainly not a good idea. It is just for debugging/troubleshooting. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c7 --- Comment #7 from Hansi Meir <Hansi.Meir@gmx.de> --- So sorry, I made a mistake on last try, there was an USB stick I forgot to remove . So hd1 was not the same as before ... I did it once again without USB stick (and disabled TPM) and then the old error: ../../grub-core/kern/mm.c:372:out of memory occured again. Sorry for that ... facepalm .... Then I tried a few files from NVMe2. One from my /home on gpt3, a jpg with 2,6 MB size in the download path, grub found it. Then I tried the other iso files in gpt5/boot/iso, grub only found one of it. It was SuperGrub2.iso and this file has only 15.6 MB size. All the other files are much bigger from round abound 700 MB up to 1.1 GB (the rescuzilla.iso). I tried also another small file in gpt5/boot/iso/ventoy-1.0.79/README and grub found it. May be file size makes the out of memory error? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c8 --- Comment #8 from Hansi Meir <Hansi.Meir@gmx.de> --- addendum: ALL FILES could be listed with the ls command. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 Felix Miata <mrmazda@earthlink.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mrmazda@earthlink.net -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c9 --- Comment #9 from Michael Chang <mchang@suse.com> --- (In reply to Hansi Meir from comment #7) [snip]
May be file size makes the out of memory error?
I guess so. To perform measurement, it is necessary that the files are read into memory in single chunk to calculate hash and extend the result into TPM PCRs before it can be used. What I don't understand is the problem didn't go away when tpm was disabled. I will have a look. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 Michael Chang <mchang@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bootloader-maintainers@suse | |.de -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c10 --- Comment #10 from Michael Chang <mchang@suse.com> --- Hi Hansi, The `loopback' module is not part of the signed grub.efi delivered by SUSE rpm. This has the question raised to me: Did you build and use your own grub.efi signed by your own key to have the loopback workable ? Or you have to let go Secure Boot disabled during the whole process booting Rescuezilla ? Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c11 --- Comment #11 from Hansi Meir <Hansi.Meir@gmx.de> --- I never touched anything like grub.efi and I only used openSUSE grub from openSUSE repository. The loopback statements I had found with google on multiple websites. I don't really know how this works, so I only modified filenames and devices. I just tried grub2 version 2.06-27.1 on my desktop PC - self build in 2015, tpm 1.2 module but not activated - and got exactly same problem, same messages. And grub> ls shows all devices and small files on "rescuezilla.iso-device" are found, but not rescuezilla.iso itself. Same memory error. And of course on this PC: I never touched anything like grub.efi and I only used openSUSE grub from openSUSE repository. May be there is a difference between openSUSE and SUSE? About Secure Boot: - On my PC in ASUS-BIOS is configured -- Secure Boot state: Enabled -- Platform Key (PK) state: Unloaded -- OS Type: Other OS - On my Notebook very strange -- Secure Boot: Enabled but on the first site is an informatve overview of all current settings and it shows Secure Boot as disabled. I don't know why. I guess a bug in Lenovo BIOS but which expression is the correct one? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c12 Richard Brown <rbrown@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rbrown@suse.com --- Comment #12 from Richard Brown <rbrown@suse.com> --- Seeing the out of memory issue too on multiple Dell UEFI machines (namely XPS 13 and Inspiron 5510) Disabling Secure Boot/TPM in BIOS Setup doesn't workaround the issue This means in essence we have a number of machines out there that can no longer boot Tumbleweed or MicroOS installation media After discussion with Michael the decision has been to (at least temporarily) revert the grub tpm changes in Factory Revert happening right now, will be using this bug reference to keep track on it -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c13 --- Comment #13 from Hansi Meir <Hansi.Meir@gmx.de> --- I guess that's why I found 2.06-28.1 today. It works fine, thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c14 --- Comment #14 from Richard Brown <rbrown@suse.com> --- Copy/Paste of my debugging info for Michael as we dug deeper in this Image based with MicroOS 0829 using his 1202438 patched grub2 TPM 2.0 On + Enabled in the BIOS, Dell 5510 (so, default settings). Boot fails, tpm-hello below Hello! TPM 2.0 HashAlgorithmBitmap 0x3 TPMPresentFlag 0x1 NumberOfPcrBanks 0x2 ActivePcrBanks0x3 TPM 2.0 Off in the BIOS, Dell 5510. Boot WORKS! (YAY!), tpm-hello below Hello! No TPM Handle found! TPM 2.0 On but Disabled, Dell 5510, Boot FAILS (meh) tpm-hello below Hello! TPM 2.0 HashAlgorithmBitmap 0x3 TPMPresentFlag 0x1 NumberOfPcrBanks 0x2 ActivePcrBanks 0x3 So, it seems there's no difference between On+Enabled and On+Disabled, but turning the TPM off does work with your patch -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c15 --- Comment #15 from Richard Brown <rbrown@suse.com> --- The Dell XPS 13 shows subtly different info when debugging the TPM status (below), but the same behaviour - boots with your patch only with TPM Off, out of Memory with TPM On (+ Enabled or Disabled) Hello! TPM 2.0 HashAlgorithmBitmap 0x7 TPMPresentFlag 0x1 NumberOfPcrBanks 0x3 ActivePcrBanks 0x3 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c17 --- Comment #17 from Hansi Meir <Hansi.Meir@gmx.de> --- I don't know an unrpm and neither does my tumbleweed, sorry I'm not a hero with things like rpm packages. I tried with ark and extracted grub.efi only. Hope this was your intention. After replacing it and disabling secure boot I tried with - TPM enabled -- rescuezilla.iso not found, it looks like original problem - TPM disabled -- rescuezilla.iso was booted, looks good -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c20 --- Comment #20 from Hansi Meir <Hansi.Meir@gmx.de> --- Hi Gary, I started tests with Secure Boot disabled. - TPM disabled -- works good (boot of rescuzilla.iso successfully) after a black screen delay of 66 seconds - TPM enabled -- same result - Secure Boot and TPM enabled -- same result Would this delay disappear, it would be perfect. If this is not possible, a message like "be patient..." should appear. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c23 --- Comment #23 from Hansi Meir <Hansi.Meir@gmx.de> --- Hi Gary, when TPM is ensabled, rescuzilla.iso boot up successfully but with the black screen delay of 66 seconds. When TPM is disabled there is no delay, state of Secure Boot doesn't matter. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c24 --- Comment #24 from Gary Ching-Pang Lin <glin@suse.com> --- Okay, at least the loading time is improved when TPM is disabled. As for the delay with TPM, I don't have a good solution now. The grub2 verifier is designed to load the whole file into memory and then measure the file content with TPM, and this would take a while for the additional memory allocation and file reading. Maybe we can do the check in verifier's open() and show some messages to notify the user about the possible delay. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c26 --- Comment #26 from Hansi Meir <Hansi.Meir@gmx.de> --- Hi Gary, The delay is unfortunately unchanged at 66s. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c28 --- Comment #28 from Hansi Meir <Hansi.Meir@gmx.de> --- And it is quite sure that the memory allocation is the reason? Since changes do nothing there: couldn't something completely different be the cause? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c29 --- Comment #29 from Gary Ching-Pang Lin <glin@suse.com> --- (In reply to Hansi Meir from comment #28)
And it is quite sure that the memory allocation is the reason? Since changes do nothing there: couldn't something completely different be the cause?
There are 3 possible causes in your case. 1) memory allocation 2) big file reading 3) TPM measurement on a big file The memory allocation could be very inefficient when the heap is used up following lots of small chunk allocations. This may be improved by setting a minimal allocation size. However, it doesn't help your case, so it seems to me that the delay is mainly caused by 2) and 3). It's unfortunate that those two are required for the effective TPM measurement, and I don't know if there is any way to accelerate the process... -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c31 --- Comment #31 from Hansi Meir <Hansi.Meir@gmx.de> --- Hi Gary, no idea what that means ... two PCIe3 NVMe are installed here. - grub2 & system is on first: Sandisk WD Black SN750 - rescuzilla.iso on second: Micron/Crucial P2 Test result: the delay is unfortunately unchanged at 66s. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202438 http://bugzilla.opensuse.org/show_bug.cgi?id=1202438#c33 --- Comment #33 from OBSbugzilla Bot <bwiedemann+obsbugzillabot@suse.com> --- This is an autogenerated message for OBS integration: This bug (1202438) was mentioned in https://build.opensuse.org/request/show/1008674 Factory / grub2 -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com