Package: os-prober Version: 1.74ubuntu1 Severity: normal Tags: patch l10n When the hard disk contains multiple partitions, each with a Debian-based distro (in my case: Xubuntu, Elementary, MX Linux, and Linux Mint) and each of these distros is localized, then updating each system in turn results in the grub.cfg file of each system getting larger and larger with each upgrade.
The cause is that the 40grub2 script does not recognize the automatically added menu references to the other distros because the relevant grep command checks for the word "on". And in translations, this word will be different. Attached patch fixes the problem. The issue has also been reported to Ubuntu: https://bugs.launchpad.net/ubuntu/+source/os-prober/+bug/1176652 Versions of packages os-prober depends on: ii dmsetup 2:1.02.145-4.1ubuntu3.18.04.2 ii grub-common 2.02-2ubuntu8.15 ii libc6 2.27-3ubuntu1
From 242992a278fc67cab3e0ce6586da75fa697780a0 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg <bensb...@telfort.nl> Date: Sun, 3 May 2020 14:11:03 +0200 Subject: [PATCH] accept also translations of "on" when detecting auto-added menu items When a system is localized, then the title suffix "(on /dev/...)" will have been translated to "(auf /dev/...)" or "(sur /dev/...)" or similar. Make the grep command match all those strings. Fixes https://bugs.launchpad.net/ubuntu/+source/os-prober/+bug/1176652. --- linux-boot-probes/mounted/common/40grub2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-boot-probes/mounted/common/40grub2 b/linux-boot-probes/mounted/common/40grub2 index 885614e..a8aafd4 100755 --- a/linux-boot-probes/mounted/common/40grub2 +++ b/linux-boot-probes/mounted/common/40grub2 @@ -58,7 +58,7 @@ parse_grub_menu () { fi if [ -z "$title" ]; then ignore_item=1 - elif echo "$title" | grep -q '(on /dev/[^)]*)$'; then + elif echo "$title" | grep -q '(\w\+ /dev/[^)]\+)$'; then log "Skipping entry '$title':" log "appears to be an automatic reference taken from another menu.lst" ignore_item=1 -- 2.25.4
signature.asc
Description: OpenPGP digital signature