Grub2 Booting in blind mode due to "invalid video mode specification `text'"

Bug #1826453 reported by Dexuan Cui on 2019-04-25
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Undecided
Unassigned
Trusty
Undecided
Unassigned
Xenial
Medium
Mathieu Trudel-Lapierre
grub2-signed (Ubuntu)
Undecided
Unassigned
Trusty
Undecided
Unassigned
Xenial
Undecided
Unassigned

Bug Description

[Impact]
UEFI users booting VMs on Hyper-V

[Test case]
1) Install Ubuntu 16.04 in a Gen2 VM on Hyper-V (Windows)
2) After install; edit /etc/default/grub to add:
GRUB_GFXPAYLOAD_LINUX="text"
3) Run 'sudo update-grub'
4) Reboot

Verify whether the system writes an error/warning on console during boot (this shows up and disappears quickly, one must watch the console attentively):

error: invalid video mode specification `text'.
Booting in blind mode

[Regression potential]
There is minimal risk of regression; this is a patch that has been succesfully used in other releases to address the same issue (see bug 1711452). It only affects graphical payload selection in grub to avoid a value that is clearly invalid, thus skipping the error value and falling back to the default text-mode. Care should be taking while testing to identify any possible issues with displaying the grub menu or outputting information from the kernel at console as the system boots (if applicable).

---

In a Ubuntu 16.04.6 VM, which runs as a Gen2 VM on Hyper-V, I add GRUB_GFXPAYLOAD_LINUX="text" into /etc/default/grub and run update-grub; next, grub2 prints the below error:

error: invalid video mode specification `text'.
Booting in blind mode

This means grub2 passes a zero value for the "lfb_base" to Linux kernel, which then fails to reserve the framebuffer MMIO range in drivers/hv/vmbus_drv.c: vmbus_reserve_fb(); as a result, when we pass through a PCIe device to the VM, the PCIe device may get a PCI MMIO BAR in the FB MMIO range, causing a conflict, and the PCIe device can not work in the VM.

The issue can not reproduce with Ubuntu 18.04. It turns out the grub2 in Ubuntu 18.04 has the below fix:
video: skip 'text' gfxpayload if not supported, to fallback to default (https://git.launchpad.net/~ubuntu-core-dev/grub/+git/ubuntu/commit/?id=38d9e2f862a96a039ae8ca8b87b8615d154ceda4).

I'm asking the patch author (Mathieu Trudel-Lapierre) to submit the patch to the upstream grub and this is the upstream bug link: https://savannah.gnu.org/bugs/?56217 .

Here this launchpad bug is for Ubuntu 16.04 and 14.04.

You're mentioning 14.04 here; elsewhere it's only question of 16.04. Is this patch really needed on 14.04 as well?

Changed in grub2 (Ubuntu):
status: New → Fix Released
Changed in grub2 (Ubuntu Xenial):
status: New → In Progress
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
importance: Undecided → Medium

Marking Fix Released for other releases; the patch is already provided in Bionic and above.

Dexuan Cui (decui) wrote :

I was not clear about the lifecycle of 16.04 and 14.04. :-)

AFAIK, there is no real need to fix the bug for 14.04.
And I understand it looks there won't be a 16.04.7, either.

