summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/kexec
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/kexec')
-rw-r--r--meta/recipes-kernel/kexec/kexec-tools/0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch11
-rw-r--r--meta/recipes-kernel/kexec/kexec-tools/0001-kexec.c-add-MFD_NOEXEC_SEAL-flag-explicitly.patch43
-rw-r--r--meta/recipes-kernel/kexec/kexec-tools/0001-ppc-fs2dt-Match-function-signatures.patch31
-rw-r--r--meta/recipes-kernel/kexec/kexec-tools/0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch50
-rw-r--r--meta/recipes-kernel/kexec/kexec-tools/Fix-building-on-x86_64-with-binutils-2.41.patch95
-rw-r--r--meta/recipes-kernel/kexec/kexec-tools_2.0.31.bb (renamed from meta/recipes-kernel/kexec/kexec-tools_2.0.28.bb)27
6 files changed, 95 insertions, 162 deletions
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch
index ddc1519126..ee731cea4b 100644
--- a/meta/recipes-kernel/kexec/kexec-tools/0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch
+++ b/meta/recipes-kernel/kexec/kexec-tools/0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch
@@ -1,4 +1,4 @@
1From d48ec5e1a5fb7907520dee71b1d94045486a0c29 Mon Sep 17 00:00:00 2001 1From 9e95f8933bded10fdd664fc95492825347ec59a7 Mon Sep 17 00:00:00 2001
2From: Alexander Kamensky <alexander.kamensky42@gmail.com> 2From: Alexander Kamensky <alexander.kamensky42@gmail.com>
3Date: Thu, 12 Nov 2020 12:56:46 -0800 3Date: Thu, 12 Nov 2020 12:56:46 -0800
4Subject: [PATCH] arm64: kexec: disabled check if kaslr-seed dtb property was 4Subject: [PATCH] arm64: kexec: disabled check if kaslr-seed dtb property was
@@ -34,10 +34,10 @@ Upstream-Status: Submitted [http://lists.infradead.org/pipermail/kexec/2020-Nove
34 1 file changed, 1 insertion(+), 13 deletions(-) 34 1 file changed, 1 insertion(+), 13 deletions(-)
35 35
36diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c 36diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
37index ec6df4b..10238d9 100644 37index 9091f40..ea304f9 100644
38--- a/kexec/arch/arm64/kexec-arm64.c 38--- a/kexec/arch/arm64/kexec-arm64.c
39+++ b/kexec/arch/arm64/kexec-arm64.c 39+++ b/kexec/arch/arm64/kexec-arm64.c
40@@ -503,7 +503,7 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line, int on_crash) 40@@ -504,7 +504,7 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line, int on_crash)
41 int len, range_len; 41 int len, range_len;
42 int nodeoffset; 42 int nodeoffset;
43 int new_size; 43 int new_size;
@@ -46,7 +46,7 @@ index ec6df4b..10238d9 100644
46 46
47 result = fdt_check_header(dtb->buf); 47 result = fdt_check_header(dtb->buf);
48 48
49@@ -576,18 +576,6 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line, int on_crash) 49@@ -577,18 +577,6 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line, int on_crash)
50 return result; 50 return result;
51 } 51 }
52 } else { 52 } else {
@@ -65,6 +65,3 @@ index ec6df4b..10238d9 100644
65 /* 65 /*
66 * Invoke the getrandom system call with 66 * Invoke the getrandom system call with
67 * GRND_NONBLOCK, to make sure we 67 * GRND_NONBLOCK, to make sure we
68--
692.25.1
70
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-kexec.c-add-MFD_NOEXEC_SEAL-flag-explicitly.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-kexec.c-add-MFD_NOEXEC_SEAL-flag-explicitly.patch
new file mode 100644
index 0000000000..5d994d9ffb
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/0001-kexec.c-add-MFD_NOEXEC_SEAL-flag-explicitly.patch
@@ -0,0 +1,43 @@
1From 0b176595ca1610037d1175e1786d1a8aff1fb43f Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 6 Aug 2024 21:42:43 -0700
4Subject: [PATCH] kexec.c: add MFD_NOEXEC_SEAL flag explicitly
5
6Add MFD_NOEXEC_SEAL to avoid kernel warning like below:
7
8 kexec[970]: memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set
9
10For old kernels, there will be no MFD_NOEXEC_SEAL definition, so fallback
11to define it to 0.
12
13Upstream-Status: Submitted [https://github.com/horms/kexec-tools/pull/7]
14
15Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
16---
17 kexec/kexec.c | 6 +++++-
18 1 file changed, 5 insertions(+), 1 deletion(-)
19
20diff --git a/kexec/kexec.c b/kexec/kexec.c
21index 6bf12d7..2f8e7cc 100644
22--- a/kexec/kexec.c
23+++ b/kexec/kexec.c
24@@ -61,6 +61,10 @@
25 #define KEXEC_LOADED_PATH "/sys/kernel/kexec_loaded"
26 #define KEXEC_CRASH_LOADED_PATH "/sys/kernel/kexec_crash_loaded"
27
28+#ifndef MFD_NOEXEC_SEAL
29+#define MFD_NOEXEC_SEAL 0
30+#endif
31+
32 unsigned long long mem_min = 0;
33 unsigned long long mem_max = ULONG_MAX;
34 unsigned long elfcorehdrsz = 0;
35@@ -661,7 +665,7 @@ static int copybuf_memfd(const char *kernel_buf, size_t size)
36 {
37 int fd, count;
38
39- fd = memfd_create("kernel", MFD_ALLOW_SEALING);
40+ fd = memfd_create("kernel", MFD_ALLOW_SEALING | MFD_NOEXEC_SEAL);
41 if (fd == -1)
42 return fd;
43
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-ppc-fs2dt-Match-function-signatures.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-ppc-fs2dt-Match-function-signatures.patch
new file mode 100644
index 0000000000..483e5195a9
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/0001-ppc-fs2dt-Match-function-signatures.patch
@@ -0,0 +1,31 @@
1From 4a07e8f22b4f224dca79767e5cb86a0de91498dc Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 17 May 2025 07:48:50 -0700
4Subject: [PATCH] ppc/fs2dt: Match function signatures
5
6The prototypes of function pointers is analysed and
7compiler finds the signature mismatches and complain about it.
8
9../kexec-tools-2.0.31/kexec/arch/ppc/fs2dt.c:338:44: error: incompatible function pointer types passing 'int (const void *, const void *)' to parameter of type 'int (*)(const struct dirent **, const struct dirent **)' [-Wincompatible-function-pointer-types]
10 338 | numlist = scandir(pathname, &namelist, 0, comparefunc);
11 | ^~~~~~~~~~~
12
13Upstream-Status: Submitted [https://lore.kernel.org/kexec/20250517145852.2488183-1-raj.khem@gmail.com/T/#u]
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 kexec/arch/ppc/fs2dt.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/kexec/arch/ppc/fs2dt.c b/kexec/arch/ppc/fs2dt.c
20index fed499b..4952bfc 100644
21--- a/kexec/arch/ppc/fs2dt.c
22+++ b/kexec/arch/ppc/fs2dt.c
23@@ -292,7 +292,7 @@ static void putprops(char *fn, struct dirent **nlist, int numlist)
24 * Compare function used to sort the device-tree directories
25 * This function will be passed to scandir.
26 */
27-static int comparefunc(const void *dentry1, const void *dentry2)
28+static int comparefunc(const struct dirent ** dentry1, const struct dirent **dentry2)
29 {
30 char *str1 = (*(struct dirent **)dentry1)->d_name;
31 char *str2 = (*(struct dirent **)dentry2)->d_name;
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch b/meta/recipes-kernel/kexec/kexec-tools/0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch
deleted file mode 100644
index e874a8b4f1..0000000000
--- a/meta/recipes-kernel/kexec/kexec-tools/0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch
+++ /dev/null
@@ -1,50 +0,0 @@
1From b62c1da8f8e641397add10367ee9c4cfdedb1cc0 Mon Sep 17 00:00:00 2001
2From: Haiqing Bai <Haiqing.Bai@windriver.com>
3Date: Mon, 9 Jan 2017 15:26:29 +0800
4Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue
5
6When "CONFIG_ARM_LPAE" is enabled,3 level page table
7is used by MMU, the "SECTION_SIZE" is defined with
8(1 << 21), but 'add_buffer_phys_virt()' hardcode this
9to (1 << 20).
10
11Upstream-Status: Pending
12
13Suggested-By:fredrik.markstrom@gmail.com
14Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
15
16---
17 kexec/arch/arm/crashdump-arm.c | 5 ++++-
18 1 file changed, 4 insertions(+), 1 deletion(-)
19
20diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
21index 1ec1826..cc20f63 100644
22--- a/kexec/arch/arm/crashdump-arm.c
23+++ b/kexec/arch/arm/crashdump-arm.c
24@@ -242,6 +242,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
25 void *buf;
26 int err;
27 int last_ranges;
28+ unsigned short align_bit_shift = 20;
29
30 /*
31 * First fetch all the memory (RAM) ranges that we are going to pass to
32@@ -283,6 +284,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
33
34 /* for support LPAE enabled kernel*/
35 elf_info.class = ELFCLASS64;
36+ align_bit_shift = 21;
37
38 err = crash_create_elf64_headers(info, &elf_info,
39 usablemem_rgns.ranges,
40@@ -304,8 +306,9 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
41 * 1MB) so that available memory passed in kernel command line will be
42 * aligned to 1MB. This is because kernel create_mapping() wants memory
43 * regions to be aligned to SECTION_SIZE.
44+ * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in pgtable-3level.h
45 */
46- elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
47+ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << align_bit_shift,
48 crash_kernel_mem.start,
49 crash_kernel_mem.end, -1, 0);
50
diff --git a/meta/recipes-kernel/kexec/kexec-tools/Fix-building-on-x86_64-with-binutils-2.41.patch b/meta/recipes-kernel/kexec/kexec-tools/Fix-building-on-x86_64-with-binutils-2.41.patch
deleted file mode 100644
index 4894f044fc..0000000000
--- a/meta/recipes-kernel/kexec/kexec-tools/Fix-building-on-x86_64-with-binutils-2.41.patch
+++ /dev/null
@@ -1,95 +0,0 @@
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Michel Lind <salimma@fedoraproject.org>
3Date: Tue, 30 Jan 2024 04:14:31 -0600
4Subject: [PATCH] Fix building on x86_64 with binutils 2.41
5
6Newer versions of the GNU assembler (observed with binutils 2.41) will
7complain about the ".arch i386" in files assembled with "as --64",
8with the message "Error: 64bit mode not supported on 'i386'".
9
10Fix by moving ".arch i386" below the relevant ".code32" directive, so
11that the assembler is no longer expecting 64-bit instructions to be used
12by the time that the ".arch i386" directive is encountered.
13
14Based on similar iPXE fix:
15https://github.com/ipxe/ipxe/commit/6ca597eee
16
17Signed-off-by: Michel Lind <michel@michel-slm.name>
18Signed-off-by: Simon Horman <horms@kernel.org>
19
20Upstream-Status: Backport [https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?h=main&id=328de8e00e298f00d7ba6b25dc3950147e9642e6]
21Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
22---
23 purgatory/arch/i386/entry32-16-debug.S | 2 +-
24 purgatory/arch/i386/entry32-16.S | 2 +-
25 purgatory/arch/i386/entry32.S | 2 +-
26 purgatory/arch/i386/setup-x86.S | 2 +-
27 4 files changed, 4 insertions(+), 4 deletions(-)
28
29diff --git a/purgatory/arch/i386/entry32-16-debug.S b/purgatory/arch/i386/entry32-16-debug.S
30index 5167944..12e1164 100644
31--- a/purgatory/arch/i386/entry32-16-debug.S
32+++ b/purgatory/arch/i386/entry32-16-debug.S
33@@ -25,10 +25,10 @@
34 .globl entry16_debug_pre32
35 .globl entry16_debug_first32
36 .globl entry16_debug_old_first32
37- .arch i386
38 .balign 16
39 entry16_debug:
40 .code32
41+ .arch i386
42 /* Compute where I am running at (assumes esp valid) */
43 call 1f
44 1: popl %ebx
45diff --git a/purgatory/arch/i386/entry32-16.S b/purgatory/arch/i386/entry32-16.S
46index c051aab..eace095 100644
47--- a/purgatory/arch/i386/entry32-16.S
48+++ b/purgatory/arch/i386/entry32-16.S
49@@ -20,10 +20,10 @@
50 #undef i386
51 .text
52 .globl entry16, entry16_regs
53- .arch i386
54 .balign 16
55 entry16:
56 .code32
57+ .arch i386
58 /* Compute where I am running at (assumes esp valid) */
59 call 1f
60 1: popl %ebx
61diff --git a/purgatory/arch/i386/entry32.S b/purgatory/arch/i386/entry32.S
62index f7a494f..8ce9e31 100644
63--- a/purgatory/arch/i386/entry32.S
64+++ b/purgatory/arch/i386/entry32.S
65@@ -20,10 +20,10 @@
66 #undef i386
67
68 .text
69- .arch i386
70 .globl entry32, entry32_regs
71 entry32:
72 .code32
73+ .arch i386
74
75 /* Setup a gdt that should that is generally usefully */
76 lgdt %cs:gdt
77diff --git a/purgatory/arch/i386/setup-x86.S b/purgatory/arch/i386/setup-x86.S
78index 201bb2c..a212eed 100644
79--- a/purgatory/arch/i386/setup-x86.S
80+++ b/purgatory/arch/i386/setup-x86.S
81@@ -21,10 +21,10 @@
82 #undef i386
83
84 .text
85- .arch i386
86 .globl purgatory_start
87 purgatory_start:
88 .code32
89+ .arch i386
90
91 /* Load a gdt so I know what the segment registers are */
92 lgdt %cs:gdt
93--
942.39.2
95
diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.28.bb b/meta/recipes-kernel/kexec/kexec-tools_2.0.31.bb
index dec821ea88..7333aa73c1 100644
--- a/meta/recipes-kernel/kexec/kexec-tools_2.0.28.bb
+++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.31.bb
@@ -1,12 +1,13 @@
1
2SUMMARY = "Kexec fast reboot tools" 1SUMMARY = "Kexec fast reboot tools"
3DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel" 2DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel"
4HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/" 3HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/"
5SECTION = "kernel/userland" 4SECTION = "kernel/userland"
6LICENSE = "GPL-2.0-only" 5LICENSE = "GPL-2.0-only"
7LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \ 6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
8 file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09" 7 file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09 \
8 "
9DEPENDS = "zlib xz" 9DEPENDS = "zlib xz"
10RDEPENDS:${PN} = "makedumpfile"
10 11
11SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \ 12SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \
12 file://kdump \ 13 file://kdump \
@@ -14,19 +15,22 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz
14 file://kdump.service \ 15 file://kdump.service \
15 file://0001-powerpc-change-the-memory-size-limit.patch \ 16 file://0001-powerpc-change-the-memory-size-limit.patch \
16 file://0002-purgatory-Pass-r-directly-to-linker.patch \ 17 file://0002-purgatory-Pass-r-directly-to-linker.patch \
17 file://0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \
18 file://0005-Disable-PIE-during-link.patch \ 18 file://0005-Disable-PIE-during-link.patch \
19 file://0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch \ 19 file://0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch \
20 file://Fix-building-on-x86_64-with-binutils-2.41.patch \ 20 file://0001-kexec.c-add-MFD_NOEXEC_SEAL-flag-explicitly.patch \
21 file://0001-ppc-fs2dt-Match-function-signatures.patch \
21 " 22 "
22 23
23SRC_URI[sha256sum] = "f33d2660b3e38d25a127e87097978e0f7a9a73ab5151a29eb80974d169ff6a29" 24SRC_URI[sha256sum] = "ddaaa65b02b4f8aa9222586b1f26565b93a4baeffd35bcbd523f15fae7aa4897"
24 25
25inherit autotools update-rc.d systemd 26inherit autotools update-rc.d systemd
26 27
27export LDFLAGS = "-L${STAGING_LIBDIR}" 28export LDFLAGS = "-L${STAGING_LIBDIR}"
28EXTRA_OECONF = " --with-zlib=yes" 29EXTRA_OECONF = " --with-zlib=yes"
29 30
31# purgatory uses -msoft-float for ppc32/ppc64, it does not go with -maltivec
32TUNE_CCARGS:remove:powerpc = "-maltivec"
33
30do_compile:prepend() { 34do_compile:prepend() {
31 # Remove the prepackaged config.h from the source tree as it overrides 35 # Remove the prepackaged config.h from the source tree as it overrides
32 # the same file generated by configure and placed in the build tree 36 # the same file generated by configure and placed in the build tree
@@ -44,15 +48,15 @@ do_compile:prepend() {
44 48
45do_install:append () { 49do_install:append () {
46 install -d ${D}${sysconfdir}/sysconfig 50 install -d ${D}${sysconfdir}/sysconfig
47 install -m 0644 ${WORKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig 51 install -m 0644 ${UNPACKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig
48 52
49 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then 53 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
50 install -D -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump 54 install -D -m 0755 ${UNPACKDIR}/kdump ${D}${sysconfdir}/init.d/kdump
51 fi 55 fi
52 56
53 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then 57 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
54 install -D -m 0755 ${WORKDIR}/kdump ${D}${libexecdir}/kdump-helper 58 install -D -m 0755 ${UNPACKDIR}/kdump ${D}${libexecdir}/kdump-helper
55 install -D -m 0644 ${WORKDIR}/kdump.service ${D}${systemd_system_unitdir}/kdump.service 59 install -D -m 0644 ${UNPACKDIR}/kdump.service ${D}${systemd_system_unitdir}/kdump.service
56 sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_system_unitdir}/kdump.service 60 sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_system_unitdir}/kdump.service
57 fi 61 fi
58} 62}
@@ -82,5 +86,8 @@ SYSTEMD_SERVICE:kdump = "kdump.service"
82SECURITY_PIE_CFLAGS:remove = "-fPIE -pie" 86SECURITY_PIE_CFLAGS:remove = "-fPIE -pie"
83 87
84COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)' 88COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)'
89# makedumpfile would not compile on mips/rv32
90COMPATIBLE_HOST:mipsarcho32 = "null"
91COMPATIBLE_HOST:riscv32 = "null"
85 92
86INSANE_SKIP:${PN} = "arch" 93INSANE_SKIP:${PN} = "arch"