Could I replace the "grub-mkdevicemap" utility (removed from GRUB in 2012) with "grub2-probe" instead?

Asked by Ivan

grub-customizer 5.2.3 asks me to set the MKDEVICEMAP_CMD, which by default tries to use

grub-mkdevicemap --device-map=/dev/stdout

Unfortunately I found that a "mkdevicemap" utility simply doesn't exist in a modern GRUB2 - it has been removed with 8be63f2ef6fec43245bea2aa737cc5b1e2f84779 commit (11 years old!) at the official repository:

commit 8be63f2ef6fec43245bea2aa737cc5b1e2f84779
Author: Vladimir 'phcoder' Serbinenko <email address hidden>
Date: Fri Feb 3 22:36:51 2012 +0100

        * Makefile.util.def (grub-mkdevicemap): Removed.
        * include/grub/emu/hostdisk.h (grub_util_get_os_disk): New proto.
        * include/grub/util/deviceiter.h: Removed.
        * util/deviceiter.c: Likewise.
        * util/getroot.c (grub_util_get_os_disk): New function.
        * util/grub-install.in: Remove grub-mkdevicemap. Use -t disk as
        replacement for EFI.
        * util/grub-mkdevicemap.c: Removed.
        * util/grub-probe.c (probe): Handle PRINT_DISK.
        (argp_parser): Handle -t disk

If we'd look at this commit, instead of ' $grub_mkdevicemap" --device-map=/dev/stdout ' - now the lines like

' "$grub_probe" --target=device --device-map=/dev/stdin "${bootdir}" '
' "$grub_probe" --target=device --device-map=/dev/stdin "${bootdir}/efi" '
' "$grub_probe" --target=device --device-map=/dev/stdin "${bootdir}/EFI" '

are being used, so probably I can get away with setting a

MKDEVICEMAP_CMD: grub2-probe --target=device --device-map=/dev/stdin /boot/grub2

[ 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. ]

QUESTION: Do you think the replacement of the deprecated grub-mkdevicemap with that grub2-probe will work, or it is going to break my system?

P.S. I also raised a bug here about this - https://bugs.launchpad.net/grub-customizer/+bug/2027676

Question information

Language:
English Edit question
Status:
Solved
For:
Grub Customizer Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Ivan (qmastery16) said :
#3
Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Daniel Richter (danielrichter2007) said (last edit ):
#5

Ok, the question is solved within the bug report. The code change isn't done yet, but I'll keep it in mind.