Since the bug is already fixed in 18.04 (and newer? I didn't check 19.xx), it looks to me we can leave it as is for 16.04 and 14.04, and mark the bug as WON'T FIX, if there is nothing we can really do for 16.04 and 14.04.

tags: added: id-5cc33192fdf0ba69633c3a45

Dexuan,

To be clear, while there is no further point-release to be published for 16.04, we can still fix the bug. The patch will be available to users updating their systems normally while 16.04 is supported, so daily images may receive the fix (if this is applicable to clouds) and after an update of grub, one should no longer see the error.

description: updated

Hello Dexuan, or anyone else affected,

Accepted grub2 into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/grub2/2.02~beta2-36ubuntu3.22 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 on 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-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in grub2 (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-xenial
Dexuan Cui (decui) wrote :

Hi Mathieu, thank you for the explanation and pushing the fix!

Hi Brian, I'll test the new grub2 binary in a Ubuntu 16.04.6 VM on Hyper-V.

Dexuan Cui (decui) wrote :

It looks the .22 binary (2.02~beta2-36ubuntu3.22) for amd64 has not appeared in the -proposed repo yet.

I can not find it in https://launchpad.net/ubuntu/xenial/+package/grub-common and http://archive.ubuntu.com/ubuntu/dists/xenial-proposed/main/uefi/grub2-amd64/ (please let me know if I'm looking at the wrong place)

Dexuan Cui (decui) wrote :

I added
deb http://archive.ubuntu.com/ubuntu/ xenial-proposed restricted main multiverse universe
into /etc/apt/sources.list and ran "apt-get update", and when I tried to upgrade to the .22 version, it can not be found:

root@decui-g2-1604:~# apt-get install grub2-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
grub2-common is already the newest version (2.02~beta2-36ubuntu3.21).
grub2-common set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 70 not upgraded.

root@decui-g2-1604:~# apt-get install grub2-common=2.02~beta2-36ubuntu3.22
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '2.02~beta2-36ubuntu3.22' for 'grub2-common' was not found

Brian Murray (brian-murray) wrote :

Hello Dexuan, or anyone else affected,

Accepted grub2-signed into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/grub2-signed/1.66.22 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 on 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-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in grub2-signed (Ubuntu Xenial):
status: New → Fix Committed
Changed in grub2-signed (Ubuntu):
status: New → Fix Released
Dexuan Cui (decui) wrote :

Hi Brian, "apt-get update; apt-get install grub2-common" still reports "grub2-common is already the newest version (2.02~beta2-36ubuntu3.21)" to me, and the new version can not be found.

I'm running the Ubuntu 16.04.6 LTS (4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64) version and I have "deb http://archive.ubuntu.com/ubuntu/ xenial-proposed restricted main multiverse universe" in my /etc/apt/sources.list. I guess I must be missing something?

Hi Dexuan,

You might want to try this again. There were some delays in completely processing all the required files for this SRU, which may have translated in it not being available when you tried.

Judging from deploying a VM here with bionic-proposed enabled, it should be available now:

ubuntu@civil-eft:~$ apt policy grub2-common
grub2-common:
  Installed: 2.02~beta2-36ubuntu3.22
  Candidate: 2.02~beta2-36ubuntu3.22
  Version table:
 *** 2.02~beta2-36ubuntu3.22 100
         -1 http://archive.ubuntu.com/ubuntu xenial-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     2.02~beta2-36ubuntu3.21 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
     2.02~beta2-36ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages

Dexuan Cui (decui) wrote :

Hi Mathieu,
Thanks for the hint! After I changed the Pin-Priority from 400 to 600 in the below file, I successfully installed the *3.22 version:

root@decui-g2-1604:~# cat /etc/apt/preferences.d/proposed-updates
Package: *
Pin: release a=xenial-proposed
Pin-Priority: 600

...

root@decui-g2-1604:~# apt policy grub2-common
grub2-common:
  Installed: 2.02~beta2-36ubuntu3.22
  Candidate: 2.02~beta2-36ubuntu3.22
  Version table:
 *** 2.02~beta2-36ubuntu3.22 600
        600 http://archive.ubuntu.com/ubuntu xenial-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     2.02~beta2-36ubuntu3.21 500
        500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
     2.02~beta2-36ubuntu3 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

And I can confirm the issue is fixed for "16.04.6 LTS (Xenial Xerus)"!

Now in the VM running on Hyper-V, I get the below as expected (previously I can not see the line with the *3.21 version of grub2):

root@decui-g2-1604:~# dmesg | grep "efifb: framebuffer"
[ 0.472000] efifb: framebuffer at 0xf8000000, mapped to 0xffffc90001c00000, using 3072k, total 3072k

Thank you all for the quick response!

Thanks! Marking verification-done-xenial since it's been confirmed to fix the issue.

tags: added: verification-done-xenial
removed: verification-needed verification-needed-xenial
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.02~beta2-36ubuntu3.22

---------------
grub2 (2.02~beta2-36ubuntu3.22) xenial; urgency=medium

  * debian/patches/skip_text_gfxpayload_where_not_supported.patch: Skip the
    'text' payload if it's not supported but present in gfxpayload, such as
    on EFI systems. (LP: #1826453)

 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 29 Apr 2019 10:04:24 -0400

Changed in grub2 (Ubuntu Xenial):
status: Fix Committed → Fix 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.

Launchpad Janitor (janitor) wrote :

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

---------------
grub2-signed (1.66.22) xenial; urgency=medium

  * Rebuild against grub2 2.02~beta2-36ubuntu3.22. (LP: #1826453)

 -- Mathieu Trudel-Lapierre <email address hidden> Tue, 30 Apr 2019 11:16:33 -0400

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

Other bug subscribers