[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1035096: GRUB not installed or installed to the wrong device




On 5/7/23 13:18, Pascal Hambourg wrote:
Control: retitle -1 GRUB not installed or installed to the wrong device

I found that grub-installer may generate a wrong bootdev value for grub-pc when state=2 and previous_state!=1. This may happen at least in the following three cases if the user selects the device in the proposed list:

- if the first device listed by grub-mkdevicemap is the installation media (/cdrom or /hd-media) or has no known partition table nor filesystem, GRUB may be installed to the disk containing /boot instead of the device selected by the user;

- if unsupported OS are detected by os-prober, bootdev may be empty and GRUB is not installed;

- if the user answers "no" to "Install the GRUB boot loader to your primary drive?", bootdev may be empty and GRUB is not installed.

It does not happen if the user chose "Enter the device manually".

The common root cause is grub-installer/bootdev being used without being manually set by the user even after bootdev was set by select_bootdev.

Attached is a minimal patch which uses grub-installer/bootdev only when if was manually set by the user, and not when the bootdev was set by select_bootdev. I tested it with the last case. Test and feedback appreciated.
Identical bug in RC 3 (debian-bookworm-DI-rc3-amd64-netinst.iso)
I can create a new installation-report if desired


Reply to: