Compare commits

..

8 commits

Author SHA1 Message Date
Fedora Release Engineering
66963ec00d Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 18:06:03 +00:00
Fedora Release Engineering
14123624e1 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-19 10:19:15 +00:00
Jeremy Linton
9b3cf9309f BZ 2271533 Support ALL for add/remove kernel options 2024-08-26 18:39:40 -05:00
Jeremy Linton
99971e1c56 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 <jlinton@redhat.com>
2024-08-26 18:39:31 -05:00
Miroslav Suchý
0e5143e862 convert GPLv2+ license to SPDX
This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4
2024-07-26 02:52:51 +02:00
Fedora Release Engineering
3bb97ea395 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-20 05:08:24 +00:00
Jeremy Linton
0e71a0aa22 Add default kernel compatibility flag and install.conf file to force kernel-install to do the right thing, work around BZ 2271674 2024-03-26 18:43:56 -05:00
Jeremy Linton
b238ed07bc Add default-kernel option to match grubby
Signed-off-by: Jeremy Linton <jlinton@redhat.com>
2024-03-26 18:41:59 -05:00
3 changed files with 49 additions and 12 deletions

5
install.conf Normal file
View file

@ -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

View file

@ -4,9 +4,10 @@
Name: sdubby
Version: 1.0
Release: 7%{?dist}
Release: 13%{?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}
@ -16,6 +17,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 +58,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 +76,29 @@ 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
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Mon Aug 26 2024 Jeremy Linton <jeremy.linton@arm.com> 1.0-11
- BZ 2271533 Support ALL for add/remove kernel options
* Fri Jul 26 2024 Miroslav Suchý <msuchy@redhat.com> - 1.0-10
- convert license to SPDX
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Tue Mar 26 2024 Jeremy Linton <jeremy.linton@arm.com> - 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 <awilliam@redhat.com> - 1.0-7
- Stop providing grubby (#2269992)

View file

@ -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,10 +86,17 @@ while [ ${#} -gt 0 ]; do
info_kernel="$2"
shift 1
;;
--default-kernel)
utilmode="defaultkernel"
;;
esac
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"
@ -104,17 +111,18 @@ 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-
;;
merge)
for i in /boot/efi/loader/entries/*; do