[Bug 1997795] Re: grub-multi-install offers wrong devices as ESP

Mauricio Faria de Oliveira 1997795 at bugs.launchpad.net
Tue Jan 3 16:58:19 UTC 2023


Verification done on focal-proposed.
---

$ lxc launch --vm ubuntu:focal grub2-f
$ lxc shell grub2-f

Before: /dev/sda15 (esp) AND /dev/sda

	# dpkg -S /usr/lib/grub/grub-multi-install
	grub-common: /usr/lib/grub/grub-multi-install

	# apt-cache policy grub-common
	grub-common:
	  Installed: 2.04-1ubuntu26.15
	  Candidate: 2.04-1ubuntu26.15
	  Version table:
	 *** 2.04-1ubuntu26.15 500
		500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
		100 /var/lib/dpkg/status
	     2.04-1ubuntu26.12 500
		500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
	     2.04-1ubuntu26 500
		500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

	# DEBIAN_FRONTEND=readline dpkg-reconfigure shim-signed
	Trying to migrate /boot/efi into esp config
	Configuring shim-signed
	-----------------------

	The grub-efi package is being upgraded. This menu allows you to select which EFI system partions you'd like grub-install to be automatically
	run for, if any.

	Running grub-install automatically is recommended in most situations, to prevent the installed GRUB core image from getting out of sync with
	GRUB modules or grub.cfg.

          1. /dev/sda (10737 MB; ) on 10737 MB QEMU_HARDDISK  2.
/dev/sda15 (111 MB; /boot/efi) on 10737 MB QEMU_HARDDISK  3. none of the
above

        (Enter the items you want to select, separated by spaces.)

        GRUB EFI system partitions: ^C

After: /dev/sda15 (esp) ONLY

	# add-apt-repository -y 'deb http://archive.ubuntu.com/ubuntu focal-proposed main'
	# apt install -y grub-common
	# apt-cache policy grub-common
	grub-common:
	  Installed: 2.04-1ubuntu26.16
	  Candidate: 2.04-1ubuntu26.16
	  Version table:
	 *** 2.04-1ubuntu26.16 500
		500 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 Packages
		100 /var/lib/dpkg/status
	     2.04-1ubuntu26.15 500
		500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
	     2.04-1ubuntu26.12 500
		500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
	     2.04-1ubuntu26 500
		500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

	# DEBIAN_FRONTEND=readline dpkg-reconfigure shim-signed
	Trying to migrate /boot/efi into esp config
	Configuring shim-signed
	-----------------------

	The grub-efi package is being upgraded. This menu allows you to select which EFI system partions you'd like grub-install to be automatically
	run for, if any.

	Running grub-install automatically is recommended in most situations, to prevent the installed GRUB core image from getting out of sync with
	GRUB modules or grub.cfg.

          1. /dev/sda15 (111 MB; /boot/efi) on 10737 MB QEMU_HARDDISK
2. none of the above

        (Enter the items you want to select, separated by spaces.)

        GRUB EFI system partitions: ^C

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

Title:
  grub-multi-install offers wrong devices as ESP

Status in grub2 package in Ubuntu:
  Fix Released
Status in grub2 source package in Focal:
  Fix Committed
Status in grub2 source package in Jammy:
  Fix Committed
Status in grub2 source package in Kinetic:
  Fix Committed

Bug description:
  [Impact]
  grub-multi-install offers the wrong device as ESP if a previous partition was recognized, because it does not correctly reset state between loop iterations, causing people to be offered e.g. the entire disk device as an ESP, and then install to obviously fail.

  [Test plan]
  Launch a lxd VM, run
   dpkg-reconfigure shim-signed

  check that only the ESP appears.

  Before the update, /dev/sda itself would appear as well.

  [Where problems could occur]
  Most importantly, some firmware are less restrictive about ESPs than grub-multi-install is, and if we previously accidentally "recognized" the partition as an ESP and now no longer do, grub does not get updated.

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




More information about the foundations-bugs mailing list