Bug#1051292: grub-efi-amd64 post install script 10_linux.orig fails with locally compiled kernel

tv.debian tv.debian at googlemail.com
Tue Sep 5 21:49:00 BST 2023


Package: grub-efi-amd64
Version: 2.12~rc1-7
Severity: important

Dear Maintainer,

I think I have hit a corner case with latest grub-efi-amd64 upgrade in 
unstable. On my machine with a locally compiled kernel (installed along 
Debian kernel) the installation fails with error 127.
Here is the output of the process:

"
script -c "dpkg --configure -a" dpkg.log
Script started, output log file is 'dpkg.log'.
Setting up grub-efi-amd64 (2.12~rc1-7) ...
Installing for x86_64-efi platform.
Installation finished. No error reported.
Generating grub configuration file ...
Found background: /boot/grub/bush_viper.jpg
Found background image: /boot/grub/bush_viper.jpg
Found linux image: /boot/vmlinuz-6.5.1-deb64
Found initrd image: /boot/initrd.img-6.5.1-deb64
Found linux image: /boot/vmlinuz-6.4.0-4-amd64
Found initrd image: /boot/initrd.img-6.4.0-4-amd64
+ prefix=/usr
+ exec_prefix=/usr
+ datarootdir=/usr/share
+ . /usr/share/grub/grub-mkconfig_lib
+ prefix=/usr
+ exec_prefix=/usr
+ datarootdir=/usr/share
+ datadir=/usr/share
+ bindir=/usr/bin
+ sbindir=/usr/sbin
+ [ x/usr/share/grub = x ]
+ test x = x
+ grub_probe=/usr/sbin/grub-probe
+ test x = x
+ grub_file=/usr/bin/grub-file
+ test x = x
+ grub_mkrelpath=/usr/bin/grub-mkrelpath
+ command -v gettext
+ :
+ grub_tab=
+ export TEXTDOMAIN=grub
+ export TEXTDOMAINDIR=/usr/share/locale
+ CLASS=--class gnu-linux --class gnu --class os
+ [ xDebian = x ]
+ [ Debian = Ubuntu ]
+ OS=Debian GNU/Linux
+ echo Debian
+ tr A-Z a-z
+ cut -d  -f1
+ CLASS=--class debian --class gnu-linux --class gnu --class os
+ [ x45b120bd-c7a5-4d00-9c5b-a72c48a663fc = x ]
+ [ x = xtrue ]
+ test -e /dev/disk/by-uuid/45b120bd-c7a5-4d00-9c5b-a72c48a663fc
+ uses_abstraction /dev/mapper/deb64crypt lvm
+ device=/dev/mapper/deb64crypt
+ old_ifs=

+ IFS=

+ /usr/sbin/grub-probe --device /dev/mapper/deb64crypt --target=abstraction
+ abstraction=cryptodisk
luks2
gcry_twofish
gcry_twofish
gcry_sha256
gcry_sha256
+ test xcryptodisk = xlvm
+ test xluks2 = xlvm
+ test xgcry_twofish = xlvm
+ test xgcry_twofish = xlvm
+ test xgcry_sha256 = xlvm
+ test xgcry_sha256 = xlvm
+ IFS=

+ return 1
+ LINUX_ROOT_DEVICE=UUID=45b120bd-c7a5-4d00-9c5b-a72c48a663fc
+ /usr/sbin/grub-probe --device /dev/mapper/deb64crypt --target=fs
+ GRUBFS=ext2
+ [ xext2 = x ]
+ title_correction_code=
+ uname -m
+ machine=x86_64
+ grub_file_is_not_garbage /boot/vmlinuz-6.4.0-4-amd64
+ test -f /boot/vmlinuz-6.4.0-4-amd64
+ return 0
+ echo -n /boot/vmlinuz-6.4.0-4-amd64
+ grub_file_is_not_garbage /boot/vmlinuz-6.5.1-deb64
+ test -f /boot/vmlinuz-6.5.1-deb64
+ return 0
+ echo -n /boot/vmlinuz-6.5.1-deb64
+ grub_file_is_not_garbage /vmlinuz-*
+ test -f /vmlinuz-*
+ return 1
+ grub_file_is_not_garbage /boot/kernel-*
+ test -f /boot/kernel-*
+ return 1
+ list=/boot/vmlinuz-6.4.0-4-amd64 /boot/vmlinuz-6.5.1-deb64
+ GENKERNEL_ARCH=x86_64
+ prepare_boot_cache=
+ prepare_root_cache=
+ boot_device_id=
+ title_correction_code=
+ submenu_indentation=
+ is_first_entry=true
+ [ x/boot/vmlinuz-6.4.0-4-amd64 /boot/vmlinuz-6.5.1-deb64  != x ]
+ version_find_latest /boot/vmlinuz-6.4.0-4-amd64 /boot/vmlinuz-6.5.1-deb64
/etc/grub.d/10_linux.orig: 1: version_find_latest: not found
+ linux=
dpkg: error processing package grub-efi-amd64 (--configure):
  installed grub-efi-amd64 package post-installation script subprocess 
returned error exit status 127
dpkg: dependency problems prevent configuration of grub-efi:
  grub-efi depends on grub-efi-amd64 (= 2.12~rc1-7); however:
   Package grub-efi-amd64 is not configured yet.

dpkg: error processing package grub-efi (--configure):
  dependency problems - leaving unconfigured
Processing triggers for shim-signed:amd64 (1.40+15.7-1) ...
Errors were encountered while processing:
  grub-efi-amd64
  grub-efi
Script done.
"

My understanding is that 10_linux.orig tries and fails to determine the 
newest installed kernel in:

"
is_first_entry=true
while [ "x$list" != "x" ] ; do
   linux=`version_find_latest $list`
   case $linux in
     *.efi.signed)
"
If this is only due to my naming of the local kernel I'll change this, 
but it didn't happen before in the 10+ years I have used the exact same 
naming scheme for my kernels, so maybe there is something a bit fragile 
in the script logic?

Thanks a lot for your attention and your contribution to Debian.

-- Package-specific info:

*********************** BEGIN /proc/mounts
/dev/mapper/deb64crypt / ext4 
rw,relatime,discard,nodelalloc,errors=remount-ro 0 0
/dev/nvme0n1p2 /boot ext4 
rw,relatime,discard,nodelalloc,errors=remount-ro 0 0
/dev/nvme0n1p1 /boot/efi vfat 
rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 
0 0
/dev/mapper/_dev_md126 /home ext4 
rw,relatime,discard,nodelalloc,stripe=128 0 0
/dev/mapper/_dev_nvme1n1p1 /home/thveillon/STEAM_2 ext4 
rw,relatime,discard,nodelalloc 0 0
/dev/mapper/_dev_md125 /home/thveillon/BACKUPS ext4 
rw,nodev,noexec,relatime,nodelalloc 0 0
*********************** END /proc/mounts

*********************** BEGIN /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] 
[raid4] [raid10]
md125 : active raid1 sdb1[1] sda1[0]
       9765254144 blocks super 1.2 [2/2] [UU]
       bitmap: 0/73 pages [0KB], 65536KB chunk

md126 : active raid1 sdd2[1] sdc2[0]
       1934507008 blocks super 1.2 [2/2] [UU]
       bitmap: 0/15 pages [0KB], 65536KB chunk

md127 : active raid1 sdd1[1] sdc1[0]
       8379392 blocks super 1.2 [2/2] [UU]

unused devices: <none>
*********************** END /proc/mdstat

*********************** BEGIN /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root  9 Sep  5 19:05 ata-ST10000VN0008-2PJ103_ZS503AMC 
-> ../../sda
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
ata-ST10000VN0008-2PJ103_ZS503AMC-part1 -> ../../sda1
lrwxrwxrwx 1 root root  9 Sep  5 19:05 ata-ST10000VN0008-2PJ103_ZS503CD3 
-> ../../sdb
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
ata-ST10000VN0008-2PJ103_ZS503CD3-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  9 Sep  5 19:05 
ata-Samsung_SSD_860_EVO_2TB_S3YVNB0M100073T -> ../../sdd
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
ata-Samsung_SSD_860_EVO_2TB_S3YVNB0M100073T-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
ata-Samsung_SSD_860_EVO_2TB_S3YVNB0M100073T-part2 -> ../../sdd2
lrwxrwxrwx 1 root root  9 Sep  5 19:05 
ata-Samsung_SSD_860_EVO_2TB_S3YVNB0M100291M -> ../../sdc
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
ata-Samsung_SSD_860_EVO_2TB_S3YVNB0M100291M-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
ata-Samsung_SSD_860_EVO_2TB_S3YVNB0M100291M-part2 -> ../../sdc2
lrwxrwxrwx 1 root root  9 Sep  5 19:05 
ata-Samsung_SSD_860_EVO_500GB_S4FNNF0M936678F -> ../../sde
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
ata-Samsung_SSD_860_EVO_500GB_S4FNNF0M936678F-part1 -> ../../sde1
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
ata-Samsung_SSD_860_EVO_500GB_S4FNNF0M936678F-part2 -> ../../sde2
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
ata-Samsung_SSD_860_EVO_500GB_S4FNNF0M936678F-part3 -> ../../sde3
lrwxrwxrwx 1 root root 10 Sep  5 19:05 dm-name-_dev_md125 -> ../../dm-4
lrwxrwxrwx 1 root root 10 Sep  5 19:05 dm-name-_dev_md126 -> ../../dm-2
lrwxrwxrwx 1 root root 10 Sep  5 19:05 dm-name-_dev_nvme1n1p1 -> ../../dm-3
lrwxrwxrwx 1 root root 10 Sep  5 19:05 dm-name-cryptswap3 -> ../../dm-1
lrwxrwxrwx 1 root root 10 Sep  5 19:05 dm-name-deb64crypt -> ../../dm-0
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
dm-uuid-CRYPT-LUKS2-57dde1a3336c4dfdbcadc6773f1dfa57-_dev_md126 -> 
../../dm-2
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
dm-uuid-CRYPT-LUKS2-58fc45067de841c986bf39de880d94a0-deb64crypt -> 
../../dm-0
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
dm-uuid-CRYPT-LUKS2-c0e24d39493d44debd8cb2622daa7300-_dev_nvme1n1p1 -> 
../../dm-3
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
dm-uuid-CRYPT-LUKS2-c6e9f22b45ea4e72b52ed50ee0efec4d-_dev_md125 -> 
../../dm-4
lrwxrwxrwx 1 root root 10 Sep  5 19:05 dm-uuid-CRYPT-PLAIN-cryptswap3 -> 
../../dm-1
lrwxrwxrwx 1 root root 11 Sep  5 19:05 md-name-deb64:1 -> ../../md127
lrwxrwxrwx 1 root root 11 Sep  5 19:05 md-name-deb64:128 -> ../../md125
lrwxrwxrwx 1 root root 11 Sep  5 19:05 md-name-deb64:4 -> ../../md126
lrwxrwxrwx 1 root root 11 Sep  5 19:05 
md-uuid-4cb3e528:07228e95:0090fa79:d695bd65 -> ../../md125
lrwxrwxrwx 1 root root 11 Sep  5 19:05 
md-uuid-8186773a:ecf233ad:c792e645:b89c4739 -> ../../md126
lrwxrwxrwx 1 root root 11 Sep  5 19:05 
md-uuid-fc4855c9:68722fd2:8c4eb86d:7b733fc4 -> ../../md127
lrwxrwxrwx 1 root root 13 Sep  5 19:05 
nvme-KINGSTON_SFYRD2000G_50026B7686086D51 -> ../../nvme1n1
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
nvme-KINGSTON_SFYRD2000G_50026B7686086D51-part1 -> ../../nvme1n1p1
lrwxrwxrwx 1 root root 13 Sep  5 19:05 
nvme-KINGSTON_SFYRD2000G_50026B7686086D51_1 -> ../../nvme1n1
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
nvme-KINGSTON_SFYRD2000G_50026B7686086D51_1-part1 -> ../../nvme1n1p1
lrwxrwxrwx 1 root root 13 Sep  5 19:05 
nvme-KINGSTON_SFYRS1000G_50026B76860B144B -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
nvme-KINGSTON_SFYRS1000G_50026B76860B144B-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
nvme-KINGSTON_SFYRS1000G_50026B76860B144B-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
nvme-KINGSTON_SFYRS1000G_50026B76860B144B-part3 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root 13 Sep  5 19:05 
nvme-KINGSTON_SFYRS1000G_50026B76860B144B_1 -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
nvme-KINGSTON_SFYRS1000G_50026B76860B144B_1-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
nvme-KINGSTON_SFYRS1000G_50026B76860B144B_1-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
nvme-KINGSTON_SFYRS1000G_50026B76860B144B_1-part3 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root 13 Sep  5 19:05 
nvme-eui.00000000000000000026b7686086d515 -> ../../nvme1n1
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
nvme-eui.00000000000000000026b7686086d515-part1 -> ../../nvme1n1p1
lrwxrwxrwx 1 root root 13 Sep  5 19:05 
nvme-eui.00000000000000000026b76860b144b5 -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
nvme-eui.00000000000000000026b76860b144b5-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
nvme-eui.00000000000000000026b76860b144b5-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
nvme-eui.00000000000000000026b76860b144b5-part3 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root  9 Sep  5 19:05 wwn-0x5000c500c80a321c -> ../../sdb
lrwxrwxrwx 1 root root 10 Sep  5 19:05 wwn-0x5000c500c80a321c-part1 -> 
../../sdb1
lrwxrwxrwx 1 root root  9 Sep  5 19:05 wwn-0x5000c500c80b65ef -> ../../sda
lrwxrwxrwx 1 root root 10 Sep  5 19:05 wwn-0x5000c500c80b65ef-part1 -> 
../../sda1
lrwxrwxrwx 1 root root  9 Sep  5 19:05 wwn-0x5002538e40bd4973 -> ../../sdd
lrwxrwxrwx 1 root root 10 Sep  5 19:05 wwn-0x5002538e40bd4973-part1 -> 
../../sdd1
lrwxrwxrwx 1 root root 10 Sep  5 19:05 wwn-0x5002538e40bd4973-part2 -> 
../../sdd2
lrwxrwxrwx 1 root root  9 Sep  5 19:05 wwn-0x5002538e40bd4cdc -> ../../sdc
lrwxrwxrwx 1 root root 10 Sep  5 19:05 wwn-0x5002538e40bd4cdc-part1 -> 
../../sdc1
lrwxrwxrwx 1 root root 10 Sep  5 19:05 wwn-0x5002538e40bd4cdc-part2 -> 
../../sdc2
lrwxrwxrwx 1 root root  9 Sep  5 19:05 wwn-0x5002538e4993b9dc -> ../../sde
lrwxrwxrwx 1 root root 10 Sep  5 19:05 wwn-0x5002538e4993b9dc-part1 -> 
../../sde1
lrwxrwxrwx 1 root root 10 Sep  5 19:05 wwn-0x5002538e4993b9dc-part2 -> 
../../sde2
lrwxrwxrwx 1 root root 10 Sep  5 19:05 wwn-0x5002538e4993b9dc-part3 -> 
../../sde3
*********************** END /dev/disk/by-id

