Public bug reported:

[Impact]

GCE cloud instances started with images released prior to 2020-11-11
will fail to reboot when the newest grub2 2.02~beta2-36ubuntu3.32
packages are installed from -updates.

Upon reboot, the instance drops down to a grub prompt, and ceases to
boot any further.

The output displayed is:

BdsDxe: loading Boot0003 "debian" from 
HD(15,GPT,<UUID>,0x2800,0x35000)/\EFI\debian\shimx64.efi
BdsDxe: starting Boot0003 "debian" from 
HD(15,GPT,<UUID>,0x2800,0x35000)/\EFI\debian\shimx64.efi

UEFI: Attempting to start image.
Description: debian
FilePath: 
HD(15,GPT,36903981-58D9-4718-A4EC-3D3E6CF6AF42,0x2800,0x35000)/\EFI\debian\shimx64.efi
OptionNumber: 3.

GNU GRUB version 2.04
grub>

Now, on GCE cloud images prior to 2020-11-11, /etc/default/grub.d/50
-cloudimg-settings.cfg contained this line:

GRUB_DISTRIBUTOR=Debian

In images after 2020-11-11, this line was REMOVED from
/etc/default/grub.d/50-cloudimg-settings.cfg and instead, images fell
back to the below line in /etc/default/grub

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

The above line always returns "Ubuntu".

The new grub2 version 2.02~beta2-36ubuntu3.32 now places the EFI
executables in the /EFI/Ubuntu directory, while the grub config points
to /EFI/Debian, and the grub config cannot be found, and hence we drop
to a grub shell.

[Testcase]

You can start an instance up on Google Cloud with an affected image with
the below command:

gcloud compute instances create test-xenial-1
--image=ubuntu-1604-xenial-v20200429 --image-project=ubuntu-os-cloud

>From there:

$ sudo apt update
$ sudo apt install grub-common grub-efi-amd64 grub-efi-amd64-bin 
grub-efi-amd64-signed grub-pc-bin grub2-common
$ sudo reboot

The instance will not come back up, and you will see a grub shell in the
logs on GCP.

You can also reproduce in KVM. Simply add:

GRUB_DISTRIBUTOR=Debian

to a file in /etc/default/grub.d/50-cloudimg-settings.cfg then:

$ sudo update-grub
$ sudo reboot

[Where problems could occur]

We will be changing the grub configuration for every Google cloud
instance started with an image produced before 2020-11-11, and there is
risk that we could make a change which prevents instances from booting.
We should proceed with caution and make sure to test older and newer
images.

The fix will be targeted to the /etc/default/grub.d/50-cloudimg-
settings.cfg file only, so only cloud instances would get the change,
and only if the grub versions match particular versions.

[Other info]

A workaround is to remove the below line from /etc/default/grub.d/50
-cloudimg-settings.cfg before installing the new grub packages.

GRUB_DISTRIBUTOR=Debian

** Affects: grub2 (Ubuntu)
     Importance: Undecided
         Status: Fix Released

** Affects: grub2 (Ubuntu Xenial)
     Importance: Critical
         Status: In Progress


** Tags: sts xenial

** Also affects: grub2 (Ubuntu Xenial)
   Importance: Undecided
       Status: New

** Changed in: grub2 (Ubuntu)
       Status: New => Fix Released

** Changed in: grub2 (Ubuntu Xenial)
   Importance: Undecided => Critical

** Changed in: grub2 (Ubuntu Xenial)
       Status: New => In Progress

** Tags added: sts xenial

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1928040

Title:
  GCE instances drop to a grub prompt when GRUB_DISTRIBUTOR=Debian is
  set

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1928040/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to