-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Add patch to fix kernel installations to allow use of auto-gen…
…erated install scripts
- Loading branch information
Showing
3 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ set -ex | |
|
||
cd ./base/linux | ||
|
||
git apply ../add-typedefs.patch | ||
git apply ../*.patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
From ce51995ff400267d1b6fab18ba45c35b630347a6 Mon Sep 17 00:00:00 2001 | ||
From: Jose Ignacio Tornos Martinez <[email protected]> | ||
Date: Tue, 12 Dec 2023 18:10:44 +0100 | ||
Subject: [PATCH] rpm-pkg: simplify installkernel %post | ||
|
||
A new installkernel application is now included in systemd-udev package | ||
and it has been improved to allow simplifications. | ||
|
||
For the new installkernel application, as Davide says: | ||
<<The %post currently does a shuffling dance before calling installkernel. | ||
This isn't actually necessary afaict, and the current implementation | ||
ends up triggering downstream issues such as | ||
https://github.com/systemd/systemd/issues/29568 | ||
This commit simplifies the logic to remove the shuffling. For reference, | ||
the original logic was added in commit 3c9c7a14b627("rpm-pkg: add %post | ||
section to create initramfs and grub hooks").>> | ||
|
||
But we need to keep the old behavior as well, because the old installkernel | ||
application from grubby package, does not allow this simplification and | ||
we need to be backward compatible to avoid issues with the different | ||
packages. So the easiest solution is to check the package that provides | ||
the installkernel application, and simplify (and fix for this | ||
application at the same time), only if the package is systemd-udev. | ||
|
||
cc: [email protected] | ||
Co-Developed-by: Davide Cavalca <[email protected]> | ||
Signed-off-by: Jose Ignacio Tornos Martinez <[email protected]> | ||
--- | ||
scripts/package/kernel.spec | 4 ++++ | ||
1 file changed, 4 insertions(+) | ||
|
||
diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec | ||
index 3eee0143e0c5cc..d4276ddb66450c 100644 | ||
--- a/scripts/package/kernel.spec | ||
+++ b/scripts/package/kernel.spec | ||
@@ -77,12 +77,16 @@ rm -rf %{buildroot} | ||
|
||
%post | ||
if [ -x /sbin/installkernel -a -r /boot/vmlinuz-%{KERNELRELEASE} -a -r /boot/System.map-%{KERNELRELEASE} ]; then | ||
+if [ $(rpm -qf /sbin/installkernel --queryformat "%{n}") = systemd-udev ];then | ||
+/sbin/installkernel %{KERNELRELEASE} /boot/vmlinuz-%{KERNELRELEASE} /boot/System.map-%{KERNELRELEASE} | ||
+else | ||
cp /boot/vmlinuz-%{KERNELRELEASE} /boot/.vmlinuz-%{KERNELRELEASE}-rpm | ||
cp /boot/System.map-%{KERNELRELEASE} /boot/.System.map-%{KERNELRELEASE}-rpm | ||
rm -f /boot/vmlinuz-%{KERNELRELEASE} /boot/System.map-%{KERNELRELEASE} | ||
/sbin/installkernel %{KERNELRELEASE} /boot/.vmlinuz-%{KERNELRELEASE}-rpm /boot/.System.map-%{KERNELRELEASE}-rpm | ||
rm -f /boot/.vmlinuz-%{KERNELRELEASE}-rpm /boot/.System.map-%{KERNELRELEASE}-rpm | ||
fi | ||
+fi | ||
|
||
%preun | ||
if [ -x /sbin/new-kernel-pkg ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters