From b238ed07bcbf3e816ec80444c8330f2066b29efc Mon Sep 17 00:00:00 2001 From: Jeremy Linton Date: Tue, 26 Mar 2024 16:48:34 -0500 Subject: [PATCH 1/8] Add default-kernel option to match grubby Signed-off-by: Jeremy Linton --- updateloaderentries.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/updateloaderentries.sh b/updateloaderentries.sh index bc59c83..df08d57 100755 --- a/updateloaderentries.sh +++ b/updateloaderentries.sh @@ -58,7 +58,7 @@ if [[ "$progname" == "updateloaderentries" ]]; then fi -OPTS="$(getopt -o hc:i:b:? --long help,args:,info:,update-kernel:,remove-args: -- "$@")" +OPTS="$(getopt -o hc:i:b:? --long help,args:,info:,update-kernel:,remove-args:,default-kernel -- "$@")" eval set -- "$OPTS" @@ -86,6 +86,9 @@ while [ ${#} -gt 0 ]; do info_kernel="$2" shift 1 ;; + --default-kernel) + utilmode="defaultkernel" + ;; esac shift done @@ -116,6 +119,9 @@ case "$utilmode" in bootctl list | grep -B7 -A2 ".*linux:.*$info_kernel" | awk "$CAPTUREROOT" | eval "${BOOTCTL_REMOVE_UNUSED}" | eval "${BOOTCTL_TO_GRUBBY_INFO}" | eval "${BOOTCTL_QUOTING}" fi ;; + defaultkernel) + bootctl list |grep -A6 ".*title:.*(default)" | grep "linux:" | cut -c16- + ;; merge) for i in /boot/efi/loader/entries/*; do if [[ -f "$i" ]]; then From 0e71a0aa22108efb6538b1e306b68d48fccfe852 Mon Sep 17 00:00:00 2001 From: Jeremy Linton Date: Tue, 26 Mar 2024 18:37:31 -0500 Subject: [PATCH 2/8] Add default kernel compatibility flag and install.conf file to force kernel-install to do the right thing, work around BZ 2271674 --- install.conf | 5 +++++ sdubby.spec | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 install.conf diff --git a/install.conf b/install.conf new file mode 100644 index 0000000..b934256 --- /dev/null +++ b/install.conf @@ -0,0 +1,5 @@ +# systemd-boot default anaconda installs +# mounts the ESP at /boot/efi, tell kernel-install +# that it should be putting kernel/initrd/bls/etc +# entries there rather than in /boot +BOOT_ROOT=/boot/efi diff --git a/sdubby.spec b/sdubby.spec index edd4f97..b3a7be2 100644 --- a/sdubby.spec +++ b/sdubby.spec @@ -4,7 +4,7 @@ Name: sdubby Version: 1.0 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Set of systemd-boot shims that don't fit anywhere else in the distro License: GPLv2+ URL: https://pagure.io/sdubby.git @@ -16,6 +16,9 @@ Source2: COPYING Source3: entries.srel Source4: updateloaderentries.8 Source5: README.md +# another config script which should eventually be moved to +# anaconda, because it knows where the ESP is actually mounted +Source6: install.conf Requires: findutils Requires: util-linux @@ -54,6 +57,7 @@ install -T -m 444 %{SOURCE3} %{buildroot}%{efi_esp_root}/loader/entries.srel ln -sr %{buildroot}%{_sbindir}/updateloaderentries %{buildroot}%{_sbindir}/grubby install -TD -m 444 %{SOURCE4} %{buildroot}%{_mandir}/man8/updateloaderentries.8 gzip %{buildroot}%{_mandir}/man8/updateloaderentries.8 +install -TD -m 444 %{SOURCE6} %{buildroot}%{_sysconfdir}/kernel/install.conf # should we create /boot/efi/loader/loader.conf here? # instead we are ghosting the config file, and letting anaconda create it @@ -71,10 +75,14 @@ gzip %{buildroot}%{_mandir}/man8/updateloaderentries.8 # files on the ESP (fat) will always have 700 %{efi_esp_root}/loader/entries %config(noreplace) %{efi_esp_root}/loader/entries.srel +%config(noreplace) %{_sysconfdir}/kernel/install.conf %attr(0644,root,root) %ghost %config(noreplace) %{efi_esp_root}/loader/loader.conf %changelog +* Tue Mar 26 2024 Jeremy Linton - 1.0-8 +- Add default kernel compatibility flag and install.conf file to force kernel-install to do the right thing, work around BZ 2271674 + * Mon Mar 18 2024 Adam Williamson - 1.0-7 - Stop providing grubby (#2269992) From 3bb97ea3956137efa2196aa5404a3d2842f983fa Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 05:08:24 +0000 Subject: [PATCH 3/8] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- sdubby.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdubby.spec b/sdubby.spec index b3a7be2..770fafa 100644 --- a/sdubby.spec +++ b/sdubby.spec @@ -4,7 +4,7 @@ Name: sdubby Version: 1.0 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Set of systemd-boot shims that don't fit anywhere else in the distro License: GPLv2+ URL: https://pagure.io/sdubby.git @@ -80,6 +80,9 @@ install -TD -m 444 %{SOURCE6} %{buildroot}%{_sysconfdir}/kernel/install.conf %changelog +* Sat Jul 20 2024 Fedora Release Engineering - 1.0-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Tue Mar 26 2024 Jeremy Linton - 1.0-8 - Add default kernel compatibility flag and install.conf file to force kernel-install to do the right thing, work around BZ 2271674 From 0e5143e862d93f1f97d853cb22fff88ce7199d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Fri, 26 Jul 2024 02:52:51 +0200 Subject: [PATCH 4/8] convert GPLv2+ license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- sdubby.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sdubby.spec b/sdubby.spec index 770fafa..6b60872 100644 --- a/sdubby.spec +++ b/sdubby.spec @@ -4,9 +4,10 @@ Name: sdubby Version: 1.0 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Set of systemd-boot shims that don't fit anywhere else in the distro -License: GPLv2+ +# Automatically converted from old format: GPLv2+ - review is highly recommended. +License: GPL-2.0-or-later URL: https://pagure.io/sdubby.git BuildArchitectures: noarch ExclusiveArch: %{efi} @@ -80,6 +81,9 @@ install -TD -m 444 %{SOURCE6} %{buildroot}%{_sysconfdir}/kernel/install.conf %changelog +* Fri Jul 26 2024 Miroslav Suchý - 1.0-10 +- convert license to SPDX + * Sat Jul 20 2024 Fedora Release Engineering - 1.0-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 99971e1c56c8441cf85c1ee35dcdf29d9b1e91b3 Mon Sep 17 00:00:00 2001 From: Jeremy Linton Date: Thu, 22 Aug 2024 17:07:05 -0500 Subject: [PATCH 5/8] grubby: compatiblity with --update-kernel=ALL grubby has a wildcard option ALL for which kernels have an option added/removed. sdubby can do this without specifying ALL but for compatiliby (and to fix a bug with add) we should probably tweak it a bit. Signed-off-by: Jeremy Linton --- updateloaderentries.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/updateloaderentries.sh b/updateloaderentries.sh index df08d57..e19a094 100755 --- a/updateloaderentries.sh +++ b/updateloaderentries.sh @@ -93,6 +93,10 @@ while [ ${#} -gt 0 ]; do shift done +if [[ "$info_kernel" == "ALL" ]]; then + unset info_kernel +fi + case "$utilmode" in help) echo "updateloaderentries.sh: When run as updateloaderentries it doesn't require any parameters and merges" @@ -107,17 +111,15 @@ case "$utilmode" in ;; add) config_file=`bootctl list |grep -B7 -A2 ".*linux:.*${info_kernel}"|grep "^.*source:" |cut -d: -f2- ` - grep ${modify_args} $config_file - if [[ "$?" == "1" ]]; then - sed -i -e "s/^options /options ${modify_args} /" $config_file - fi + for fn in $config_file; do + grep ${modify_args} $fn >/dev/null + if [[ "$?" == "1" ]]; then + sed -i -e "s/^options /options ${modify_args} /" $fn + fi + done ;; info) - if [[ "$info_kernel" == "ALL" ]];then - bootctl list | grep -B7 -A2 "linux:" | awk "$CAPTUREROOT" | eval "${BOOTCTL_REMOVE_UNUSED}" | eval "${BOOTCTL_TO_GRUBBY_INFO}" | eval "${BOOTCTL_QUOTING}" - else - bootctl list | grep -B7 -A2 ".*linux:.*$info_kernel" | awk "$CAPTUREROOT" | eval "${BOOTCTL_REMOVE_UNUSED}" | eval "${BOOTCTL_TO_GRUBBY_INFO}" | eval "${BOOTCTL_QUOTING}" - fi + bootctl list | grep -B7 -A2 ".*linux:.*$info_kernel" | awk "$CAPTUREROOT" | eval "${BOOTCTL_REMOVE_UNUSED}" | eval "${BOOTCTL_TO_GRUBBY_INFO}" | eval "${BOOTCTL_QUOTING}" ;; defaultkernel) bootctl list |grep -A6 ".*title:.*(default)" | grep "linux:" | cut -c16- From 9b3cf9309f77c312a64611273e2d8ef4bab00c7e Mon Sep 17 00:00:00 2001 From: Jeremy Linton Date: Mon, 26 Aug 2024 18:38:50 -0500 Subject: [PATCH 6/8] BZ 2271533 Support ALL for add/remove kernel options --- sdubby.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdubby.spec b/sdubby.spec index 6b60872..25c4d1a 100644 --- a/sdubby.spec +++ b/sdubby.spec @@ -4,7 +4,7 @@ Name: sdubby Version: 1.0 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Set of systemd-boot shims that don't fit anywhere else in the distro # Automatically converted from old format: GPLv2+ - review is highly recommended. License: GPL-2.0-or-later @@ -81,6 +81,9 @@ install -TD -m 444 %{SOURCE6} %{buildroot}%{_sysconfdir}/kernel/install.conf %changelog +* Mon Aug 26 2024 Jeremy Linton 1.0-11 +- BZ 2271533 Support ALL for add/remove kernel options + * Fri Jul 26 2024 Miroslav Suchý - 1.0-10 - convert license to SPDX From 14123624e151e050e02c3d6437fde139203a79d0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 10:19:15 +0000 Subject: [PATCH 7/8] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- sdubby.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdubby.spec b/sdubby.spec index 25c4d1a..5f60b2d 100644 --- a/sdubby.spec +++ b/sdubby.spec @@ -4,7 +4,7 @@ Name: sdubby Version: 1.0 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Set of systemd-boot shims that don't fit anywhere else in the distro # Automatically converted from old format: GPLv2+ - review is highly recommended. License: GPL-2.0-or-later @@ -81,6 +81,9 @@ install -TD -m 444 %{SOURCE6} %{buildroot}%{_sysconfdir}/kernel/install.conf %changelog +* Sun Jan 19 2025 Fedora Release Engineering - 1.0-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Mon Aug 26 2024 Jeremy Linton 1.0-11 - BZ 2271533 Support ALL for add/remove kernel options From 66963ec00de8094310ea1ddb3c5509d279649a37 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 18:06:03 +0000 Subject: [PATCH 8/8] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- sdubby.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdubby.spec b/sdubby.spec index 5f60b2d..f9065b7 100644 --- a/sdubby.spec +++ b/sdubby.spec @@ -4,7 +4,7 @@ Name: sdubby Version: 1.0 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Set of systemd-boot shims that don't fit anywhere else in the distro # Automatically converted from old format: GPLv2+ - review is highly recommended. License: GPL-2.0-or-later @@ -81,6 +81,9 @@ install -TD -m 444 %{SOURCE6} %{buildroot}%{_sysconfdir}/kernel/install.conf %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 1.0-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Sun Jan 19 2025 Fedora Release Engineering - 1.0-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild