Bug#1035085: Bookworm RC2 grub-installer/os-prober quirks
Package: grub-installer
Version: 1.190
Severity: minor
Tags: patch
Boot method: USB stick
Image version: debian-bookworm-DI-rc2-amd64-netinst.iso
Installation type: expert install
Date: 2023-04-29
Hello,
I observed a few minor quirks while testing the new os-prober
re-enablement feature.
1) In expert install (or low priority), the new os-prober dialog
displayed by grub-installer lists only unsupported OS but not supported OS.
(Patch attached)
2) "efi" os-prober type is considered unsupported.
In EFI mode, os-prober detects EFI boot loaders such as Windows Boot
Manager with type "efi". GRUB can add menu entries for these boot
loaders so this type should be in the supported list instead of the
unsupported list. (AFAICS it does not matter much because the supported
OS list is used only when installing GRUB for legacy boot and not EFI boot.)
(Patch attached)
3) Changing the previous answer to "Run os-prober automatically to
detect and boot other OSes" does not work as expected.
Steps to reproduce:
- Start a new expert install.
- At the question "Run os-prober automatically to detect and boot other
OSes", answer "yes".
- Go back to the main menu and select "Install the GRUB boot loader" again.
- At the question "Run os-prober automatically to detect and boot other
OSes", answer "no".
Result: changing the previous answer to "no" does nothing:
grub2/enable_os_prober and /target/etc/default/grub are unchanged so
os-prober will still be run.
- Start a new expert install.
- At the question "Run os-prober automatically to detect and boot other
OSes", answer "no".
- Go back to the main menu and select "Install the GRUB boot loader" again.
- At the question "Run os-prober automatically to detect and boot other
OSes", answer "yes".
Result: Changing the previous answer to "yes" does half the job:
grub2/enable_os_prober is changed but /target/etc/default/grub is
unchanged so os-prober will not be run.
IIUC, this is because
- answering "no" is a no-op;
- grub2/enable_os_prober has an effect only when /target/etc/defaut/grub
is generated by the selected grub-* package config script when the
package is installed (after the first time the question is asked).From c117406bf936e0fd4ff3f31916b1cd22db3f46ed Mon Sep 17 00:00:00 2001
From: Pascal Hambourg <pascal@plouf.fr.eu.org>
Date: Sat, 29 Apr 2023 09:35:42 +0200
Subject: [PATCH 1/2] Add all other OS to the complete OS list, not only
unsupported OS
---
grub-installer | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/grub-installer b/grub-installer
index 2f0de04d..3c177c41 100755
--- a/grub-installer
+++ b/grub-installer
@@ -566,6 +566,11 @@ if [ -s /tmp/os-probed ]; then
IFS="$OLDIFS"
title=$(echo "$os" | cut -d: -f2)
type=$(echo "$os" | cut -d: -f4)
+ if [ -n "$other_os_list" ]; then
+ other_os_list="$other_os_list, $title"
+ else
+ other_os_list="$title"
+ fi
case "$type" in
chain)
: ;;
@@ -579,11 +584,6 @@ if [ -s /tmp/os-probed ]; then
else
unsupported_os_list="$title"
fi
- if [ -n "$other_os_list" ]; then
- other_os_list="$other_os_list, $title"
- else
- other_os_list="$title"
- fi
continue
fi
;;
@@ -595,11 +595,6 @@ if [ -s /tmp/os-probed ]; then
else
unsupported_os_list="$title"
fi
- if [ -n "$other_os_list" ]; then
- other_os_list="$other_os_list, $title"
- else
- other_os_list="$title"
- fi
continue
;;
esac
--
2.30.2
From 005333adb8d1f57a0620cac3206aaa78b7be0136 Mon Sep 17 00:00:00 2001
From: Pascal Hambourg <pascal@plouf.fr.eu.org>
Date: Sat, 29 Apr 2023 09:38:58 +0200
Subject: [PATCH 2/2] Add "efi" os-prober type to the supported OS list
In EFI mode, os-prober detects EFI boot loaders such as Windows boot
manager with type "efi". grub-mkconfig can add menu entries for these
boot loaders so this type should be in the supported list.
(It does actually not matter much because the supported OS list is used
only when installing GRUB for legacy boot and not EFI boot)
---
grub-installer | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-installer b/grub-installer
index 3c177c41..afd65a26 100755
--- a/grub-installer
+++ b/grub-installer
@@ -572,7 +572,7 @@ if [ -s /tmp/os-probed ]; then
other_os_list="$title"
fi
case "$type" in
- chain)
+ chain|efi)
: ;;
linux)
# Check for linux systems that we don't
--
2.30.2
Reply to: