After changing GRUB_DISTRIBUTOR variable grub uses wrong grub.cfg file
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-
After some investigation it turns out that whatever folder within /boot/efi/EFI you boot from it always uses grub.cfg from /boot/efi/
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/
Change the value of GRUB_DISTRIBUTOR in /etc/default/grub to "test". Run dpkg-reconfigure grub-efi-
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/
This indicates that even when booting from /boot/efi/EFI/test grub is using the config file in /boot/efi/
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: grub-efi-
ProcVersionSign
Uname: Linux 5.15.0-27-generic x86_64
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckR
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)
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.