Comment 0 for bug 1969841

Revision history for this message
Louis Sautier (lesbraz) wrote :

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.