Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
eaef784cc6 | ||
|
e69860d718 | ||
|
9ebc469d54 | ||
|
e94425201f | ||
|
2b59d1355d | ||
|
5d3963841d | ||
|
786a133370 | ||
|
fd57e031d4 | ||
|
536f42db1c | ||
|
b91640a743 | ||
|
3498276978 | ||
|
1ead121a08 | ||
|
a5c9c3a138 |
28
0013-Fix-build-with-rpm-4.16.patch
Normal file
28
0013-Fix-build-with-rpm-4.16.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From 1afddd618629a97479560bedbdcfa11b2c492a0e Mon Sep 17 00:00:00 2001
|
||||
From: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Date: Fri, 26 Jun 2020 10:02:51 +0200
|
||||
Subject: [PATCH] Fix build with rpm-4.16
|
||||
|
||||
rpmvercmp() was moved to librpmio, so link against this library instead.
|
||||
|
||||
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1ab58aeb039..a54b053a30b 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -59,7 +59,7 @@ grubby:: $(OBJECTS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(grubby_LIBS)
|
||||
|
||||
rpm-sort::rpm-sort.o
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lrpm
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lrpmio
|
||||
|
||||
clean:
|
||||
rm -f *.o grubby rpm-sort *~
|
||||
--
|
||||
2.26.2
|
||||
|
73
10-devicetree.install
Executable file
73
10-devicetree.install
Executable file
@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
|
||||
# set -x
|
||||
|
||||
if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]
|
||||
then
|
||||
COMMAND="$1"
|
||||
KERNEL_VERSION="$2"
|
||||
#BOOT_DIR_ABS="$3"
|
||||
#KERNEL_IMAGE="$4"
|
||||
|
||||
[ -f /etc/u-boot.conf ] && source /etc/u-boot.conf || true
|
||||
[ -z "$FIRMWAREDT" ] || FirmwareDT=$FIRMWAREDT
|
||||
|
||||
if [[ $FirmwareDT == "True" ]]
|
||||
then
|
||||
# if we want to use firmware DT we remove symlink to current kernel DT
|
||||
if [ -h /boot/dtb ]; then
|
||||
rm -f /boot/dtb
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Setup a /boot/dtb -> /boot/dtb-$newest_kernel_version symlink so that
|
||||
# u-boot can find the correct dtb to load.
|
||||
#
|
||||
# If invoked to 'add' a new kernel, find the newest based on `sort`ing
|
||||
# the kernel versions dtb. If 'remove', then follow basically the same
|
||||
# procedure but exclude the version currently being removed.
|
||||
#
|
||||
# The theory of operation here is that, while newer kernels may add new
|
||||
# dtb nodes and fields, as upstreaming hw support for some particular
|
||||
# device progresses, it should never make backward incompatible changes.
|
||||
# So it should always be safe to use a newer dtb with an older kernel.
|
||||
|
||||
list_dtb_versions() {
|
||||
excluded_version="$1"
|
||||
for dtbdir in /boot/dtb-*; do
|
||||
dtbver=${dtbdir#*-}
|
||||
if [ "$dtbver" != "$excluded_version" ]; then
|
||||
echo $dtbver
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
setup_dtb_link() {
|
||||
ver=`list_dtb_versions $1 | sort -r --sort=version | head -1`
|
||||
if [ -h /boot/dtb ]; then
|
||||
rm -f /boot/dtb
|
||||
fi
|
||||
ln -s dtb-$ver /boot/dtb
|
||||
}
|
||||
|
||||
ret=0
|
||||
case "$COMMAND" in
|
||||
add)
|
||||
# If we're adding a kernel we want that version
|
||||
if [ -h /boot/dtb ]; then
|
||||
rm -f /boot/dtb
|
||||
fi
|
||||
ln -s dtb-$KERNEL_VERSION /boot/dtb
|
||||
ret=$?
|
||||
;;
|
||||
remove)
|
||||
setup_dtb_link $KERNEL_VERSION
|
||||
ret=$?
|
||||
;;
|
||||
esac
|
||||
exit $ret
|
||||
else
|
||||
# Just exit on non ARM
|
||||
exit 0
|
||||
fi
|
37
grubby-bls
37
grubby-bls
@ -235,7 +235,7 @@ get_bls_args() {
|
||||
local opts=(${args})
|
||||
|
||||
for opt in ${opts[*]}; do
|
||||
if [[ $opt =~ ^\$ ]]; then
|
||||
if [[ $opt = "\$kernelopts" ]]; then
|
||||
value="$(expand_var $opt)"
|
||||
args="$(echo ${args} | sed -e "s/${opt}/${value}/")"
|
||||
fi
|
||||
@ -429,7 +429,7 @@ add_bls_fragment() {
|
||||
fi
|
||||
|
||||
if [[ -n $extra_initrd ]]; then
|
||||
append_bls_value "${bls_target}" "initrd" "${extra_initrd}"
|
||||
append_bls_value "${bls_target}" "initrd" " ${extra_initrd}"
|
||||
fi
|
||||
|
||||
if [[ $MAKEDEBUG = "yes" ]]; then
|
||||
@ -567,7 +567,7 @@ remove_var_prefix() {
|
||||
fi
|
||||
|
||||
if [[ -n $extra_initrd ]]; then
|
||||
extra_initrd=" /${extra_initrd##${prefix}/}"
|
||||
extra_initrd="/${extra_initrd##${prefix}/}"
|
||||
fi
|
||||
|
||||
if [[ -n $kernel ]]; then
|
||||
@ -581,8 +581,33 @@ remove_var_prefix() {
|
||||
|
||||
update_grubcfg()
|
||||
{
|
||||
if [[ $arch = 'ppc64' || $arch = 'ppc64le' ]]; then
|
||||
grub2-mkconfig --no-grubenv-update -o "${grub_config}" >& /dev/null
|
||||
# Older ppc64le OPAL firmware (petitboot version < 1.8.0) don't have BLS support
|
||||
# so grub2-mkconfig has to be run to generate a config with menuentry commands.
|
||||
if [ "${arch}" = "ppc64le" ] && [ -d /sys/firmware/opal ]; then
|
||||
RUN_MKCONFIG="true"
|
||||
petitboot_path="/sys/firmware/devicetree/base/ibm,firmware-versions/petitboot"
|
||||
|
||||
if test -e ${petitboot_path}; then
|
||||
read -r -d '' petitboot_version < ${petitboot_path}
|
||||
petitboot_version="$(echo ${petitboot_version//v})"
|
||||
|
||||
if test -n ${petitboot_version}; then
|
||||
major_version="$(echo ${petitboot_version} | cut -d . -f1)"
|
||||
minor_version="$(echo ${petitboot_version} | cut -d . -f2)"
|
||||
|
||||
re='^[0-9]+$'
|
||||
if [[ $major_version =~ $re ]] && [[ $minor_version =~ $re ]] &&
|
||||
([[ ${major_version} -gt 1 ]] ||
|
||||
[[ ${major_version} -eq 1 &&
|
||||
${minor_version} -ge 8 ]]); then
|
||||
RUN_MKCONFIG="false"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $RUN_MKCONFIG = "true" ]]; then
|
||||
grub2-mkconfig --no-grubenv-update -o "${grub_config}" >& /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
@ -683,7 +708,7 @@ while [ ${#} -gt 0 ]; do
|
||||
shift
|
||||
;;
|
||||
--extra-initrd|-i)
|
||||
extra_initrd=" /${2}"
|
||||
extra_initrd="${2}"
|
||||
shift
|
||||
;;
|
||||
--make-default)
|
||||
|
11
grubby.8
11
grubby.8
@ -19,13 +19,10 @@ about the configuration files for the \fBgrub2\fR and \fBzipl\fR boot loaders.
|
||||
It is primarily designed to be used from scripts which install new kernels and
|
||||
need to find information about the current boot environment.
|
||||
|
||||
On BIOS-based Intel x86 platforms, \fBgrub2\fR is the default bootloader and
|
||||
the configuration file is in \fB/boot/grub2/grub.cfg\fR. On UEFI-based Intel
|
||||
x86 platforms, \fBgrub2\fR is the default bootloader, and the configuration
|
||||
file is in \fB/boot/efi/EFI/redhat/grub.cfg\fR. On PowerPC platforms, systems
|
||||
based on Power8 and Power9 support \fBgrub2\fR as a bootloader and use a
|
||||
configuration stored in \fB/boot/grub2/grub.cfg\fR. On s390x platforms the
|
||||
\fBzipl\fR bootloader use a default configuration in \fB/etc/zipl.conf\fR.
|
||||
On BIOS-based Intel x86, PowerPC and UEFI-based platforms, \fBgrub2\fR is the
|
||||
default bootloader and the configuration file is in \fB/boot/grub2/grub.cfg\fR.
|
||||
On s390x platforms, the \fBzipl\fR bootloader use a default configuration in
|
||||
\fB/etc/zipl.conf\fR.
|
||||
|
||||
All bootloaders define the boot entries as individual configuration fragments
|
||||
that are stored by default in \fB/boot/loader/entries\fR. The format for the
|
||||
|
70
grubby.spec
70
grubby.spec
@ -1,6 +1,6 @@
|
||||
Name: grubby
|
||||
Version: 8.40
|
||||
Release: 45%{?dist}
|
||||
Release: 55%{?dist}
|
||||
Summary: Command line tool for updating bootloader configs
|
||||
License: GPLv2+
|
||||
URL: https://github.com/rhinstaller/grubby
|
||||
@ -14,7 +14,9 @@ Source2: grubby.in
|
||||
Source3: installkernel.in
|
||||
Source4: installkernel-bls
|
||||
Source5: 95-kernel-hooks.install
|
||||
Source6: grubby.8
|
||||
Source6: 10-devicetree.install
|
||||
Source7: grubby.8
|
||||
|
||||
Patch0001: 0001-remove-the-old-crufty-u-boot-support.patch
|
||||
Patch0002: 0002-Change-return-type-in-getRootSpecifier.patch
|
||||
Patch0003: 0003-Add-btrfs-subvolume-support-for-grub2.patch
|
||||
@ -27,10 +29,11 @@ Patch0009: 0009-Improve-man-page-for-info-option.patch
|
||||
Patch0010: 0010-Fix-GCC-warnings-about-possible-string-truncations-a.patch
|
||||
Patch0011: 0011-Fix-stringop-overflow-warning.patch
|
||||
Patch0012: 0012-Fix-maybe-uninitialized-warning.patch
|
||||
Patch0013: 0013-Fix-build-with-rpm-4.16.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: pkgconfig glib2-devel popt-devel
|
||||
BuildRequires: libblkid-devel git-core sed make
|
||||
BuildRequires: libblkid-devel sed make
|
||||
# for make test / getopt:
|
||||
BuildRequires: util-linux-ng
|
||||
BuildRequires: rpm-devel
|
||||
@ -40,33 +43,25 @@ Requires: grub2-tools-minimal
|
||||
Requires: grub2-tools
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
Requires: s390utils-base
|
||||
Requires: s390utils-core
|
||||
%endif
|
||||
Requires: findutils
|
||||
Requires: util-linux
|
||||
|
||||
Conflicts: uboot-tools < 2021.01-0.1.rc2
|
||||
Obsoletes: %{name}-bls < %{version}-%{release}
|
||||
|
||||
%description
|
||||
This package provides a grubby compatibility script that manages
|
||||
BootLoaderSpec files and is meant to only be used for legacy compatibility
|
||||
users with existing grubby users.
|
||||
BootLoaderSpec files and is meant to be backward compatible with
|
||||
the previous grubby tool.
|
||||
|
||||
%prep
|
||||
%setup -q -n grubby-%{version}-1
|
||||
|
||||
git init
|
||||
git config user.email "noone@example.com"
|
||||
git config user.name "no one"
|
||||
git add .
|
||||
git commit -a -q -m "%{version} baseline"
|
||||
git am %{patches} </dev/null
|
||||
git config --unset user.email
|
||||
git config --unset user.name
|
||||
%autosetup -p1 -n grubby-%{version}-1
|
||||
|
||||
%build
|
||||
%set_build_flags
|
||||
make %{?_smp_mflags} LDFLAGS="${LDFLAGS}"
|
||||
%make_build LDFLAGS="${LDFLAGS}"
|
||||
|
||||
%ifnarch aarch64 %{arm}
|
||||
%check
|
||||
@ -86,8 +81,9 @@ sed -e "s,@@LIBEXECDIR@@,%{_libexecdir}/grubby,g" %{SOURCE2} \
|
||||
sed -e "s,@@LIBEXECDIR@@,%{_libexecdir}/installkernel,g" %{SOURCE3} \
|
||||
> %{buildroot}%{_sbindir}/installkernel
|
||||
install -D -m 0755 -t %{buildroot}%{_prefix}/lib/kernel/install.d/ %{SOURCE5}
|
||||
install -D -m 0755 -t %{buildroot}%{_prefix}/lib/kernel/install.d/ %{SOURCE6}
|
||||
rm %{buildroot}%{_mandir}/man8/grubby.8*
|
||||
install -m 0644 %{SOURCE6} %{buildroot}%{_mandir}/man8/
|
||||
install -m 0644 %{SOURCE7} %{buildroot}%{_mandir}/man8/
|
||||
|
||||
%post
|
||||
if [ "$1" = 2 ]; then
|
||||
@ -111,7 +107,6 @@ scripts which install new kernels and need to find information about the
|
||||
current boot environment.
|
||||
|
||||
%files
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
%license COPYING
|
||||
%dir %{_libexecdir}/grubby
|
||||
%dir %{_libexecdir}/installkernel
|
||||
@ -120,11 +115,11 @@ current boot environment.
|
||||
%attr(0755,root,root) %{_sbindir}/grubby
|
||||
%attr(0755,root,root) %{_libexecdir}/installkernel/installkernel-bls
|
||||
%attr(0755,root,root) %{_sbindir}/installkernel
|
||||
%attr(0755,root,root) %{_prefix}/lib/kernel/install.d/10-devicetree.install
|
||||
%attr(0755,root,root) %{_prefix}/lib/kernel/install.d/95-kernel-hooks.install
|
||||
%{_mandir}/man8/[gi]*.8*
|
||||
|
||||
%files deprecated
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
%license COPYING
|
||||
%dir %{_libexecdir}/grubby
|
||||
%dir %{_libexecdir}/installkernel
|
||||
@ -136,6 +131,41 @@ current boot environment.
|
||||
%{_mandir}/man8/*.8*
|
||||
|
||||
%changelog
|
||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 8.40-55
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Wed Jun 23 2021 Javier Martinez Canillas <javierm@redhat.com> - 8.40-54
|
||||
- Clarify package description
|
||||
Resolves: rhbz#1913299
|
||||
- Update man page to not mention the GRUB config in the ESP anymore
|
||||
Resolves: rhbz#1958458
|
||||
|
||||
* Wed Jun 09 2021 Javier Martinez Canillas <javierm@redhat.com> - 8.40-53
|
||||
- grubby-bls: expand only the kernelopts variable
|
||||
|
||||
* Mon Apr 26 2021 Javier Martinez Canillas <javierm@redhat.com> - 8.40-52
|
||||
- grubby-bs: Fix changing kernel cmdline params not working on ppc64le
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 8.40-51
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Wed Dec 30 2020 Tom Stellard <tstellar@redhat.com> - 8.40-50
|
||||
- Use make_build macro instead of plain make
|
||||
- https://docs.fedoraproject.org/en-US/packaging-guidelines/#_parallel_make
|
||||
|
||||
* Fri Nov 20 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 8.40-49
|
||||
- Add device tree kernel install option
|
||||
|
||||
* Mon Oct 26 2020 Josh Boyer <jwb@redhat.com> - 8.40-48
|
||||
- Only require s390utils-core, not s390utils-base
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 8.40-47
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Fri Jun 26 2020 Javier Martinez Canillas <javierm@redhat.com> - 8.40-46
|
||||
- fix build with rpm-4.16
|
||||
- grubby-bls: fix --extra-initrd option not adding the correct path
|
||||
|
||||
* Wed May 13 2020 Javier Martinez Canillas <javierm@redhat.com> - 8.40-45
|
||||
- grubby-bls: don't replace options with kernelopts if values are the same
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user