Ubuntu installation/update-grub fail on specific BIOS

Bug #1456911 reported by Ivan Hu
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Critical
Mathieu Trudel-Lapierre
Trusty
Fix Released
Medium
Mathieu Trudel-Lapierre
grub2-signed (Ubuntu)
Fix Released
Undecided
Unassigned
Trusty
Fix Released
Undecided
Adam Conrad

Bug Description

[Impact]
Users on newer UEFI firmware that follows spec 2.4b. (such an any new-ish Lenovo laptops, apparently, perhaps new Dell systems as well, etc.)

[Test case]
With the patch installs may fail to complete, update-grub may fail to run.

1) sudo update-grub
Notice whether the command shows an arithmetic error running /etc/grub.d/30_uefi-firmware

[Regression potential]
Limited; this fixes a value formatting error which caused any hex to be matched as string rather than an hex value in grub config scripts -- it will still match correctly on older BIOS versions.

---

Some new Bios would like to support the new feature,capsule update, on UEFI spec. 2.4b.
So the UEFI variable OsIndicationsSupported will be set as 0x1F on Bios, this causes the update-grub fail, also Ubuntu installation fail.

$ sudo update-grub
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.19.0-16-generic
Found initrd image: /boot/initrd.img-3.19.0-16-generic
Found linux image: /boot/vmlinuz-3.19.0-15-generic
Found initrd image: /boot/initrd.img-3.19.0-15-generic
/etc/grub.d/30_uefi-firmware: 34: /etc/grub.d/30_uefi-firmware: arithmetic expression: expecting EOF: " 1f & 1 "
~

Revision history for this message
Ivan Hu (ivan.hu) wrote :

I build a bios from EDKII that set the OsIndicationsSupported to 0x1f for QEMU.
This could be used to reproduced this issue on QEMU.

Revision history for this message
Ivan Hu (ivan.hu) wrote :

And I've also tested it,

modified the script on 30_uefi-firmware
   [ "$(( $(printf %x \'"$(cat $OsIndications | cut -b1)") & 1 ))" = 1 ]; then
to
   [ "$(( $(printf %d \'"$(cat $OsIndications | cut -b1)") & 1 ))" = 1 ]; then

could fix this issue.

Phillip Susi (psusi)
affects: grub (Ubuntu) → grub2 (Ubuntu)
Changed in grub2 (Ubuntu):
importance: Undecided → High
status: New → Triaged
Steve Langasek (vorlon)
Changed in grub2 (Ubuntu):
importance: High → Critical
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
Changed in grub2 (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

This is fixed in Debian git now; we'll get the fix with the next upload. Setting to Fix Committed.

Changed in grub2 (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.02~beta2-26ubuntu3

---------------
grub2 (2.02~beta2-26ubuntu3) wily; urgency=medium

  * debian/patches/uefi_firmware_setup.patch: take into account that the UEFI
    variable OsIndicationsSupported is a bit field, and as such should be
    compared as hex values in 30_uefi-firmware.in. (LP: #1456911)
  * Update quick boot logic to handle abstractions for which there is no
    write support. (LP: #1274320)

 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 06 Jul 2015 16:32:11 -0400

Changed in grub2 (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Chad Page (chad-page-d) wrote :

Is it possible to officially backport this change to Trusty?

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Yes, if you can help validating the fix once it's in trusty-proposed, I see no issue in doing the fix in SRU.

Changed in grub2 (Ubuntu Trusty):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
description: updated
Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello Ivan, or anyone else affected,

Accepted grub2 into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/grub2/2.02~beta2-9ubuntu1.12 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in grub2 (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in grub2-signed (Ubuntu):
status: New → Fix Released
Changed in grub2-signed (Ubuntu Trusty):
assignee: nobody → Adam Conrad (adconrad)
Revision history for this message
Adam Conrad (adconrad) wrote :

Hello Ivan, or anyone else affected,

Accepted grub2-signed into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/grub2-signed/1.34.14 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in grub2-signed (Ubuntu Trusty):
status: New → Fix Committed
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Chad, have you had a chance to try the updated packages from trusty-proposed? If they are reviewed / tested now and verified to work, should there be a respin we may be able to include them in the 16.04.1 media.

Revision history for this message
Adam Conrad (adconrad) wrote :

I've tested this grub for regressions, and it's happy here. As for the printf itself, while I don't have the right hardware to test on, it's identical to the printf in xenial and yakkety, so I see no reason to verify that specifically.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.02~beta2-9ubuntu1.12

---------------
grub2 (2.02~beta2-9ubuntu1.12) trusty; urgency=medium

  * debian/patches/uefi_firmware_setup.patch: take into account that the UEFI
    variable OsIndicationsSupported is a bit field, and as such should be
    compared as hex values in 30_uefi-firmware.in. (LP: #1456911)

 -- Mathieu Trudel-Lapierre <email address hidden> Fri, 29 Jul 2016 14:50:13 -0400

Changed in grub2 (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of the Stable Release Update for grub2 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2-signed - 1.34.14

---------------
grub2-signed (1.34.14) trusty; urgency=medium

  * Rebuild against grub-efi-amd64 2.02~beta2-9ubuntu1.12 (LP: #1456911)

 -- Adam Conrad <email address hidden> Tue, 02 Aug 2016 00:57:04 -0600

Changed in grub2-signed (Ubuntu Trusty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.