Incompatibility with modern GRUB2 which lacks grub2-mkdevicemap
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Grub Customizer |
New
|
Undecided
|
Unassigned |
Bug Description
Good day!
I am running CentOS 8 installed in a traditional BIOS mode (CSM) with grub2 2.02 (2.02-106, the latest packaged GRUB2 for this sytem).
I am trying to use grub-customizer 5.2.3 which I had to build & install from this launchpad's source code because a grub-customizer (like many other packages) is sadly not available at CentOS 8 repository and 5.0.8 taken from CentOS 7 crashes at launch.
So, when I try to launch "sudo grub-customizer" (after "xhost +SI:localuser:root" of course - to avoid the "cannot open display: :0" graphical error for a superuser), then a "Grub Customizer environment setup" window pops up with a correctly-detected "Type: Grub 2" type of my bootloader but incorrectly-
( /!\ = yellow trianle "FAIL" icon, (-) = red circle "FAIL" icon, <-| - blue arrow "OK" icon )
CFG_DIR: /etc/grub.d =====> <-|
DEVICEMAP_FILE: /boot/grub/
INSTALL_CMD: grub-install =====> (-)
MKCONFIG_CMD: grub-mkconfig =====> (-)
MKDEVICEMAP_CMD: grub-mkdevicemap --device-
MKFONT_CMD: grub-mkfont =====> /!\
OUTPUT_DIR: /boot/grub =====> /!\
OUTPUT_FILE: /boot/grub/grub.cfg =====> /!\
SETTINGS_FILE: /etc/default/grub =====> <-|
After changing a lot of "grub" to "grub2" paths I've been able to partially resolve this:
CFG_DIR: /etc/grub.d =====> <-|
DEVICEMAP_FILE: /boot/grub2/
INSTALL_CMD: grub2-install =====> <-|
MKCONFIG_CMD: grub2-mkconfig =====> <-|
MKDEVICEMAP_CMD: grub2-mkdevicemap --device-
MKFONT_CMD: grub2-mkfont =====> <-|
OUTPUT_DIR: /boot/grub2 =====> <-|
OUTPUT_FILE: /boot/grub2/
SETTINGS_FILE: /etc/default/grub =====> <-|
However, there's one issue that's still unresolved:
MKDEVICEMAP_CMD: grub2-mkdevicemap --device-
Unfortunately I found that a "mkdevicemap" utility simply doesn't exist in a modern GRUB2 - it has been removed with 8be63f2ef6fec43
commit 8be63f2ef6fec43
Author: Vladimir 'phcoder' Serbinenko <email address hidden>
Date: Fri Feb 3 22:36:51 2012 +0100
* Makefile.util.def (grub-mkdevicemap): Removed.
* include/
* include/
* util/deviceiter.c: Likewise.
* util/getroot.c (grub_util_
* util/grub-
replacement for EFI.
* util/grub-
* util/grub-probe.c (probe): Handle PRINT_DISK.
If we'd look at this commit, instead of ' $grub_mkdevicemap" --device-
' "$grub_probe" --target=device --device-
' "$grub_probe" --target=device --device-
' "$grub_probe" --target=device --device-
are being used, so probably I can get away with setting a
MKDEVICEMAP_CMD: grub2-probe --target=device --device-
- however, I'm unsure if the rest of the API / command line arguments ( grub-mkdevicemap.c VS grub-probe.c ) are the same and afraid to screw up my system.
I don't see this issue reported anywhere: probably because a lot of Linux distros still ship the outdated versions of GRUB - which still have this deprecated grub-mkdevicemap utility - the people get away with it. However, if unfixed, this issue above will bite all the Linux users in the long run, so it's really urgent priority to fix this
It still surprises me how this incompatibility hasn't been noticed, despite that a commit that removed grub-mkdevicemap utility is 11 years old... Please find a way to use grub2-probe instead