Skip to content

main/grub: prevent duplicated menu entries & replace grub-probe use of udevadm

1st patch:

If a /etc/grub.d/ template file is locally customised/modified then if the Grub package is later updated the stock version of that file will be placed in /etc/grub.d/ with a .apk-new suffix. Whenever grub-mkconfig is next triggered (e.g. after kernel package update) it will make use of both the modified file and the stock file so resulting in the creation of duplicate menu entries.

This patch prevents that by ignoring any *.apk-new files in the template directory.

2nd patch:

Currently grub-probe runs "udevadm info" if available and if not then falls back to its own logic for determine the device that the boot partition is no. However grub-probe's own logic does not correctly handle the scenario of a partitioned loop device when run inside a chroot with only mdev, rather than eudev, installed (I use this scenario for creating Alpine disk images).

As a workaround I have resorted to installing the eudev package prior to running grub-install (which uses grub-probe) and then uninstalling eudev immediately afterwards.

This upstream code change replaces the use of "udevadm info" by simply using the contents of /sys/dev/block/ instead which works correctly for the partitioned loop device scenario.

Merge request reports