All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [meta-initramfs][PATCH] kexec-tools, kexec: Fix build with latest klibc
@ 2019-03-15 16:18 Khem Raj
  0 siblings, 0 replies; only message in thread
From: Khem Raj @ 2019-03-15 16:18 UTC (permalink / raw
  To: openembedded-devel

klibc has changed its signature of reboot() API
adapt the use here

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...ecboot-Use-new-reboot-API-with-klibc.patch | 42 +++++++++++++++++++
 .../recipes-bsp/kexecboot/kexecboot_git.bb    |  2 +
 .../kexec-tools-klibc/klibc-reboot.patch      | 11 +++++
 .../kexec/kexec-tools-klibc_git.bb            |  3 +-
 4 files changed, 57 insertions(+), 1 deletion(-)
 create mode 100644 meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-Use-new-reboot-API-with-klibc.patch
 create mode 100644 meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/klibc-reboot.patch

diff --git a/meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-Use-new-reboot-API-with-klibc.patch b/meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-Use-new-reboot-API-with-klibc.patch
new file mode 100644
index 0000000000..52d622a2f8
--- /dev/null
+++ b/meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-Use-new-reboot-API-with-klibc.patch
@@ -0,0 +1,42 @@
+From a6d1678379df6142a68cc9bb76dae540a31b8fdb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 14 Mar 2019 23:47:50 -0700
+Subject: [PATCH] kexecboot: Use new reboot() API with klibc
+
+Klibc has changed this API in
+https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=6b621b8705ce5901dcf49607c8a3523c9e521901
+
+therefore adopt the code
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/kexecboot.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/kexecboot.c b/src/kexecboot.c
+index cf49b40..c785fce 100644
+--- a/src/kexecboot.c
++++ b/src/kexecboot.c
+@@ -857,7 +857,7 @@ int process_ctx_menu(struct params_t *params, int action) {
+ #else
+ 		sync();
+ 		/* if ( -1 == reboot(LINUX_REBOOT_CMD_RESTART) ) { */
+-		if ( -1 == reboot(RB_AUTOBOOT) ) {
++		if ( -1 == reboot(RB_AUTOBOOT, NULL) ) {
+ 			log_msg(lg, "Can't initiate reboot: %s", ERRMSG);
+ 		}
+ #endif
+@@ -874,7 +874,7 @@ int process_ctx_menu(struct params_t *params, int action) {
+ #else
+ 		sync();
+ 		/* if ( -1 == reboot(LINUX_REBOOT_CMD_POWER_OFF) ) { */
+-		if ( -1 == reboot(RB_POWER_OFF) ) {
++		if ( -1 == reboot(RB_POWER_OFF, NULL) ) {
+ 			log_msg(lg, "Can't initiate shutdown: %s", ERRMSG);
+ 		}
+ #endif
+-- 
+2.21.0
+
diff --git a/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb b/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb
index 61210e7680..4b20e1ed9a 100644
--- a/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb
+++ b/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb
@@ -6,6 +6,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 PV = "0.6+git${SRCPV}"
 S = "${WORKDIR}/git"
 SRC_URI = "git://github.com/kexecboot/kexecboot.git"
+SRC_URI_append_libc-klibc = " file://0001-kexecboot-Use-new-reboot-API-with-klibc.patch "
+
 SRCREV = "7409a1e0aaea61af87c4eca0149cec18a9f58ab6"
 inherit autotools
 
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/klibc-reboot.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/klibc-reboot.patch
new file mode 100644
index 0000000000..be1301df68
--- /dev/null
+++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/klibc-reboot.patch
@@ -0,0 +1,11 @@
+--- a/kexec/kexec.c
++++ b/kexec/kexec.c
+@@ -901,7 +901,7 @@ static int my_exec(void)
+ 	if (xen_present())
+ 		xen_kexec_exec();
+ 	else
+-		reboot(LINUX_REBOOT_CMD_KEXEC);
++		reboot(LINUX_REBOOT_CMD_KEXEC, NULL);
+ 	/* I have failed if I make it here */
+ 	fprintf(stderr, "kexec failed: %s\n", 
+ 		strerror(errno));
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_git.bb b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_git.bb
index ebf5ff5ae4..7ad55d8b8c 100644
--- a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_git.bb
+++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_git.bb
@@ -31,7 +31,8 @@ KLIBC_PATCHES += " \
             file://0012-purgatory-string.c-avoid-inclusion-of-string.h.patch \
             file://0013-sha256.h-avoid-inclusion-of-sys-types.h.patch \
             file://0014-add-if_nameindex-from-musl.patch \
-            file://0015-vmcore-dmesg-fix-warning.patch"
+            file://0015-vmcore-dmesg-fix-warning.patch \
+            file://klibc-reboot.patch"
 
 WARNING_FIXES = ""
 FROM_OE_CORE = "file://arm_crashdump-fix-buffer-align.patch \
-- 
2.21.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-15 16:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-15 16:18 [meta-initramfs][PATCH] kexec-tools, kexec: Fix build with latest klibc Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.