*********************** BEGIN /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Sep  5 19:05 38CEE847CEE7FAD0 -> ../../sde3
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
45b120bd-c7a5-4d00-9c5b-a72c48a663fc -> ../../dm-0
lrwxrwxrwx 1 root root 15 Sep  5 19:05 5744-287C -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 11 Sep  5 19:05 
57dde1a3-336c-4dfd-bcad-c6773f1dfa57 -> ../../md126
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
58fc4506-7de8-41c9-86bf-39de880d94a0 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
6e23b1fc-1039-48ed-91aa-be7b50d037fb -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
75682b6b-9058-4d67-b21e-6352a7df682c -> ../../dm-1
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
7a65dd2a-fbd7-4888-81dd-ddd09597aeb1 -> ../../dm-3
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
957f0473-b41a-424d-a3e2-1959eb4b00b2 -> ../../dm-2
lrwxrwxrwx 1 root root 15 Sep  5 19:05 
c0e24d39-493d-44de-bd8c-b2622daa7300 -> ../../nvme1n1p1
lrwxrwxrwx 1 root root 11 Sep  5 19:05 
c6e9f22b-45ea-4e72-b52e-d50ee0efec4d -> ../../md125
lrwxrwxrwx 1 root root 10 Sep  5 19:05 
db50c1e5-d66c-4e7f-ab5e-a05c08830d5a -> ../../dm-4
*********************** END /dev/disk/by-uuid

-- System Information:
Debian Release: trixie/sid
   APT prefers testing
   APT policy: (990, 'testing'), (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.5.1-deb64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), 
LANGUAGE=fr:en_US
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages grub-efi-amd64 depends on:
ii  debconf [debconf-2.0]  1.5.82
ii  grub-efi-amd64-bin     2.12~rc1-7
ii  grub2-common           2.12~rc1-7
ii  ucf                    3.0043+nmu1

grub-efi-amd64 recommends no packages.

grub-efi-amd64 suggests no packages.

-- debconf information:
   grub2/force_efi_extra_removable: false
   grub2/device_map_regenerated:
   grub2/update_nvram: true
* grub2/linux_cmdline: apparmor=1 security=apparmor quiet splash
   grub2/enable_os_prober: false
   grub2/kfreebsd_cmdline:
   grub2/linux_cmdline_default: acpi_osi=Linux 
amdgpu.ppfeaturemask=0xffffffff amd_pstate=active
   grub2/kfreebsd_cmdline_default: quiet



More information about the Pkg-grub-devel mailing list