import OL kexec-tools-2.0.29-5.0.4.el9_6.2
This commit is contained in:
parent
2aa739e9a7
commit
c0cf917d24
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
SOURCES/eppic-e8844d3.tar.gz
|
||||
SOURCES/kexec-tools-2.0.29.tar.xz
|
||||
SOURCES/makedumpfile-1.7.6.tar.gz
|
||||
SOURCES/makedumpfile-1.7.7.tar.gz
|
||||
|
@ -1,4 +1,3 @@
|
||||
80ac3f5e77d3c79883edadf14428734db4720009 SOURCES/eppic-e8844d3.tar.gz
|
||||
b05e53b8f63ca039a06b0f8cb8a175b0f447449e SOURCES/kexec-tools-2.0.29.tar.xz
|
||||
0182de2145780593639b4e0b4a573af0595b8988 SOURCES/makedumpfile-1.7.6.tar.gz
|
||||
6484d9a1db114d8af56958987106d569976bc8d0 SOURCES/makedumpfile-1.7.7.tar.gz
|
||||
|
0
SOURCES/60-fadump.install
Executable file → Normal file
0
SOURCES/60-fadump.install
Executable file → Normal file
0
SOURCES/60-kdump.install
Executable file → Normal file
0
SOURCES/60-kdump.install
Executable file → Normal file
0
SOURCES/92-crashkernel.install
Executable file → Normal file
0
SOURCES/92-crashkernel.install
Executable file → Normal file
0
SOURCES/dracut-fadump-module-setup.sh
Normal file → Executable file
0
SOURCES/dracut-fadump-module-setup.sh
Normal file → Executable file
0
SOURCES/kdump-dep-generator.sh
Normal file → Executable file
0
SOURCES/kdump-dep-generator.sh
Normal file → Executable file
0
SOURCES/kdump-restart.sh
Normal file → Executable file
0
SOURCES/kdump-restart.sh
Normal file → Executable file
0
SOURCES/kdump-udev-throttler
Executable file → Normal file
0
SOURCES/kdump-udev-throttler
Executable file → Normal file
0
SOURCES/kdumpctl
Executable file → Normal file
0
SOURCES/kdumpctl
Executable file → Normal file
@ -0,0 +1,31 @@
|
||||
From a3c4ba0bb64cb66740d7026befceaa9b72680841 Mon Sep 17 00:00:00 2001
|
||||
From: Darren Archibald <darren.archibald@oracle.com>
|
||||
Date: Mon, 17 Feb 2025 06:51:35 -0800
|
||||
Subject: [PATCH]
|
||||
orabug30352094-makedumpfile-Mark-mem-usage-option-unsupported-for-a
|
||||
|
||||
Orabug: 30352094
|
||||
Signed-off-by: Darren Archibald <darren.archibald@oracle.com>
|
||||
---
|
||||
makedumpfile-1.7.6/makedumpfile.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/makedumpfile-1.7.7/makedumpfile.c b/makedumpfile-1.7.7/makedumpfile.c
|
||||
index b356eb3..1b556c2 100644
|
||||
--- a/makedumpfile-1.7.7/makedumpfile.c
|
||||
+++ b/makedumpfile-1.7.7/makedumpfile.c
|
||||
@@ -12416,6 +12416,11 @@ main(int argc, char *argv[])
|
||||
MSG("\n");
|
||||
MSG("The dmesg log is saved to %s.\n", info->name_dumpfile);
|
||||
} else if (info->flag_mem_usage) {
|
||||
+#ifdef __aarch64__
|
||||
+ MSG("mem-usage not supported for arm64 architecure.\n");
|
||||
+ goto out;
|
||||
+#endif
|
||||
+
|
||||
if (!check_param_for_creating_dumpfile(argc, argv)) {
|
||||
MSG("Commandline parameter is invalid.\n");
|
||||
MSG("Try `makedumpfile --help' for more information.\n");
|
||||
--
|
||||
2.31.1
|
||||
|
36
SOURCES/orabug30822387.kdumpctl-arm64-fast-boot.patch
Normal file
36
SOURCES/orabug30822387.kdumpctl-arm64-fast-boot.patch
Normal file
@ -0,0 +1,36 @@
|
||||
This patch is an adaptation of OL7 similar patch for aarch64
|
||||
|
||||
arm64: skip memory integrity checks in purgatory
|
||||
|
||||
This takes place with caches disabled and can be very slow on arm64.
|
||||
|
||||
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
|
||||
|
||||
Patch migrated from ol8 to ol9 without any modification
|
||||
Signed-off-by: Darren Archibald <darren.archibald@oracle.com>
|
||||
---
|
||||
diff -Naur kdumpctl.old kdumpctl
|
||||
--- kdumpctl.old 2024-03-05 05:45:09.999878679 -0800
|
||||
+++ kdumpctl 2024-03-05 05:46:51.996790278 -0800
|
||||
@@ -20,6 +20,7 @@
|
||||
#kdump shall be the default dump mode
|
||||
DEFAULT_DUMP_MODE="kdump"
|
||||
image_time=0
|
||||
+ARCH=$(uname -m)
|
||||
|
||||
standard_kexec_args="-d -p"
|
||||
|
||||
@@ -644,6 +645,12 @@
|
||||
KEXEC_ARGS=$(prepare_kexec_args "${KEXEC_ARGS}")
|
||||
KDUMP_COMMANDLINE=$(prepare_cmdline "${KDUMP_COMMANDLINE}" "${KDUMP_COMMANDLINE_REMOVE}" "${KDUMP_COMMANDLINE_APPEND}")
|
||||
|
||||
+ # arm64: skip memory integrity checks in purgatory
|
||||
+ if [ "$ARCH" == "aarch64" ]
|
||||
+ then
|
||||
+ KEXEC_ARGS="$KEXEC_ARGS --no-checks"
|
||||
+ fi
|
||||
+
|
||||
if is_uki "$KDUMP_KERNEL"; then
|
||||
uki=$KDUMP_KERNEL
|
||||
KDUMP_KERNEL=$KDUMP_TMPDIR/vmlinuz
|
||||
|
@ -0,0 +1,27 @@
|
||||
Patch migrated from ol8 to ol9 without any modification
|
||||
Signed-off-by: Darren Archibald <darren.archibald@oracle.com>
|
||||
------
|
||||
--- kdump.sysconfig.aarch64.old 2020-02-06 04:55:47.000000000 -0800
|
||||
+++ kdump.sysconfig.aarch64 2020-02-06 05:06:18.044773574 -0800
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
# This variable lets us append arguments to the current kdump commandline
|
||||
# after processed by KDUMP_COMMANDLINE_REMOVE
|
||||
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory udev.children-max=2 panic=10 swiotlb=noforce novmcoredd cma=0 hugetlb_cma=0"
|
||||
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory udev.children-max=2 panic=10 swiotlb=noforce novmcoredd cma=0 hugetlb_cma=0 iommu=off"
|
||||
|
||||
# Any additional kexec arguments required. In most situations, this should
|
||||
# be left empty
|
||||
--- kdump.sysconfig.x86_64.old 2024-10-24 01:38:12.367419533 -0700
|
||||
+++ kdump.sysconfig.x86_64 2024-10-24 01:46:55.858297286 -0700
|
||||
@@ -21,8 +21,7 @@
|
||||
|
||||
# This variable lets us append arguments to the current kdump commandline
|
||||
# after processed by KDUMP_COMMANDLINE_REMOVE
|
||||
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 acpi_no_memhotplug transparent_hugepage=never nokaslr hest_disable novmcoredd cma=0 hugetlb_cma=0 pcie_ports=compat"
|
||||
-
|
||||
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 acpi_no_memhotplug transparent_hugepage=never nokaslr hest_disable novmcoredd cma=0 hugetlb_cma=0 iommu=off"
|
||||
# Any additional kexec arguments required. In most situations, this should
|
||||
# be left empty
|
||||
#
|
||||
|
17
SOURCES/orabug30928441.kdumpctl.no_timer_check.patch
Normal file
17
SOURCES/orabug30928441.kdumpctl.no_timer_check.patch
Normal file
@ -0,0 +1,17 @@
|
||||
Patch migrated from ol8 to ol9 without any modification
|
||||
Signed-off-by: Darren Archibald <darren.archibald@oracle.com>
|
||||
----
|
||||
--- kdumpctl.old 2020-11-05 01:39:56.000000000 -0800
|
||||
+++ kdumpctl 2020-11-05 01:41:30.240246343 -0800
|
||||
@@ -33,6 +33,11 @@
|
||||
. /etc/sysconfig/kdump
|
||||
fi
|
||||
|
||||
+# append no_timer_check for xen guest kdump
|
||||
+if [ "$ARCH" == "x86_64" ] && $(virt-what |grep -qE "^xen$|^xen-domU$|^xen-hvm$"); then
|
||||
+ KDUMP_COMMANDLINE_APPEND="${KDUMP_COMMANDLINE_APPEND} no_timer_check"
|
||||
+fi
|
||||
+
|
||||
single_instance_lock()
|
||||
{
|
||||
local rc timeout=5
|
14
SOURCES/orabug32127375-kdump.sysconfig.no.double.s.patch
Normal file
14
SOURCES/orabug32127375-kdump.sysconfig.no.double.s.patch
Normal file
@ -0,0 +1,14 @@
|
||||
Patch migrated from ol8 to ol9 without any modification
|
||||
Signed-off-by: Darren Archibald <darren.archibald@oracle.com>
|
||||
------
|
||||
--- kdump.sysconfig.x86_64.old 2020-11-08 03:49:42.000000000 -0800
|
||||
+++ kdump.sysconfig.x86_64 2020-11-08 03:50:07.094669060 -0800
|
||||
@@ -28,7 +28,7 @@
|
||||
#
|
||||
# Example:
|
||||
# KEXEC_ARGS="--elf32-core-headers"
|
||||
-KEXEC_ARGS="-s"
|
||||
+KEXEC_ARGS=""
|
||||
|
||||
#Where to find the boot image
|
||||
#KDUMP_BOOTDIR="/boot"
|
@ -0,0 +1,27 @@
|
||||
From 66a0b1dfe597f219a83ca30ee4c916cb5a6b2ae7 Mon Sep 17 00:00:00 2001
|
||||
From: John Donnelly <john.p.donnelly@oracle.com>
|
||||
Date: Fri, 30 Apr 2021 15:08:32 -0700
|
||||
Subject: [PATCH {kexec-tools } ] Remove -s from kdump.sysconfig.aarch64,
|
||||
Orabug 32804496
|
||||
|
||||
Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>
|
||||
---
|
||||
kdump.sysconfig.aarch64 | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/kdump.sysconfig.aarch64 b/kdump.sysconfig.aarch64
|
||||
index 2ab2893..6f7830a 100644
|
||||
--- kdump.sysconfig.aarch64.old
|
||||
+++ kdump.sysconfig.aarch64
|
||||
@@ -28,7 +28,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory
|
||||
#
|
||||
# Example:
|
||||
# KEXEC_ARGS="--elf32-core-headers"
|
||||
-KEXEC_ARGS="-s"
|
||||
+KEXEC_ARGS=""
|
||||
|
||||
#Where to find the boot image
|
||||
#KDUMP_BOOTDIR="/boot"
|
||||
--
|
||||
2.27.0
|
||||
|
41
SOURCES/orabug33822070-kdump-skip-lvm-private-devices.patch
Normal file
41
SOURCES/orabug33822070-kdump-skip-lvm-private-devices.patch
Normal file
@ -0,0 +1,41 @@
|
||||
kdump: Skip LVM private devices
|
||||
|
||||
Orabug: 33822070
|
||||
Orabug: 33574003
|
||||
|
||||
As per the commit 20e1c3dc0339 ("libblkid: ignore private LVM devices") in
|
||||
util-linux, the virtual private LVM devices do not contain any blkid relevant data
|
||||
and it does not make any sense to scan for superblocks or partitions
|
||||
on the devices.
|
||||
|
||||
The blkid command is expected to fail if it is run on these LVM devices. This
|
||||
change skips the scanning of LVM private metadata devices when scanning for
|
||||
underlying crypt devices.
|
||||
|
||||
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
|
||||
Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>
|
||||
|
||||
kdump-lib.sh | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
--- a/kdump-lib.sh 2022-10-10 15:26:42.287897779 -0400
|
||||
+++ b/kdump-lib.sh 2022-10-10 15:27:51.158973691 -0400
|
||||
@@ -919,6 +919,13 @@ get_luks_crypt_dev()
|
||||
|
||||
[[ -b /dev/block/$1 ]] || return 1
|
||||
|
||||
+ # blkid will fail if it is run on a LVM private. Make sure blkid succeeds before proceeding.
|
||||
+ blkid -u filesystem,crypto -o export -- /dev/block/$1 > /dev/null
|
||||
+ if [ $? -ne 0 ]
|
||||
+ then
|
||||
+ return 1
|
||||
+ fi
|
||||
+
|
||||
_type=$(blkid -u filesystem,crypto -o export -- "/dev/block/$1" | \
|
||||
sed -n -E "s/^TYPE=(.*)$/\1/p")
|
||||
[[ $_type == "crypto_LUKS" ]] && echo "$1"
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
||||
|
42
SOURCES/orabug34663083-Update-UEK-reserved-sizes.patch
Normal file
42
SOURCES/orabug34663083-Update-UEK-reserved-sizes.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From c651074582102840d36afab6184369b4539c8f0b Mon Sep 17 00:00:00 2001
|
||||
From: Darren Archibald <darren.archibald@oracle.com>
|
||||
Date: Tue, 5 Mar 2024 07:33:47 -0800
|
||||
Subject: [PATCH] Update UEK reserved sizes
|
||||
|
||||
Orabug: 34240246
|
||||
Orabug: 34391412
|
||||
Orabug: 34663083
|
||||
|
||||
Set the proper default reservations we need for UEK for both x86_64 and aarch64.
|
||||
|
||||
Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>
|
||||
Signed-off-by: Brian Maly <brian.maly@oracle.com>
|
||||
Signed-off-by: Darren Archibald <darren.archibald@oracle.com>
|
||||
---
|
||||
kdump-lib.sh | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/kdump-lib.sh b/kdump-lib.sh
|
||||
index 1890bb7..765b9bd 100755
|
||||
--- a/kdump-lib.sh
|
||||
+++ b/kdump-lib.sh
|
||||
@@ -1152,13 +1152,13 @@ kdump_get_arch_recommend_crashkernel()
|
||||
_arch=$(uname -m)
|
||||
|
||||
if [[ $_arch == "x86_64" ]] || [[ $_arch == "s390x" ]]; then
|
||||
- _ck_cmdline="1G-4G:192M,4G-64G:256M,64G-:512M"
|
||||
+ _ck_cmdline="1G-64G:448M,64G-:512M"
|
||||
is_sme_or_sev_active && ((_delta += 64))
|
||||
elif [[ $_arch == "aarch64" ]]; then
|
||||
local _running_kernel
|
||||
|
||||
# Base line for 4K variant kernel. The formula is based on x86 plus extra = 64M
|
||||
- _ck_cmdline="1G-4G:256M,4G-64G:320M,64G-:576M"
|
||||
+ _ck_cmdline="2G-8G:256M,8G-:1G"
|
||||
if [[ -z "$2" ]]; then
|
||||
_running_kernel=$(_get_kdump_kernel_version)
|
||||
else
|
||||
--
|
||||
2.31.1
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
From 145a0700a663df7c418bd5a7ba93a7ed484898f7 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Maly <brian.maly@oracle.com>
|
||||
Date: Mon, 2 Oct 2023 17:54:29 -0400
|
||||
Subject: [PATCH] handle xen_netfront in dracut module setup
|
||||
|
||||
Ethtool doest return the proper name of the Xen virtual network driver,
|
||||
so instead use the correct module name for kdump_install_nic_driver().
|
||||
Withtout this fix vmcore dump over NFS will fail because the xen_netback
|
||||
module will not be included in the kdump initrd leaving us with no
|
||||
fuctional networking in the kdump environment.
|
||||
|
||||
Orabug: 35615400
|
||||
|
||||
Signed-off-by: Brian Maly <brian.maly@oracle.com>
|
||||
---
|
||||
dracut-module-setup.sh | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
|
||||
index b74447f..ff14ce1 100755
|
||||
--- a/dracut-module-setup.sh
|
||||
+++ b/dracut-module-setup.sh
|
||||
@@ -415,6 +415,9 @@ kdump_install_nic_driver() {
|
||||
# https://learn.microsoft.com/en-us/azure/virtual-network/accelerated-networking-overview
|
||||
# Install the driver of physical NIC as well
|
||||
_drivers+=("$(_get_hpyerv_physical_driver "$_netif")")
|
||||
+ elif [[ $_driver == "vif" ]]; then
|
||||
+ # ethtool doest return the proper name the Xen virtual network driver
|
||||
+ _driver=xen_netfront
|
||||
fi
|
||||
|
||||
_drivers+=("$_driver")
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,44 @@
|
||||
Install crash hotplug rules into 98-kexec rules
|
||||
|
||||
The Linux kernel series "crash: Kernel handling of CPU and memory hot
|
||||
un/plug" recently landed in mainline. To take advantage of the
|
||||
performance benefits of that series, 98-kexec.rules needs an update to
|
||||
optimize the handling of CPU and memory hotplug changes.
|
||||
|
||||
It is safe to deploy these rule updates now, ahead of distros/kernels
|
||||
enabling the feature, since the crash_hotplug sysfs nodes would not be
|
||||
present and thus the newly introduced rules in 98-kexec would act as a
|
||||
nop-op and fall thru for legacy behavior. But when distros/kernels
|
||||
enable the feature, then 98-kexec rules is ready and can properly take
|
||||
advantage.
|
||||
|
||||
Link: https://lore.kernel.org/lkml/20230814214446.6659-1-eric.devolder@oracle.co
|
||||
m/
|
||||
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d68b4b6f307d155475cce541f2aee938032ed22e
|
||||
Orabug: 35801595
|
||||
Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>
|
||||
|
||||
diff --git a/98-kexec.rules b/98-kexec.rules
|
||||
index b73b701..52b2ee8 100644
|
||||
--- a/98-kexec.rules
|
||||
+++ b/98-kexec.rules
|
||||
@@ -1,3 +1,7 @@
|
||||
+# The kernel updates the crash elfcorehdr for CPU and memory changes
|
||||
+SUBSYSTEM=="cpu", ATTRS{crash_hotplug}=="1", GOTO="kdump_reload_end"
|
||||
+SUBSYSTEM=="memory", ATTRS{crash_hotplug}=="1", GOTO="kdump_reload_end"
|
||||
+
|
||||
SUBSYSTEM=="cpu", ACTION=="add", GOTO="kdump_reload"
|
||||
SUBSYSTEM=="cpu", ACTION=="remove", GOTO="kdump_reload"
|
||||
SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload"
|
||||
diff --git a/98-kexec.rules.ppc64 b/98-kexec.rules.ppc64
|
||||
index a1c00a9..94c8b5d 100644
|
||||
--- a/98-kexec.rules.ppc64
|
||||
+++ b/98-kexec.rules.ppc64
|
||||
@@ -1,3 +1,7 @@
|
||||
+# The kernel updates the crash elfcorehdr for CPU and memory changes
|
||||
+SUBSYSTEM=="cpu", ATTRS{crash_hotplug}=="1", GOTO="kdump_reload_end"
|
||||
+SUBSYSTEM=="memory", ATTRS{crash_hotplug}=="1", GOTO="kdump_reload_end"
|
||||
+
|
||||
SUBSYSTEM=="cpu", ACTION=="online", GOTO="kdump_reload_cpu"
|
||||
SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload_mem"
|
||||
SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload_mem"
|
24
SOURCES/orabug35982140.kdumpctl-check-for-fips.patch
Normal file
24
SOURCES/orabug35982140.kdumpctl-check-for-fips.patch
Normal file
@ -0,0 +1,24 @@
|
||||
kdumpctl: check if FIPS is enabled
|
||||
|
||||
Orabug: 35982140
|
||||
|
||||
Add a check for FIPS to check_files_modified() so that FIPS support is included
|
||||
in the kdump image. Without this kdump fails with the following error:
|
||||
"FATAL FIPS SELFTEST FAILURE" error
|
||||
|
||||
Signed-off-by: Brian Maly <brian.maly@oracle.com>
|
||||
|
||||
--- kdumpctl.orig 2023-11-30 16:18:41.978477493 -0500
|
||||
+++ kdumpctl 2023-11-21 14:42:14.871165088 -0500
|
||||
@@ -394,6 +394,11 @@ check_files_modified()
|
||||
done
|
||||
fi
|
||||
|
||||
+ # Check for FIPS
|
||||
+ if fips-mode-setup --is-enabled 2> /dev/null; then
|
||||
+ files="$files /etc/system-fips"
|
||||
+ fi
|
||||
+
|
||||
# HOOKS is mandatory and need to check the modification time
|
||||
files="$files $HOOKS"
|
||||
is_lvm2_thinp_dump_target && files="$files $LVM_CONF"
|
@ -0,0 +1,61 @@
|
||||
From 30529000c33925cf19ceff3407d27682c0f2a5cc Mon Sep 17 00:00:00 2001
|
||||
From: Brian Maly <brian.maly@oracle.com>
|
||||
Date: Tue, 30 Apr 2024 13:13:45 -0400
|
||||
Subject: [PATCH 1/6] Revert "kexec: provide a memfd_create() wrapper if not
|
||||
present in libc"
|
||||
|
||||
This reverts commit 6419b008fde783fd0cc2cc266bd1c9cf35e99a0e.
|
||||
|
||||
Orabug: 36567412
|
||||
Signed-off-by: Brian Maly <brian.maly@oracle.com>
|
||||
---
|
||||
configure.ac | 3 ---
|
||||
kexec/kexec.c | 11 -----------
|
||||
2 files changed, 14 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index e801588..656dd79 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -208,9 +208,6 @@ if test "$ac_cv_lib_xenctrl_xc_kexec_load" = yes ; then
|
||||
AC_MSG_NOTICE([The kexec_status call is not available]))
|
||||
fi
|
||||
|
||||
-dnl Check if libc has the memfd_create() syscall wrapper
|
||||
-AC_CHECK_FUNCS([memfd_create])
|
||||
-
|
||||
dnl ---Sanity checks
|
||||
if test "$CC" = "no"; then AC_MSG_ERROR([cc not found]); fi
|
||||
if test "$CPP" = "no"; then AC_MSG_ERROR([cpp not found]); fi
|
||||
diff --git a/kexec/kexec.c b/kexec/kexec.c
|
||||
index 222f79e..c1785e5 100644
|
||||
--- a/kexec/kexec.c
|
||||
+++ b/kexec/kexec.c
|
||||
@@ -31,10 +31,6 @@
|
||||
#include <sys/mount.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
-#ifndef HAVE_MEMFD_CREATE
|
||||
-#include <linux/memfd.h>
|
||||
-#include <sys/syscall.h>
|
||||
-#endif
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
@@ -644,13 +640,6 @@ char *slurp_decompress_file(const char *filename, off_t *r_size)
|
||||
return kernel_buf;
|
||||
}
|
||||
|
||||
-#ifndef HAVE_MEMFD_CREATE
|
||||
-static int memfd_create(const char *name, unsigned int flags)
|
||||
-{
|
||||
- return syscall(SYS_memfd_create, name, flags);
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
static int copybuf_memfd(const char *kernel_buf, size_t size)
|
||||
{
|
||||
int fd, count;
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,61 @@
|
||||
From 59643e0d4e07bd44e952b103d9c2d18330bb6d63 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Maly <brian.maly@oracle.com>
|
||||
Date: Tue, 30 Apr 2024 13:25:48 -0400
|
||||
Subject: [PATCH 2/6] Revert "arm64: Hook up the ZBOOT support as vmlinuz"
|
||||
|
||||
This reverts commit f67c4146d7b52bfc95f0d21353f2112c6ab3570d.
|
||||
|
||||
Orabug: 36567412
|
||||
Signed-off-by: Brian Maly <brian.maly@oracle.com>
|
||||
---
|
||||
kexec/arch/arm64/Makefile | 3 +--
|
||||
kexec/arch/arm64/kexec-arm64.c | 1 -
|
||||
kexec/arch/arm64/kexec-arm64.h | 6 ------
|
||||
3 files changed, 1 insertion(+), 9 deletions(-)
|
||||
|
||||
diff --git a/kexec/arch/arm64/Makefile b/kexec/arch/arm64/Makefile
|
||||
index 59212f1..9d9111c 100644
|
||||
--- a/kexec/arch/arm64/Makefile
|
||||
+++ b/kexec/arch/arm64/Makefile
|
||||
@@ -15,8 +15,7 @@ arm64_KEXEC_SRCS += \
|
||||
kexec/arch/arm64/kexec-arm64.c \
|
||||
kexec/arch/arm64/kexec-elf-arm64.c \
|
||||
kexec/arch/arm64/kexec-uImage-arm64.c \
|
||||
- kexec/arch/arm64/kexec-image-arm64.c \
|
||||
- kexec/arch/arm64/kexec-vmlinuz-arm64.c
|
||||
+ kexec/arch/arm64/kexec-image-arm64.c
|
||||
|
||||
arm64_UIMAGE = kexec/kexec-uImage.c
|
||||
|
||||
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
|
||||
index 4a67b0d..a830ec7 100644
|
||||
--- a/kexec/arch/arm64/kexec-arm64.c
|
||||
+++ b/kexec/arch/arm64/kexec-arm64.c
|
||||
@@ -74,7 +74,6 @@ struct file_type file_type[] = {
|
||||
{"vmlinux", elf_arm64_probe, elf_arm64_load, elf_arm64_usage},
|
||||
{"Image", image_arm64_probe, image_arm64_load, image_arm64_usage},
|
||||
{"uImage", uImage_arm64_probe, uImage_arm64_load, uImage_arm64_usage},
|
||||
- {"vmlinuz", pez_arm64_probe, pez_arm64_load, pez_arm64_usage},
|
||||
};
|
||||
|
||||
int file_types = sizeof(file_type) / sizeof(file_type[0]);
|
||||
diff --git a/kexec/arch/arm64/kexec-arm64.h b/kexec/arch/arm64/kexec-arm64.h
|
||||
index 95fb5c2..d29b1b3 100644
|
||||
--- a/kexec/arch/arm64/kexec-arm64.h
|
||||
+++ b/kexec/arch/arm64/kexec-arm64.h
|
||||
@@ -44,12 +44,6 @@ int uImage_arm64_load(int argc, char **argv, const char *buf, off_t len,
|
||||
struct kexec_info *info);
|
||||
void uImage_arm64_usage(void);
|
||||
|
||||
-int pez_arm64_probe(const char *kernel_buf, off_t kernel_size);
|
||||
-int pez_arm64_load(int argc, char **argv, const char *buf, off_t len,
|
||||
- struct kexec_info *info);
|
||||
-void pez_arm64_usage(void);
|
||||
-
|
||||
-
|
||||
extern off_t initrd_base;
|
||||
extern off_t initrd_size;
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,29 @@
|
||||
From 28c4b1c04b280bf7702ad44ccefc7010e490f3c1 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Maly <brian.maly@oracle.com>
|
||||
Date: Tue, 30 Apr 2024 13:26:52 -0400
|
||||
Subject: [PATCH 3/6] Revert "arm64: Add ZBOOT PE containing compressed image
|
||||
support"
|
||||
|
||||
This reverts commit fc7b83bdf734a42b02f7343fe73655f896332d95.
|
||||
|
||||
Orabug: 36567412
|
||||
Signed-off-by: Brian Maly <brian.maly@oracle.com>
|
||||
---
|
||||
kexec/arch/arm64/image-header.h | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/kexec/arch/arm64/image-header.h b/kexec/arch/arm64/image-header.h
|
||||
index 26bb02f..158d411 100644
|
||||
--- a/kexec/arch/arm64/image-header.h
|
||||
+++ b/kexec/arch/arm64/image-header.h
|
||||
@@ -37,7 +37,6 @@ struct arm64_image_header {
|
||||
|
||||
static const uint8_t arm64_image_magic[4] = {'A', 'R', 'M', 0x64U};
|
||||
static const uint8_t arm64_image_pe_sig[2] = {'M', 'Z'};
|
||||
-static const uint8_t arm64_pe_machtype[6] = {'P','E', 0x0, 0x0, 0x64, 0xAA};
|
||||
static const uint64_t arm64_image_flag_be = (1UL << 0);
|
||||
static const uint64_t arm64_image_flag_page_size = (3UL << 1);
|
||||
static const uint64_t arm64_image_flag_placement = (1UL << 3);
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,41 @@
|
||||
From 6ffad3cb2ae471a4d368f2f40a66cf10a7474eb8 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Maly <brian.maly@oracle.com>
|
||||
Date: Tue, 30 Apr 2024 13:27:50 -0400
|
||||
Subject: [PATCH 4/6] Revert "kexec/zboot: Add arch independent zboot support"
|
||||
|
||||
This reverts commit f41c4182b0c403ea93cf47dcdc96437f5d6c53da.
|
||||
|
||||
Orabug: 36567412
|
||||
Signed-off-by: Brian Maly <brian.maly@oracle.com>
|
||||
---
|
||||
include/Makefile | 1 -
|
||||
kexec/Makefile | 1 -
|
||||
2 files changed, 2 deletions(-)
|
||||
|
||||
diff --git a/include/Makefile b/include/Makefile
|
||||
index cd88a26..621ce9f 100644
|
||||
--- a/include/Makefile
|
||||
+++ b/include/Makefile
|
||||
@@ -1,7 +1,6 @@
|
||||
dist += include/Makefile \
|
||||
include/config.h \
|
||||
include/config.h.in \
|
||||
- include/kexec-pe-zboot.h \
|
||||
include/kexec-uImage.h \
|
||||
include/x86/x86-linux.h \
|
||||
include/x86/mb_info.h \
|
||||
diff --git a/kexec/Makefile b/kexec/Makefile
|
||||
index 11682bf..8a52e8d 100644
|
||||
--- a/kexec/Makefile
|
||||
+++ b/kexec/Makefile
|
||||
@@ -17,7 +17,6 @@ KEXEC_SRCS_base += kexec/kexec-elf-exec.c
|
||||
KEXEC_SRCS_base += kexec/kexec-elf-core.c
|
||||
KEXEC_SRCS_base += kexec/kexec-elf-rel.c
|
||||
KEXEC_SRCS_base += kexec/kexec-elf-boot.c
|
||||
-KEXEC_SRCS_base += kexec/kexec-pe-zboot.c
|
||||
KEXEC_SRCS_base += kexec/kexec-iomem.c
|
||||
KEXEC_SRCS_base += kexec/firmware_memmap.c
|
||||
KEXEC_SRCS_base += kexec/crashdump.c
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,56 @@
|
||||
From 5d42da6b80dc4b54bbdbd6752edb8b6705077645 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Maly <brian.maly@oracle.com>
|
||||
Date: Tue, 30 Apr 2024 13:28:05 -0400
|
||||
Subject: [PATCH 5/6] Revert "kexec: Introduce a member kernel_fd in
|
||||
kexec_info"
|
||||
|
||||
This reverts commit 1572b91da7c4512d111a340185914c34acb0a139.
|
||||
|
||||
Orabug: 36567412
|
||||
Signed-off-by: Brian Maly <brian.maly@oracle.com>
|
||||
---
|
||||
kexec/kexec.c | 8 --------
|
||||
kexec/kexec.h | 1 -
|
||||
2 files changed, 9 deletions(-)
|
||||
|
||||
diff --git a/kexec/kexec.c b/kexec/kexec.c
|
||||
index c1785e5..76ee7f7 100644
|
||||
--- a/kexec/kexec.c
|
||||
+++ b/kexec/kexec.c
|
||||
@@ -1303,7 +1303,6 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
|
||||
info.kexec_flags = flags;
|
||||
|
||||
info.file_mode = 1;
|
||||
- info.kernel_fd = -1;
|
||||
info.initrd_fd = -1;
|
||||
|
||||
if (!is_kexec_file_load_implemented())
|
||||
@@ -1349,13 +1348,6 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
|
||||
return ret;
|
||||
}
|
||||
|
||||
- /*
|
||||
- * image type specific load functioin detect the capsule kernel type
|
||||
- * and create another fd for file load. For example the zboot kernel.
|
||||
- */
|
||||
- if (info.kernel_fd != -1)
|
||||
- kernel_fd = info.kernel_fd;
|
||||
-
|
||||
/*
|
||||
* If there is no initramfs, set KEXEC_FILE_NO_INITRAMFS flag so that
|
||||
* kernel does not return error with negative initrd_fd.
|
||||
diff --git a/kexec/kexec.h b/kexec/kexec.h
|
||||
index 1004aff..441503d 100644
|
||||
--- a/kexec/kexec.h
|
||||
+++ b/kexec/kexec.h
|
||||
@@ -164,7 +164,6 @@ struct kexec_info {
|
||||
unsigned long file_mode :1;
|
||||
|
||||
/* Filled by kernel image processing code */
|
||||
- int kernel_fd;
|
||||
int initrd_fd;
|
||||
char *command_line;
|
||||
int command_line_len;
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,376 @@
|
||||
From 58974a045ef4d7ebfeaad4d297e8d25f46b1dc02 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Maly <brian.maly@oracle.com>
|
||||
Date: Tue, 30 Apr 2024 13:28:16 -0400
|
||||
Subject: [PATCH 6/6] Revert "kexec/arm64: Simplify the code for zImage"
|
||||
|
||||
This reverts commit 714fa11590febc9cf6fd3c6309374a040a05ebb0.
|
||||
|
||||
Orabug: 36567412
|
||||
Signed-off-by: Brian Maly <brian.maly@oracle.com>
|
||||
---
|
||||
kexec/arch/arm64/Makefile | 3 +-
|
||||
kexec/arch/arm64/kexec-arm64.c | 1 +
|
||||
kexec/arch/arm64/kexec-arm64.h | 6 +
|
||||
kexec/arch/arm64/kexec-image-arm64.c | 2 +-
|
||||
kexec/arch/arm64/kexec-zImage-arm64.c | 226 ++++++++++++++++++++++++++
|
||||
kexec/kexec.c | 42 ++---
|
||||
6 files changed, 254 insertions(+), 26 deletions(-)
|
||||
create mode 100644 kexec/arch/arm64/kexec-zImage-arm64.c
|
||||
|
||||
diff --git a/kexec/arch/arm64/Makefile b/kexec/arch/arm64/Makefile
|
||||
index 9d9111c..d27c8ee 100644
|
||||
--- a/kexec/arch/arm64/Makefile
|
||||
+++ b/kexec/arch/arm64/Makefile
|
||||
@@ -15,7 +15,8 @@ arm64_KEXEC_SRCS += \
|
||||
kexec/arch/arm64/kexec-arm64.c \
|
||||
kexec/arch/arm64/kexec-elf-arm64.c \
|
||||
kexec/arch/arm64/kexec-uImage-arm64.c \
|
||||
- kexec/arch/arm64/kexec-image-arm64.c
|
||||
+ kexec/arch/arm64/kexec-image-arm64.c \
|
||||
+ kexec/arch/arm64/kexec-zImage-arm64.c
|
||||
|
||||
arm64_UIMAGE = kexec/kexec-uImage.c
|
||||
|
||||
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
|
||||
index a830ec7..ec6df4b 100644
|
||||
--- a/kexec/arch/arm64/kexec-arm64.c
|
||||
+++ b/kexec/arch/arm64/kexec-arm64.c
|
||||
@@ -74,6 +74,7 @@ struct file_type file_type[] = {
|
||||
{"vmlinux", elf_arm64_probe, elf_arm64_load, elf_arm64_usage},
|
||||
{"Image", image_arm64_probe, image_arm64_load, image_arm64_usage},
|
||||
{"uImage", uImage_arm64_probe, uImage_arm64_load, uImage_arm64_usage},
|
||||
+ {"zImage", zImage_arm64_probe, zImage_arm64_load, zImage_arm64_usage},
|
||||
};
|
||||
|
||||
int file_types = sizeof(file_type) / sizeof(file_type[0]);
|
||||
diff --git a/kexec/arch/arm64/kexec-arm64.h b/kexec/arch/arm64/kexec-arm64.h
|
||||
index d29b1b3..5eb9fc0 100644
|
||||
--- a/kexec/arch/arm64/kexec-arm64.h
|
||||
+++ b/kexec/arch/arm64/kexec-arm64.h
|
||||
@@ -44,6 +44,12 @@ int uImage_arm64_load(int argc, char **argv, const char *buf, off_t len,
|
||||
struct kexec_info *info);
|
||||
void uImage_arm64_usage(void);
|
||||
|
||||
+int zImage_arm64_probe(const char *kernel_buf, off_t kernel_size);
|
||||
+int zImage_arm64_load(int argc, char **argv, const char *kernel_buf,
|
||||
+ off_t kernel_size, struct kexec_info *info);
|
||||
+void zImage_arm64_usage(void);
|
||||
+
|
||||
+
|
||||
extern off_t initrd_base;
|
||||
extern off_t initrd_size;
|
||||
|
||||
diff --git a/kexec/arch/arm64/kexec-image-arm64.c b/kexec/arch/arm64/kexec-image-arm64.c
|
||||
index a196747..aa8f2e2 100644
|
||||
--- a/kexec/arch/arm64/kexec-image-arm64.c
|
||||
+++ b/kexec/arch/arm64/kexec-image-arm64.c
|
||||
@@ -114,6 +114,6 @@ exit:
|
||||
void image_arm64_usage(void)
|
||||
{
|
||||
printf(
|
||||
-" An ARM64 binary image, compressed or not, big or little endian.\n"
|
||||
+" An ARM64 binary image, uncompressed, big or little endian.\n"
|
||||
" Typically an Image file.\n\n");
|
||||
}
|
||||
diff --git a/kexec/arch/arm64/kexec-zImage-arm64.c b/kexec/arch/arm64/kexec-zImage-arm64.c
|
||||
new file mode 100644
|
||||
index 0000000..6ee82ff
|
||||
--- /dev/null
|
||||
+++ b/kexec/arch/arm64/kexec-zImage-arm64.c
|
||||
@@ -0,0 +1,226 @@
|
||||
+/*
|
||||
+ * ARM64 kexec zImage (Image.gz) support.
|
||||
+ *
|
||||
+ * Several distros use 'make zinstall' rule inside
|
||||
+ * 'arch/arm64/boot/Makefile' to install the arm64
|
||||
+ * Image.gz compressed file inside the boot destination
|
||||
+ * directory (for e.g. /boot).
|
||||
+ *
|
||||
+ * Currently we cannot use kexec_file_load() to load vmlinuz
|
||||
+ * (or Image.gz).
|
||||
+ *
|
||||
+ * To support Image.gz, we should:
|
||||
+ * a). Copy the contents of Image.gz to a temporary file.
|
||||
+ * b). Decompress (gunzip-decompress) the contents inside the
|
||||
+ * temporary file.
|
||||
+ * c). Pass the 'fd' of the temporary file to the kernel space.
|
||||
+ *
|
||||
+ * So basically the kernel space still gets a decompressed
|
||||
+ * kernel image to load via kexec-tools.
|
||||
+ */
|
||||
+
|
||||
+#define _GNU_SOURCE
|
||||
+
|
||||
+#include <errno.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <limits.h>
|
||||
+#include <stdlib.h>
|
||||
+#include "crashdump-arm64.h"
|
||||
+#include "image-header.h"
|
||||
+#include "kexec.h"
|
||||
+#include "kexec-arm64.h"
|
||||
+#include "kexec-syscall.h"
|
||||
+#include "kexec-zlib.h"
|
||||
+#include "arch/options.h"
|
||||
+
|
||||
+#define FILENAME_IMAGE "/tmp/ImageXXXXXX"
|
||||
+
|
||||
+/* Returns:
|
||||
+ * -1 : in case of error/invalid format (not a valid Image.gz format.
|
||||
+ * fd : File descriptor of the temp file containing the decompressed
|
||||
+ * Image.
|
||||
+ */
|
||||
+int zImage_arm64_probe(const char *kernel_buf, off_t kernel_size)
|
||||
+{
|
||||
+ int ret = -1;
|
||||
+ int fd = 0;
|
||||
+ int kernel_fd = 0;
|
||||
+ char *fname = NULL;
|
||||
+ char *kernel_uncompressed_buf = NULL;
|
||||
+ const struct arm64_image_header *h;
|
||||
+
|
||||
+ if (!is_zlib_file(kernel_buf, &kernel_size)) {
|
||||
+ dbgprintf("%s: Not an zImage file (Image.gz).\n", __func__);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (!(fname = strdup(FILENAME_IMAGE))) {
|
||||
+ dbgprintf("%s: Can't duplicate strings %s\n", __func__,
|
||||
+ fname);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if ((fd = mkstemp(fname)) < 0) {
|
||||
+ dbgprintf("%s: Can't open file %s\n", __func__,
|
||||
+ fname);
|
||||
+ ret = -1;
|
||||
+ goto fail_mkstemp;
|
||||
+ }
|
||||
+
|
||||
+ kernel_uncompressed_buf =
|
||||
+ (char *) calloc(kernel_size, sizeof(off_t));
|
||||
+ if (!kernel_uncompressed_buf) {
|
||||
+ dbgprintf("%s: Can't calloc %ld bytes\n",
|
||||
+ __func__, kernel_size);
|
||||
+ ret= -ENOMEM;
|
||||
+ goto fail_calloc;
|
||||
+ }
|
||||
+
|
||||
+ /* slurp in the input kernel */
|
||||
+ dbgprintf("%s: ", __func__);
|
||||
+ kernel_uncompressed_buf = slurp_decompress_file(kernel_buf,
|
||||
+ &kernel_size);
|
||||
+
|
||||
+ /* check for correct header magic */
|
||||
+ if (kernel_size < sizeof(struct arm64_image_header)) {
|
||||
+ dbgprintf("%s: No arm64 image header.\n", __func__);
|
||||
+ ret = -1;
|
||||
+ goto fail_bad_header;
|
||||
+ }
|
||||
+
|
||||
+ h = (const struct arm64_image_header *)(kernel_uncompressed_buf);
|
||||
+
|
||||
+ if (!arm64_header_check_magic(h)) {
|
||||
+ dbgprintf("%s: Bad arm64 image header.\n", __func__);
|
||||
+ ret = -1;
|
||||
+ goto fail_bad_header;
|
||||
+ }
|
||||
+
|
||||
+ if (write(fd, kernel_uncompressed_buf,
|
||||
+ kernel_size) != kernel_size) {
|
||||
+ dbgprintf("%s: Can't write the uncompressed file %s\n",
|
||||
+ __func__, fname);
|
||||
+ ret = -1;
|
||||
+ goto fail_bad_header;
|
||||
+ }
|
||||
+
|
||||
+ close(fd);
|
||||
+
|
||||
+ /* Open the tmp file again, this time in O_RDONLY mode, as
|
||||
+ * opening the file in O_RDWR and calling kexec_file_load()
|
||||
+ * causes the kernel to return -ETXTBSY
|
||||
+ */
|
||||
+ kernel_fd = open(fname, O_RDONLY);
|
||||
+ if (kernel_fd == -1) {
|
||||
+ dbgprintf("%s: Failed to open file %s\n",
|
||||
+ __func__, fname);
|
||||
+ ret = -1;
|
||||
+ goto fail_bad_header;
|
||||
+ }
|
||||
+
|
||||
+ unlink(fname);
|
||||
+
|
||||
+ free(kernel_uncompressed_buf);
|
||||
+ free(fname);
|
||||
+
|
||||
+ return kernel_fd;
|
||||
+
|
||||
+fail_bad_header:
|
||||
+ free(kernel_uncompressed_buf);
|
||||
+
|
||||
+fail_calloc:
|
||||
+ if (fd >= 0)
|
||||
+ close(fd);
|
||||
+
|
||||
+ unlink(fname);
|
||||
+
|
||||
+fail_mkstemp:
|
||||
+ free(fname);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int zImage_arm64_load(int argc, char **argv, const char *kernel_buf,
|
||||
+ off_t kernel_size, struct kexec_info *info)
|
||||
+{
|
||||
+ const struct arm64_image_header *header;
|
||||
+ unsigned long kernel_segment;
|
||||
+ int result;
|
||||
+
|
||||
+ if (info->file_mode) {
|
||||
+ if (arm64_opts.initrd) {
|
||||
+ info->initrd_fd = open(arm64_opts.initrd, O_RDONLY);
|
||||
+ if (info->initrd_fd == -1) {
|
||||
+ fprintf(stderr,
|
||||
+ "Could not open initrd file %s:%s\n",
|
||||
+ arm64_opts.initrd, strerror(errno));
|
||||
+ result = EFAILED;
|
||||
+ goto exit;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (arm64_opts.command_line) {
|
||||
+ info->command_line = (char *)arm64_opts.command_line;
|
||||
+ info->command_line_len =
|
||||
+ strlen(arm64_opts.command_line) + 1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ header = (const struct arm64_image_header *)(kernel_buf);
|
||||
+
|
||||
+ if (arm64_process_image_header(header))
|
||||
+ return EFAILED;
|
||||
+
|
||||
+ kernel_segment = arm64_locate_kernel_segment(info);
|
||||
+
|
||||
+ if (kernel_segment == ULONG_MAX) {
|
||||
+ dbgprintf("%s: Kernel segment is not allocated\n", __func__);
|
||||
+ result = EFAILED;
|
||||
+ goto exit;
|
||||
+ }
|
||||
+
|
||||
+ dbgprintf("%s: kernel_segment: %016lx\n", __func__, kernel_segment);
|
||||
+ dbgprintf("%s: text_offset: %016lx\n", __func__,
|
||||
+ arm64_mem.text_offset);
|
||||
+ dbgprintf("%s: image_size: %016lx\n", __func__,
|
||||
+ arm64_mem.image_size);
|
||||
+ dbgprintf("%s: phys_offset: %016lx\n", __func__,
|
||||
+ arm64_mem.phys_offset);
|
||||
+ dbgprintf("%s: vp_offset: %016lx\n", __func__,
|
||||
+ arm64_mem.vp_offset);
|
||||
+ dbgprintf("%s: PE format: %s\n", __func__,
|
||||
+ (arm64_header_check_pe_sig(header) ? "yes" : "no"));
|
||||
+
|
||||
+ /* create and initialize elf core header segment */
|
||||
+ if (info->kexec_flags & KEXEC_ON_CRASH) {
|
||||
+ result = load_crashdump_segments(info);
|
||||
+ if (result) {
|
||||
+ dbgprintf("%s: Creating eflcorehdr failed.\n",
|
||||
+ __func__);
|
||||
+ goto exit;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* load the kernel */
|
||||
+ add_segment_phys_virt(info, kernel_buf, kernel_size,
|
||||
+ kernel_segment + arm64_mem.text_offset,
|
||||
+ arm64_mem.image_size, 0);
|
||||
+
|
||||
+ /* load additional data */
|
||||
+ result = arm64_load_other_segments(info, kernel_segment
|
||||
+ + arm64_mem.text_offset);
|
||||
+
|
||||
+exit:
|
||||
+ if (result)
|
||||
+ fprintf(stderr, "kexec: load failed.\n");
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+void zImage_arm64_usage(void)
|
||||
+{
|
||||
+ printf(
|
||||
+" An ARM64 zImage, compressed, big or little endian.\n"
|
||||
+" Typically an Image.gz or Image.lzma file.\n\n");
|
||||
+}
|
||||
diff --git a/kexec/kexec.c b/kexec/kexec.c
|
||||
index 76ee7f7..383b062 100644
|
||||
--- a/kexec/kexec.c
|
||||
+++ b/kexec/kexec.c
|
||||
@@ -640,21 +640,6 @@ char *slurp_decompress_file(const char *filename, off_t *r_size)
|
||||
return kernel_buf;
|
||||
}
|
||||
|
||||
-static int copybuf_memfd(const char *kernel_buf, size_t size)
|
||||
-{
|
||||
- int fd, count;
|
||||
-
|
||||
- fd = memfd_create("kernel", MFD_ALLOW_SEALING);
|
||||
- if (fd == -1)
|
||||
- return fd;
|
||||
-
|
||||
- count = write(fd, kernel_buf, size);
|
||||
- if (count < 0)
|
||||
- return -1;
|
||||
-
|
||||
- return fd;
|
||||
-}
|
||||
-
|
||||
static void update_purgatory(struct kexec_info *info)
|
||||
{
|
||||
static const uint8_t null_buf[256];
|
||||
@@ -1316,22 +1301,31 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
|
||||
|
||||
kernel = argv[fileind];
|
||||
|
||||
- /* slurp in the input kernel */
|
||||
- kernel_buf = slurp_decompress_file(kernel, &kernel_size);
|
||||
- if (!kernel_buf) {
|
||||
- fprintf(stderr, "Failed to decompress file %s:%s\n", kernel,
|
||||
+ kernel_fd = open(kernel, O_RDONLY);
|
||||
+ if (kernel_fd == -1) {
|
||||
+ fprintf(stderr, "Failed to open file %s:%s\n", kernel,
|
||||
strerror(errno));
|
||||
return EFAILED;
|
||||
}
|
||||
- kernel_fd = copybuf_memfd(kernel_buf, kernel_size);
|
||||
- if (kernel_fd < 0) {
|
||||
- fprintf(stderr, "Failed to copy decompressed buf\n");
|
||||
- return EFAILED;
|
||||
- }
|
||||
+
|
||||
+ /* slurp in the input kernel */
|
||||
+ kernel_buf = slurp_decompress_file(kernel, &kernel_size);
|
||||
|
||||
for (i = 0; i < file_types; i++) {
|
||||
+#ifdef __aarch64__
|
||||
+ /* handle Image.gz like cases */
|
||||
+ if (is_zlib_file(kernel, &kernel_size)) {
|
||||
+ if ((ret = file_type[i].probe(kernel, kernel_size)) >= 0) {
|
||||
+ kernel_fd = ret;
|
||||
+ break;
|
||||
+ }
|
||||
+ } else
|
||||
+ if (file_type[i].probe(kernel_buf, kernel_size) >= 0)
|
||||
+ break;
|
||||
+#else
|
||||
if (file_type[i].probe(kernel_buf, kernel_size) >= 0)
|
||||
break;
|
||||
+#endif
|
||||
}
|
||||
|
||||
if (i == file_types) {
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,21 @@
|
||||
Disable transparent_hugepage for aarch64
|
||||
|
||||
Orabug: 37858059
|
||||
|
||||
Set transparent_hugepage=never for aarch64, otherwise we hit
|
||||
allocation failures when loading some modules or when trying
|
||||
to mount NFS in the kdump environment.
|
||||
|
||||
Signed-off-by: Brian Maly <brian.maly@oracle.com>
|
||||
|
||||
--- kdump.sysconfig.aarch64.orig 2025-04-21 20:24:44.433215191 -0400
|
||||
+++ kdump.sysconfig.aarch64 2025-04-21 20:25:31.051267572 -0400
|
||||
@@ -21,7 +21,7 @@ KDUMP_COMMANDLINE_REMOVE="hugepages huge
|
||||
|
||||
# This variable lets us append arguments to the current kdump commandline
|
||||
# after processed by KDUMP_COMMANDLINE_REMOVE
|
||||
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory udev.children-max=2 panic=10 swiotlb=noforce novmcoredd cma=0 hugetlb_cma=0 iommu=off"
|
||||
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory udev.children-max=2 panic=10 swiotlb=noforce transparent_hugepage=never novmcoredd cma=0 hugetlb_cma=0 iommu=off"
|
||||
|
||||
# Any additional kexec arguments required. In most situations, this should
|
||||
# be left empty
|
@ -1,11 +1,11 @@
|
||||
%global eppic_ver e8844d3793471163ae4a56d8f95897be9e5bd554
|
||||
%global eppic_shortver %(c=%{eppic_ver}; echo ${c:0:7})
|
||||
%global mkdf_ver 1.7.6
|
||||
%global mkdf_ver 1.7.7
|
||||
%global mkdf_shortver %(c=%{mkdf_ver}; echo ${c:0:7})
|
||||
|
||||
Name: kexec-tools
|
||||
Version: 2.0.29
|
||||
Release: 5%{?dist}.2
|
||||
Release: 5.0.4%{?dist}.2
|
||||
License: GPLv2
|
||||
Summary: The kexec/kdump userspace component
|
||||
|
||||
@ -74,6 +74,7 @@ Requires: dracut-network >= 050
|
||||
Requires: dracut-squash >= 050
|
||||
Requires: ethtool
|
||||
Requires: binutils
|
||||
Requires: virt-what
|
||||
Recommends: grubby
|
||||
Recommends: hostname
|
||||
BuildRequires: make
|
||||
@ -115,6 +116,26 @@ Requires: systemd-udev%{?_isa}
|
||||
# Patches 601 onward are generic patches
|
||||
#
|
||||
|
||||
# Oracle patches
|
||||
Patch1001: orabug30822387.kdumpctl-arm64-fast-boot.patch
|
||||
Patch1002: orabug30832988.kdump.sysconfig.iommu_off.x86_64.aarch64.patch
|
||||
Patch1003: orabug30928441.kdumpctl.no_timer_check.patch
|
||||
Patch1004: orabug32127375-kdump.sysconfig.no.double.s.patch
|
||||
Patch1007: orabug3280449-Remove-s-from-kdump.sysconfig.aarch64.patch
|
||||
Patch1008: orabug33822070-kdump-skip-lvm-private-devices.patch
|
||||
Patch1009: orabug34663083-Update-UEK-reserved-sizes.patch
|
||||
Patch1010: orabug35615400-handle-xen_netfront-in-dracut-module-setup.patch
|
||||
Patch1011: orabug35801595-crash-hotplug-for-98-kexec-rules.patch
|
||||
Patch1012: orabug35982140.kdumpctl-check-for-fips.patch
|
||||
Patch1013: orabug36567412-0001-Revert-kexec-provide-a-memfd_create-wrapper-if-not-p.patch
|
||||
Patch1014: orabug36567412-0002-Revert-arm64-Hook-up-the-ZBOOT-support-as-vmlinuz.patch
|
||||
Patch1015: orabug36567412-0003-Revert-arm64-Add-ZBOOT-PE-containing-compressed-imag.patch
|
||||
Patch1016: orabug36567412-0004-Revert-kexec-zboot-Add-arch-independent-zboot-suppor.patch
|
||||
Patch1017: orabug36567412-0005-Revert-kexec-Introduce-a-member-kernel_fd-in-kexec_i.patch
|
||||
Patch1018: orabug36567412-0006-Revert-kexec-arm64-Simplify-the-code-for-zImage.patch
|
||||
Patch1019: orabug30352094-makedumpfile-Mark-mem-usage-option-unsupported-for-a.patch
|
||||
Patch1020: orabug37858059.kdump.sysconfig.disable-transparent_hugepage-for-aarch64.patch
|
||||
|
||||
%description
|
||||
kexec-tools provides /sbin/kexec binary that facilitates a new
|
||||
kernel to boot using the kernel's kexec feature either on a
|
||||
@ -124,10 +145,17 @@ component of the kernel's kexec feature.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1013 -p1
|
||||
%patch1014 -p1
|
||||
%patch1015 -p1
|
||||
%patch1016 -p1
|
||||
%patch1017 -p1
|
||||
%patch1018 -p1
|
||||
|
||||
mkdir -p -m755 kcp
|
||||
tar -z -x -v -f %{SOURCE9}
|
||||
tar -z -x -v -f %{SOURCE19}
|
||||
%patch1019 -p1
|
||||
|
||||
%ifarch ppc
|
||||
%define archdef ARCH=ppc
|
||||
@ -183,12 +211,28 @@ mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}
|
||||
mkdir -p -m755 $RPM_BUILD_ROOT%{_prefix}/lib/kdump/dracut.conf.d
|
||||
mkdir -p -m755 $RPM_BUILD_ROOT%{_sharedstatedir}/kdump
|
||||
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/kdumpctl
|
||||
patch $RPM_BUILD_ROOT%{_bindir}/kdumpctl %{PATCH1001}
|
||||
patch $RPM_BUILD_ROOT%{_bindir}/kdumpctl %{PATCH1003}
|
||||
patch $RPM_BUILD_ROOT%{_bindir}/kdumpctl %{PATCH1012}
|
||||
|
||||
install -m 755 build/sbin/kexec $RPM_BUILD_ROOT/usr/sbin/kexec
|
||||
install -m 755 build/sbin/vmcore-dmesg $RPM_BUILD_ROOT/usr/sbin/vmcore-dmesg
|
||||
install -m 644 build/man/man8/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/
|
||||
install -m 644 build/man/man8/vmcore-dmesg.8 $RPM_BUILD_ROOT%{_mandir}/man8/
|
||||
|
||||
#apply kdump sysconfig patches, if there are any
|
||||
patch -d $RPM_SOURCE_DIR -p0 < %{PATCH1002}
|
||||
patch -d $RPM_SOURCE_DIR -p0 < %{PATCH1004}
|
||||
patch -d $RPM_SOURCE_DIR -p0 < %{PATCH1007}
|
||||
patch -d $RPM_SOURCE_DIR -p0 < %{PATCH1020}
|
||||
|
||||
#apply kdump-lib patches
|
||||
patch -d $RPM_SOURCE_DIR -p1 < %{PATCH1008}
|
||||
patch -d $RPM_SOURCE_DIR -p1 < %{PATCH1009}
|
||||
|
||||
#apply 98-kexec.rules patches
|
||||
patch -d $RPM_SOURCE_DIR -p1 < %{PATCH1011}
|
||||
|
||||
SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig.%{_target_cpu}
|
||||
[ -f $SYSCONFIG ] || SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig.%{_arch}
|
||||
[ -f $SYSCONFIG ] || SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig
|
||||
@ -246,6 +290,7 @@ install -m 644 makedumpfile-%{mkdf_ver}/eppic_scripts/* $RPM_BUILD_ROOT/usr/shar
|
||||
mkdir -p -m755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase
|
||||
cp %{SOURCE100} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE100}}
|
||||
cp %{SOURCE101} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE101}}
|
||||
patch --no-backup-if-mismatch $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE101}} %{PATCH1010}
|
||||
cp %{SOURCE102} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE102}}
|
||||
cp %{SOURCE104} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE104}}
|
||||
cp %{SOURCE106} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE106}}
|
||||
@ -407,6 +452,41 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Tue Aug 05 2025 EL Errata <el-errata_ww@oracle.com> - 2.0.29-5.0.4.2
|
||||
- Rebase makdumpefile to v1.7.7 [Orabug: 37946079]
|
||||
- Disable transparent_hugepage for aarch64 [Orabug: 37858059]
|
||||
- fix detection of typed (compound) pages (Linux 6.12) [Orabug: 37561509]
|
||||
- Rebase makedumpfile to v1.7.6 [Orabug: 37289579]
|
||||
- Fix KEXEC_KERNEL_CHECK IMA rule & valid PE signature regression [Orabug: 36567412]
|
||||
- Include support for virt-what [Orabug: 36517679]
|
||||
- backport of upstream crash hotplug support [Orabug: 35884469]
|
||||
- Insert new udev rules for crash hotplug into 98-kexec.rules [Orabug: 35801595]
|
||||
- Handle xen_netfront in dracut module setup [Orabug: 35615400]
|
||||
- Update UEK aarch64 reserved sizes for UEK7 kernels [Orabug: 34663083]
|
||||
- Correct UEK reserved size for x86_64 [Orabug: 34391412]
|
||||
- Update UEK reserved sizes [Orabug: 34240246]
|
||||
- fix saving vmcore-dmesg.txt failed on aarch64 with UEK7 [Orabug: 34003037]
|
||||
- include OL8 patch for sysconfig, its needed on OL9 [Orabug: 33512440]
|
||||
- Update makedumpfile to 1.7.2 [Orabug: 34219368]
|
||||
- kdump: skip lvm private devices [Orabug: 33822070] [Orabug: 33574003]
|
||||
- Added dracut module setup patches [Orabug: 29518713] [Orabug: 22780125]
|
||||
- Added orabug30352094-makedumpfile-Mark-mem-usage-option-unsupported-for-a.patch [Orabug: 30352094]
|
||||
- Added orabug30822387.kdumpctl-arm64-fast-boot.patch [Orabug: 30822387]
|
||||
- Added orabug30832988.kdump.sysconfig.iommu_off.x86_64.aarch64.patch [Orabug: 30832988]
|
||||
- Added orabug30928441.kdumpctl.no_timer_check.patch [Orabug: 30928441]
|
||||
- Added orabug32127375-kdump.sysconfig.no.double.s.patch [Orabug: 32127375]
|
||||
- Added orabug32258986-arm64-support-more-than-one-crash-kernel-regions.patch [Orabug: 32258986]
|
||||
- Removed orabug32258986-arm64-support-more-than-one-crash-kernel-regions.patch [Orabug: 32258986]
|
||||
- Removed orabug34003037-arm64-crashdump-deduce-paddr-of-_text-based-on-kerne.patch [Orabug: 34003037]
|
||||
- Removed orabug34003037-arm64-make-phys_offset-signed.patch [Orabug: 34003037]
|
||||
- Removed orabug34003037-arm64-crashdump-unify-routine-to-get-page_offset.patch [Orabug: 34003037]
|
||||
- Removed orabug34003037-arm64-read-VA_BITS-from-kcore-for-52-bits-VA-kernel.patch [Orabug: 34003037]
|
||||
- Removed orabug34003037-arm64-fix-PAGE_OFFSET-calc-for-flipped-mm.patch [Orabug: 34003037]
|
||||
- Removed orabug34003037-kdump-kexec-fix-saving-vmcore-dmesg.txt-failed-on-aa.patch [Orabug: 34003037]
|
||||
- Fix formatting for orabug33822070-kdump-skip-lvm-private-devices.patch [Orabug: 33822070]
|
||||
- Rework orabug34663083-Update-UEK-reserved-sizes.patch [Orabug: 34240246]
|
||||
- Rebase kexec-tools to v2.0.28
|
||||
|
||||
* Thu Jun 19 2025 Tao Liu <ltao@redhat.com> - 2.0.29-5.2
|
||||
- Bump up version number
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user