grub-efi-amd64: grub-efi/install_devices depends on the value of LC_COLLATE/LANG

Bug #1969841 reported by Louis Sautier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi,
As discussed with Julian Andres Klode on IRC, there are cases where the value of grub-efi/install_devices is affected by the value of LC_COLLATE.

This is caused by this unique sort: https://git.launchpad.net/~ubuntu-core-dev/grub/+git/ubuntu/tree/debian/grub-multi-install?h=debian/2.06-2ubuntu7#n220

# lsb_release -rd
Description: Ubuntu 22.04 LTS
Release: 22.04

From what I see, this can only happen on systems with NVMe drives:

# find -L /dev/disk/by-id/ -samefile /dev/nvme0n1p1
/dev/disk/by-id/nvme-eui.e8238fa6bf530001001b44455555555-part1
/dev/disk/by-id/nvme-WDC_CL_SN720_SDAQNTW-512G-2000_xxxx-part1

Let's assume grub-efi/install_devices has the following value:

# debconf-show grub-efi-amd64 | grep grub-efi/install_devices:
* grub-efi/install_devices: /dev/disk/by-id/nvme-WDC_CL_SN720_SDAQNTW-512G-2000_xxxx-part1, /dev/disk/by-id/nvme-WDC_CL_SN720_SDAQNTW-512G-2000_yyyy-part1

This was obtained with this LANG/LC_COLLATE:
# echo $LANG
C.UTF-8
# dpkg-reconfigure grub-efi-amd64
│ GRUB EFI system partitions: │
│ │
│ [*] /dev/nvme1n1p1 (535 MB; /boot/efi) on 512110 MB WDC CL SN720 SDAQNTW-512G-2000 │
│ [*] /dev/nvme0n1p1 (535 MB; ) on 512110 MB WDC CL SN720 SDAQNTW-512G-2000 │
# debconf-show grub-efi-amd64 | grep grub-efi/install_devices:
* grub-efi/install_devices: /dev/disk/by-id/nvme-WDC_CL_SN720_SDAQNTW-512G-2000_xxxx-part1, /dev/disk/by-id/nvme-WDC_CL_SN720_SDAQNTW-512G-2000_yyyy-part1

We can see that the boxes are properly ticked here.

However:
# export LANG=en_US.UTF-8; dpkg-reconfigure grub-efi-amd64
│ GRUB EFI system partitions: │
│ │
│ [ ] /dev/nvme1n1p1 (535 MB; /boot/efi) on 512110 MB WDC CL SN720 SDAQNTW-512G-2000 │
│ [ ] /dev/nvme0n1p1 (535 MB; ) on 512110 MB WDC CL SN720 SDAQNTW-512G-2000 │

The boxes are not ticked, if I tick them, I get the following:

# debconf-show grub-efi-amd64 | grep grub-efi/install_devices:
* grub-efi/install_devices: /dev/disk/by-id/nvme-eui.e8238fa6bf530001001b44455555555-part1, /dev/disk/by-id/nvme-eui.e8238fa6bf530001001b44666666-part1

I assume the postinst script for grub-pc exhibits the same bug with the value of grub-pc/install_devices.

affects: linux-meta (Ubuntu) → grub2 (Ubuntu)
Louis Sautier (lesbraz)
description: updated
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.