diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:31:53 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:31:53 +0000 |
| commit | 8c22ff0d8b70d9b12f0487ef696a7e915b9e3173 (patch) | |
| tree | efdc32587159d0050a69009bdf2330a531727d95 /meta/recipes-kernel/kexec/kexec-tools | |
| parent | d412d2747595c1cc4a5e3ca975e3adc31b2f7891 (diff) | |
| download | poky-8c22ff0d8b70d9b12f0487ef696a7e915b9e3173.tar.gz | |
The poky repository master branch is no longer being updated.
You can either:
a) switch to individual clones of bitbake, openembedded-core, meta-yocto and yocto-docs
b) use the new bitbake-setup
You can find information about either approach in our documentation:
https://docs.yoctoproject.org/
Note that "poky" the distro setting is still available in meta-yocto as
before and we continue to use and maintain that.
Long live Poky!
Some further information on the background of this change can be found
in: https://lists.openembedded.org/g/openembedded-architecture/message/2179
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/kexec/kexec-tools')
10 files changed, 0 insertions, 470 deletions
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-Make-the-segment-base-match-pinned-section-address.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-Make-the-segment-base-match-pinned-section-address.patch deleted file mode 100644 index 6babf16e6e..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/0001-Make-the-segment-base-match-pinned-section-address.patch +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | From 0d8a9e12b6509cb2a79818f5f4062a0bee33edfc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 3 Sep 2025 13:28:32 -0700 | ||
| 4 | Subject: [PATCH] Make the segment base match pinned section address | ||
| 5 | |||
| 6 | ET_EXEC uses image base of 0x400000, but the build forces | ||
| 7 | section VMAs like .text = 0x10000. LLD now errors when any | ||
| 8 | section address is below the image base unless you explicitly | ||
| 9 | set the base. (Older LLD tolerated it.) | ||
| 10 | |||
| 11 | To fix this, set the image base to match forced section addresses | ||
| 12 | |||
| 13 | Fixes | ||
| 14 | | x86_64-yoe-linux-ld.lld: error: section '.text' address (0x10000) is smaller than image base (0x400000); specify --image-base | ||
| 15 | | x86_64-yoe-linux-ld.lld: error: section '.bss' address (0x12000) is smaller than image base (0x400000); specify --image-base | ||
| 16 | |||
| 17 | Upstream-Status: Submitted [https://lists.infradead.org/pipermail/kexec/2025-September/033493.html] | ||
| 18 | |||
| 19 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 20 | --- | ||
| 21 | kexec_test/Makefile | 2 +- | ||
| 22 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 23 | |||
| 24 | --- a/kexec_test/Makefile | ||
| 25 | +++ b/kexec_test/Makefile | ||
| 26 | @@ -5,7 +5,7 @@ RELOC:=0x10000 | ||
| 27 | KEXEC_TEST_SRCS:= kexec_test/kexec_test16.S kexec_test/kexec_test.S | ||
| 28 | |||
| 29 | dist += kexec_test/Makefile $(KEXEC_TEST_SRCS) \ | ||
| 30 | - kexec_test/x86-setup-legacy-pic.S | ||
| 31 | + kexec_test/x86-setup-legacy-pic.S kexec_test/kexec_test.ld | ||
| 32 | |||
| 33 | BUILD_KEXEC_TEST = no | ||
| 34 | ifeq ($(ARCH),i386) | ||
| 35 | @@ -31,7 +31,7 @@ $(KEXEC_TEST): CPPFLAGS+=-DRELOC=$(RELOC | ||
| 36 | $(KEXEC_TEST): ASFLAGS+=-m32 | ||
| 37 | #$(KEXEC_TEST): LDFLAGS=-m32 -Wl,-e -Wl,_start -Wl,-Ttext -Wl,$(RELOC) \ | ||
| 38 | # -nostartfiles | ||
| 39 | -$(KEXEC_TEST): LDFLAGS=-melf_i386 -e _start -Ttext $(RELOC) | ||
| 40 | +$(KEXEC_TEST): LDFLAGS=-melf_i386 -e _start -T $(srcdir)/kexec_test/kexec_test.ld | ||
| 41 | |||
| 42 | $(KEXEC_TEST): $(KEXEC_TEST_OBJS) | ||
| 43 | mkdir -p $(@D) | ||
| 44 | --- /dev/null | ||
| 45 | +++ b/kexec_test/kexec_test.ld | ||
| 46 | @@ -0,0 +1,16 @@ | ||
| 47 | +ENTRY(_start) | ||
| 48 | +SECTIONS | ||
| 49 | +{ | ||
| 50 | + . = 0x10000; | ||
| 51 | + .text : { *(.text .text.*) } | ||
| 52 | + | ||
| 53 | + /* Place the note after .text to avoid overlap */ | ||
| 54 | + . = ALIGN(16); | ||
| 55 | + .note.gnu.property : { *(.note.gnu.property) } | ||
| 56 | + | ||
| 57 | + .rodata : { *(.rodata .rodata.*) } | ||
| 58 | + | ||
| 59 | + /* If you need bss fixed: */ | ||
| 60 | + . = 0x12000; | ||
| 61 | + .bss : { *(.bss .bss.* COMMON) } | ||
| 62 | +} | ||
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 deleted file mode 100644 index ee731cea4b..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch +++ /dev/null | |||
| @@ -1,67 +0,0 @@ | |||
| 1 | From 9e95f8933bded10fdd664fc95492825347ec59a7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Kamensky <alexander.kamensky42@gmail.com> | ||
| 3 | Date: Thu, 12 Nov 2020 12:56:46 -0800 | ||
| 4 | Subject: [PATCH] arm64: kexec: disabled check if kaslr-seed dtb property was | ||
| 5 | wiped | ||
| 6 | |||
| 7 | Kexec when loading arm64 kernel checks if chosen/kaslr-seed dtb property is | ||
| 8 | wiped. It's a good assertion to verify proper behavior of kernel. However, | ||
| 9 | if bootloader creates and fills kaslr-seed property and kernel is not | ||
| 10 | configured with CONFIG_RANDOMIZE_BASE then logic of reading and wiping | ||
| 11 | kaslr-seed does not run. As a result kaslr-seed property is not zero and when | ||
| 12 | kexec tries to load secondary kernel it fails with the following message: | ||
| 13 | |||
| 14 | setup_2nd_dtb: kaslr-seed is not wiped to 0. | ||
| 15 | kexec: setup_2nd_dtb failed. | ||
| 16 | kexec: load failed. | ||
| 17 | |||
| 18 | This was observed on Yocto Project on qemuarm64 machine with 5.8 kernel, | ||
| 19 | qemu 5.1.0. Qemu created kaslr-seed property but kernel was not configured | ||
| 20 | with CONFIG_RANDOMIZE_BASE. | ||
| 21 | |||
| 22 | Although check has some value, there is a use-case where it breaks kexec, | ||
| 23 | this patch removes it. | ||
| 24 | |||
| 25 | Note in described use-case the fact that kaslr-seed is not wiped and user | ||
| 26 | readable through /sys/firmware/fdt or | ||
| 27 | /sys/firmware/devicetree/base/chosen/kaslr-seed is not a security problem | ||
| 28 | as kaslr is disabled anyway. | ||
| 29 | |||
| 30 | Signed-off-by: Alexander Kamensky <alexander.kamensky42@gmail.com> | ||
| 31 | Upstream-Status: Submitted [http://lists.infradead.org/pipermail/kexec/2020-November/021740.html] | ||
| 32 | --- | ||
| 33 | kexec/arch/arm64/kexec-arm64.c | 14 +------------- | ||
| 34 | 1 file changed, 1 insertion(+), 13 deletions(-) | ||
| 35 | |||
| 36 | diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c | ||
| 37 | index 9091f40..ea304f9 100644 | ||
| 38 | --- a/kexec/arch/arm64/kexec-arm64.c | ||
| 39 | +++ b/kexec/arch/arm64/kexec-arm64.c | ||
| 40 | @@ -504,7 +504,7 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line, int on_crash) | ||
| 41 | int len, range_len; | ||
| 42 | int nodeoffset; | ||
| 43 | int new_size; | ||
| 44 | - int i, result, kaslr_seed; | ||
| 45 | + int i, result; | ||
| 46 | |||
| 47 | result = fdt_check_header(dtb->buf); | ||
| 48 | |||
| 49 | @@ -577,18 +577,6 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line, int on_crash) | ||
| 50 | return result; | ||
| 51 | } | ||
| 52 | } else { | ||
| 53 | - kaslr_seed = fdt64_to_cpu(*prop); | ||
| 54 | - | ||
| 55 | - /* kaslr_seed must be wiped clean by primary | ||
| 56 | - * kernel during boot | ||
| 57 | - */ | ||
| 58 | - if (kaslr_seed != 0) { | ||
| 59 | - dbgprintf("%s: kaslr-seed is not wiped to 0.\n", | ||
| 60 | - __func__); | ||
| 61 | - result = -EINVAL; | ||
| 62 | - goto on_error; | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | /* | ||
| 66 | * Invoke the getrandom system call with | ||
| 67 | * GRND_NONBLOCK, to make sure we | ||
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 deleted file mode 100644 index 5d994d9ffb..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/0001-kexec.c-add-MFD_NOEXEC_SEAL-flag-explicitly.patch +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | From 0b176595ca1610037d1175e1786d1a8aff1fb43f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Chen Qi <Qi.Chen@windriver.com> | ||
| 3 | Date: Tue, 6 Aug 2024 21:42:43 -0700 | ||
| 4 | Subject: [PATCH] kexec.c: add MFD_NOEXEC_SEAL flag explicitly | ||
| 5 | |||
| 6 | Add 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 | |||
| 10 | For old kernels, there will be no MFD_NOEXEC_SEAL definition, so fallback | ||
| 11 | to define it to 0. | ||
| 12 | |||
| 13 | Upstream-Status: Submitted [https://github.com/horms/kexec-tools/pull/7] | ||
| 14 | |||
| 15 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
| 16 | --- | ||
| 17 | kexec/kexec.c | 6 +++++- | ||
| 18 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
| 19 | |||
| 20 | diff --git a/kexec/kexec.c b/kexec/kexec.c | ||
| 21 | index 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-powerpc-change-the-memory-size-limit.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-powerpc-change-the-memory-size-limit.patch deleted file mode 100644 index 029650f35c..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/0001-powerpc-change-the-memory-size-limit.patch +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | From 211cae4b6a02a4d9d37bfcd76f3702696e095fc3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Quanyang Wang <quanyang.wang@windriver.com> | ||
| 3 | Date: Tue, 16 Jun 2015 12:59:57 +0800 | ||
| 4 | Subject: [PATCH] powerpc: change the memory size limit | ||
| 5 | |||
| 6 | When run "kexec" in powerpc board, the kexec has a limit that | ||
| 7 | the kernel text and bss size must be less than 24M. But now | ||
| 8 | some kernel size exceed the limit. So we need to change the limit, | ||
| 9 | else will get the error log as below: | ||
| 10 | |||
| 11 | my_load:669: do | ||
| 12 | Could not find a free area of memory of 0x12400 bytes... | ||
| 13 | Could not find a free area of memory of 0x13000 bytes... | ||
| 14 | locate_hole failed | ||
| 15 | |||
| 16 | Upstream-Status: Pending | ||
| 17 | |||
| 18 | Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com> | ||
| 19 | --- | ||
| 20 | kexec/arch/ppc/kexec-ppc.h | 2 +- | ||
| 21 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 22 | |||
| 23 | diff --git a/kexec/arch/ppc/kexec-ppc.h b/kexec/arch/ppc/kexec-ppc.h | ||
| 24 | index 04e728e..6bae9ec 100644 | ||
| 25 | --- a/kexec/arch/ppc/kexec-ppc.h | ||
| 26 | +++ b/kexec/arch/ppc/kexec-ppc.h | ||
| 27 | @@ -44,7 +44,7 @@ void dol_ppc_usage(void); | ||
| 28 | * During inital setup the kernel does not map the whole memory but a part of | ||
| 29 | * it. On Book-E that is 64MiB, 601 24MiB or 256MiB (if possible). | ||
| 30 | */ | ||
| 31 | -#define KERNEL_ACCESS_TOP (24 * 1024 * 1024) | ||
| 32 | +#define KERNEL_ACCESS_TOP (36 * 1024 * 1024) | ||
| 33 | |||
| 34 | /* boot block version 17 as defined by the linux kernel */ | ||
| 35 | struct bootblock { | ||
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 deleted file mode 100644 index 483e5195a9..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/0001-ppc-fs2dt-Match-function-signatures.patch +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | From 4a07e8f22b4f224dca79767e5cb86a0de91498dc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sat, 17 May 2025 07:48:50 -0700 | ||
| 4 | Subject: [PATCH] ppc/fs2dt: Match function signatures | ||
| 5 | |||
| 6 | The prototypes of function pointers is analysed and | ||
| 7 | compiler 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 | |||
| 13 | Upstream-Status: Submitted [https://lore.kernel.org/kexec/20250517145852.2488183-1-raj.khem@gmail.com/T/#u] | ||
| 14 | Signed-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 | |||
| 19 | diff --git a/kexec/arch/ppc/fs2dt.c b/kexec/arch/ppc/fs2dt.c | ||
| 20 | index 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/0002-purgatory-Pass-r-directly-to-linker.patch b/meta/recipes-kernel/kexec/kexec-tools/0002-purgatory-Pass-r-directly-to-linker.patch deleted file mode 100644 index a537ac2f0b..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/0002-purgatory-Pass-r-directly-to-linker.patch +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | From e5bc9fbd6029057a4e3815a5326af5bd83a450e6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Mon, 7 Sep 2015 07:59:45 +0000 | ||
| 4 | Subject: [PATCH] purgatory: Pass -r directly to linker | ||
| 5 | |||
| 6 | This helps compiling with clang since -r is not a known option for clang | ||
| 7 | where as gcc knows how to deal with it and passes it down to linker | ||
| 8 | unfiltered | ||
| 9 | |||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | |||
| 12 | Upstream-Status: Pending | ||
| 13 | |||
| 14 | --- | ||
| 15 | purgatory/Makefile | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/purgatory/Makefile b/purgatory/Makefile | ||
| 19 | index 4d2d071..6673423 100644 | ||
| 20 | --- a/purgatory/Makefile | ||
| 21 | +++ b/purgatory/Makefile | ||
| 22 | @@ -61,7 +61,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ | ||
| 23 | -I$(shell $(CC) -print-file-name=include) | ||
| 24 | $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\ | ||
| 25 | -Wl,--no-undefined -nostartfiles -nostdlib \ | ||
| 26 | - -nodefaultlibs -e purgatory_start -r \ | ||
| 27 | + -nodefaultlibs -e purgatory_start -Wl,-r \ | ||
| 28 | -Wl,-Map=$(PURGATORY_MAP) | ||
| 29 | |||
| 30 | $(PURGATORY): $(PURGATORY_OBJS) | ||
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0005-Disable-PIE-during-link.patch b/meta/recipes-kernel/kexec/kexec-tools/0005-Disable-PIE-during-link.patch deleted file mode 100644 index 6a21744ac1..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/0005-Disable-PIE-during-link.patch +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | From 494888bcc3bbf070dfce1b2686ee34c8619aa33d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sat, 10 Jun 2017 11:18:49 -0700 | ||
| 4 | Subject: [PATCH] Disable PIE during link | ||
| 5 | |||
| 6 | We have explcitly disabled PIE during compile so we | ||
| 7 | just need to match it with linker flags | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | |||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | |||
| 13 | --- | ||
| 14 | purgatory/Makefile | 2 +- | ||
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/purgatory/Makefile b/purgatory/Makefile | ||
| 18 | index 6673423..a7405ea 100644 | ||
| 19 | --- a/purgatory/Makefile | ||
| 20 | +++ b/purgatory/Makefile | ||
| 21 | @@ -60,7 +60,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ | ||
| 22 | -Iinclude \ | ||
| 23 | -I$(shell $(CC) -print-file-name=include) | ||
| 24 | $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\ | ||
| 25 | - -Wl,--no-undefined -nostartfiles -nostdlib \ | ||
| 26 | + -Wl,--no-undefined -no-pie -nostartfiles -nostdlib \ | ||
| 27 | -nodefaultlibs -e purgatory_start -Wl,-r \ | ||
| 28 | -Wl,-Map=$(PURGATORY_MAP) | ||
| 29 | |||
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kdump b/meta/recipes-kernel/kexec/kexec-tools/kdump deleted file mode 100755 index 69e3cafe5c..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/kdump +++ /dev/null | |||
| @@ -1,145 +0,0 @@ | |||
| 1 | #! /bin/sh | ||
| 2 | # | ||
| 3 | # kdump | ||
| 4 | # | ||
| 5 | # Description: The kdump script provides the support: | ||
| 6 | # 1. Load a kdump kernel image into memory; | ||
| 7 | # 2. Copy away vmcore when system panic. | ||
| 8 | # | ||
| 9 | |||
| 10 | #default | ||
| 11 | KEXEC=/usr/sbin/kexec | ||
| 12 | KEXEC_ARGS="-p" | ||
| 13 | |||
| 14 | MAKEDUMPFILE=/usr/bin/makedumpfile | ||
| 15 | MAKEDUMPFILE_ARGS="-E -d 1" | ||
| 16 | |||
| 17 | LOGGER="logger -p info -t kdump" | ||
| 18 | |||
| 19 | if [ -f /etc/sysconfig/kdump.conf ]; then | ||
| 20 | . /etc/sysconfig/kdump.conf | ||
| 21 | else | ||
| 22 | echo "no /etc/sysconfig/kdump.conf" | ||
| 23 | exit 1; | ||
| 24 | fi | ||
| 25 | |||
| 26 | do_check() | ||
| 27 | { | ||
| 28 | #check makedumpfile | ||
| 29 | if [ ! -e ${MAKEDUMPFILE} -o ! -x ${MAKEDUMPFILE} ] ;then | ||
| 30 | echo "No makedumpfile found." | ||
| 31 | exit 0 | ||
| 32 | fi | ||
| 33 | |||
| 34 | #check kexec | ||
| 35 | if [ ! -e ${KEXEC} -o ! -x ${KEXEC} ] ;then | ||
| 36 | echo "No kexec found." | ||
| 37 | exit 0 | ||
| 38 | fi | ||
| 39 | |||
| 40 | #check whether kdump kernel image exists on the system | ||
| 41 | if [ -z "${KDUMP_KIMAGE}" -o ! -f "${KDUMP_KIMAGE}" ]; then | ||
| 42 | echo "No kdump kernel image found." | ||
| 43 | exit 0 | ||
| 44 | fi | ||
| 45 | |||
| 46 | if [ "${KDUMP_CMDLINE}"x = "x" ] ; then | ||
| 47 | echo "KDUMP_CMDLINE is not configured" | ||
| 48 | exit 0 | ||
| 49 | fi | ||
| 50 | } | ||
| 51 | |||
| 52 | do_save_vmcore() | ||
| 53 | { | ||
| 54 | if [ ${KDUMP_VMCORE_PATH}x = x ]; then | ||
| 55 | KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`" | ||
| 56 | fi | ||
| 57 | |||
| 58 | mkdir -p ${KDUMP_VMCORE_PATH} | ||
| 59 | echo "Saving a vmcore to ${KDUMP_VMCORE_PATH}." | ||
| 60 | |||
| 61 | ${MAKEDUMPFILE} ${MAKEDUMPFILE_ARGS} /proc/vmcore ${KDUMP_VMCORE_PATH}/vmcore-"`date +"%H:%M:%S"`" | ||
| 62 | # cp --sparse=always /proc/vmcore ${KDUMP_VMCORE_PATH}/vmcore-"`date +"%H:%M:%S"`" | ||
| 63 | rc=$? | ||
| 64 | if [ ${rc} == 0 ]; then | ||
| 65 | ${LOGGER} "Saved a vmcore to ${KDUMP_VMCORE_PATH}." | ||
| 66 | else | ||
| 67 | ${LOGGER} "Failed to save vmcore!" | ||
| 68 | fi | ||
| 69 | return ${rc} | ||
| 70 | } | ||
| 71 | |||
| 72 | do_start() | ||
| 73 | { | ||
| 74 | #check file | ||
| 75 | do_check | ||
| 76 | |||
| 77 | #check whether the running kernel supports kdump. | ||
| 78 | if [ ! -e /sys/kernel/kexec_crash_loaded ]; then | ||
| 79 | echo "Kdump isn't supported on the running kernel!!!" | ||
| 80 | ${LOGGER} "Kdump isn't supported on the running kernel!!!" | ||
| 81 | return 1 | ||
| 82 | fi | ||
| 83 | |||
| 84 | #check whether kdump kernel image has been loaded | ||
| 85 | rc=`cat /sys/kernel/kexec_crash_loaded` | ||
| 86 | if [ ${rc} != 0 ]; then | ||
| 87 | echo "Kdump is already running."; | ||
| 88 | ${LOGGER} "Kdump is already running." | ||
| 89 | return 0 | ||
| 90 | fi | ||
| 91 | |||
| 92 | #check the running kernel cmdline option,insure "crashkernel=" always set. | ||
| 93 | grep -q crashkernel= /proc/cmdline | ||
| 94 | if [ $? != 0 ]; then | ||
| 95 | echo "Kdump isn't supported on the running kernel,please check boot option!!!" | ||
| 96 | ${LOGGER} "Kdump isn't supported on the running kernel,please check boot option!!!" | ||
| 97 | return 1 | ||
| 98 | fi | ||
| 99 | |||
| 100 | #Load the kdump kernel image | ||
| 101 | ${KEXEC} ${KEXEC_ARGS} "${KDUMP_KIMAGE}" --append="${KDUMP_CMDLINE}" | ||
| 102 | if [ $? != 0 ]; then | ||
| 103 | echo "Failed to load kdump kernel!" | ||
| 104 | ${LOGGER} "Failed to load kdump kernel!" | ||
| 105 | return 1 | ||
| 106 | fi | ||
| 107 | |||
| 108 | echo "Kdump started up." | ||
| 109 | ${LOGGER} "Kdump started up." | ||
| 110 | } | ||
| 111 | |||
| 112 | do_stop() | ||
| 113 | { | ||
| 114 | ${KEXEC} -p -u 2>/dev/null | ||
| 115 | if [ $? == 0 ]; then | ||
| 116 | echo "Kdump has been stopped." | ||
| 117 | ${LOGGER} "Kdump has been stopped." | ||
| 118 | else | ||
| 119 | echo "Failed to stop kdump!" | ||
| 120 | ${LOGGER} "Failed to stop kdump!" | ||
| 121 | fi | ||
| 122 | } | ||
| 123 | |||
| 124 | case "$1" in | ||
| 125 | start) | ||
| 126 | if [ -s /proc/vmcore ]; then | ||
| 127 | do_save_vmcore | ||
| 128 | reboot | ||
| 129 | else | ||
| 130 | do_start | ||
| 131 | fi | ||
| 132 | ;; | ||
| 133 | restart) | ||
| 134 | do_stop | ||
| 135 | do_start | ||
| 136 | ;; | ||
| 137 | stop) | ||
| 138 | do_stop | ||
| 139 | ;; | ||
| 140 | *) | ||
| 141 | echo $"Usage: $0 {start|stop|restart}" | ||
| 142 | exit 1 | ||
| 143 | esac | ||
| 144 | |||
| 145 | exit $? | ||
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kdump.conf b/meta/recipes-kernel/kexec/kexec-tools/kdump.conf deleted file mode 100644 index 38190d207a..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/kdump.conf +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | #the kdump kernel version string. | ||
| 2 | #KDUMP_KVER="`uname -r`" | ||
| 3 | |||
| 4 | #this will be passed to the kdump kernel as kdump kernel command line | ||
| 5 | #KDUMP_CMDLINE="`cat /proc/cmdline`" | ||
| 6 | |||
| 7 | #the kernel image for kdump | ||
| 8 | #KDUMP_KIMAGE="/boot/bzImage-${KDUMP_KVER}" | ||
| 9 | |||
| 10 | #Where to save the vmcore | ||
| 11 | #KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`" | ||
| 12 | |||
| 13 | #the arguments to makedumpfile | ||
| 14 | MAKEDUMPFILE_ARGS="--dump-dmesg -x /boot/vmlinux-`uname -r`" | ||
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kdump.service b/meta/recipes-kernel/kexec/kexec-tools/kdump.service deleted file mode 100644 index b4a2c0611d..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/kdump.service +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=Reboot and dump vmcore via kexec | ||
| 3 | DefaultDependencies=no | ||
| 4 | Requires=sysinit.target | ||
| 5 | After=sysinit.target | ||
| 6 | |||
| 7 | [Service] | ||
| 8 | Type=oneshot | ||
| 9 | RemainAfterExit=yes | ||
| 10 | ExecStart=@LIBEXECDIR@/kdump-helper start | ||
| 11 | ExecStop=@LIBEXECDIR@/kdump-helper stop | ||
| 12 | |||
| 13 | [Install] | ||
| 14 | WantedBy=multi-user.target | ||
