Commit 6ae9f87d authored by Dermot Bradley's avatar Dermot Bradley Committed by alice
Browse files

main/grub: prevent duplicated menu entries

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.
parent 4d1fa69a
From: Dermot Bradley <dermot_bradley@yahoo.com>
Date: Wed, 8 Jun 2022 18:28:13 +0100
Subject: ensure grub-mkconfig ignores *.apk-new files
If one of the Grub template files in /etc/grub.d/ is locally modified
then whenever an updated version of the Alpine Grub package is next
installed apk will place a stock version of the modified file in the
same directory with a .apk-new suffix. Whenever grub-mkconfig is next
triggered to regenerate grub.cfg it will use both the locally modified
file and the stock file which will result in duplicate Grub menu
entries.
Modify grub-mkconfig to ignore *.apk-new files.
---
diff -aur a/util/grub-mkconfig.in b/util/grub-mkconfig.in
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -278,6 +278,10 @@
*~) ;;
# emacsen autosave files. FIXME: support other editors
*/\#*\#) ;;
+ # Copy of a template file from Alpine Grub package where the stock file
+ # was locally modified. Any such *.apk-new files should be ignored by
+ # grub-mkconfig.
+ *.apk-new) ;;
*)
if grub_file_is_not_garbage "$i" && test -x "$i" ; then
echo
......@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=grub
pkgver=2.06
pkgrel=4
pkgrel=5
pkgdesc="Bootloader with support for Linux, Multiboot and more"
url="https://www.gnu.org/software/grub/"
arch="all !s390x"
......@@ -52,6 +52,7 @@ source="https://ftp.gnu.org/gnu/grub/grub-$pkgver.tar.xz
0008-fix-build-error-in-binutils-2.36.patch
0009-fix-kernel-version-detection.patch
0010-riscv-binutils-2.38.patch
0011-mkconfig-ignore-apk-new-files.patch
"
prepare() {
......@@ -258,4 +259,5 @@ aa2fbabeab2e8f517128f0d81d3c76eba18b24518b616d4574ffaaec7d4765e02b5b118caf04da1e
8c35663ef72683bd23c18e75134a0ddb1bb9a7c053ed87691e2ac5c9765fdf802761a6ad54f8bdc7999679d9cc5ebea9c01f1c0f615ac90505f7a398129d157b 0008-fix-build-error-in-binutils-2.36.patch
d4432a36286f0ad7d3527d34e20daf9fbef24d6037171582ae3ccdd51668ffe422b87d984f107a9b4dcf019b89ac76dd322d64e42bbfa64bb6789d3d897fc1f2 0009-fix-kernel-version-detection.patch
4b8b5eeeb45dd9fddc9af9b6e694644470672b35af33cd11f1578f35503b08662c51f27c10bffeb96a51de0a879c741c0d22600410147eb20505efe1a3b50b54 0010-riscv-binutils-2.38.patch
229fe710de9fb106e08457a5a19dd3cc1746389ff1cdd95721b092913c51550fc8ad05141a23fc396a9e8dbbcec909920eda5f3eed339af9938774feb9e6c7bc 0011-mkconfig-ignore-apk-new-files.patch
"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment