After changing GRUB_DISTRIBUTOR variable grub uses wrong grub.cfg file

Bug #1972683 reported by Tony Middleton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2-signed (Ubuntu)
New
Undecided
Unassigned

Bug Description

An ubuntu system has files in a folder within /boot/efi/EFI and an EFI variable both of whose names are given by the GRUB_DISTRIBUTOR variable in /etc/default/grub. By default this is set to "ubuntu".

I wish to have two ubuntu systems on the same machine so on one of them at least need to change GRUB_DISTRIBUTOR to something else. In the past I have done this with two systems "main" and "backup". This worked fine using grub-efi-amd64.

I have recently tried this on a new system using grub-efi-amd64-signed and ended up with an unbootable system.

After some investigation it turns out that whatever folder within /boot/efi/EFI you boot from it always uses grub.cfg from /boot/efi/EFI/ubuntu.

I can now recreate this at will in virtualbox. To exhibit this do the following steps:

Do a fresh install of ubuntu in virtualbox. Check for existence of /boot/efi/EFI/ubuntu, that an EFI entry is shown by efibootmgr and that the system reboots.

Change the value of GRUB_DISTRIBUTOR in /etc/default/grub to "test". Run dpkg-reconfigure grub-efi-amd64-signed to trigger grub-install. Check for existence of /boot/efi/EFI/test, that a test EFI entry is shown by efibootmgr. Change nextboot to the test entry and check that the system reboots.

Rename grub.cfg from /boot/efi/EFI/test and reboot from the test entry. Boot should fail, but it doesn't.

Restore the test grub.cfg and rename the grub.cfg in /boot/efi/EFI/ubuntu. Reboot from the test entry. This should work OK but it fails.

This indicates that even when booting from /boot/efi/EFI/test grub is using the config file in /boot/efi/EFI/ubuntu

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: grub-efi-amd64-signed 1.180+2.06-2ubuntu7
ProcVersionSignature: Ubuntu 5.15.0-27.28-generic 5.15.30
Uname: Linux 5.15.0-27-generic x86_64
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: MATE
Date: Mon May 9 15:59:26 2022
InstallationDate: Installed on 2022-04-26 (12 days ago)
InstallationMedia: Ubuntu-MATE 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
SourcePackage: grub2-signed
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Tony Middleton (ximera) wrote :
Revision history for this message
Tony Middleton (ximera) wrote :

This seems to be a duplicate of 1242417. However the fix applied for that bug didn't fix the underlying problem but instead created a workaround that was sufficient for the case that led to the bug. It does not fix the situation reported here.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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