From f6c8d35c9dd595a8b583831716db3d01f4bc80d1bd2d8a2ee2d2bc3c253e9778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Fri, 14 Apr 2023 08:08:17 +0000 Subject: [PATCH] Accepting request 1079296 from home:olh:branches:Kernel:kdump - Update kexec-tools-SYS_getrandom.patch to fix build errors on old x86_64 distributions OBS-URL: https://build.opensuse.org/request/show/1079296 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kexec-tools?expand=0&rev=155 --- kexec-tools-SYS_getrandom.patch | 43 +++++++++++++++++++++++++++++++-- kexec-tools.changes | 6 +++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/kexec-tools-SYS_getrandom.patch b/kexec-tools-SYS_getrandom.patch index e302f7f..8e831b2 100644 --- a/kexec-tools-SYS_getrandom.patch +++ b/kexec-tools-SYS_getrandom.patch @@ -6,9 +6,21 @@ SLE12 did not provide a definition for SYS_getrandom. Signed-off-by: Petr Tesarik --- - kexec/arch/arm64/kexec-arm64.c | 5 +++++ - 1 file changed, 5 insertions(+) + configure.ac | 1 + + kexec/arch/arm64/kexec-arm64.c | 5 +++++ + kexec/arch/i386/x86-linux-setup.c | 11 ++++++++++- + 3 files changed, 16 insertions(+), 1 deletion(-) +--- a/configure.ac ++++ b/configure.ac +@@ -203,6 +203,7 @@ if test "$with_xen" = dl ; then + AC_MSG_NOTICE([Xen support disabled]))]) + fi + ++AC_CHECK_HEADERS([sys/random.h]) + dnl Check for the Xen kexec_status hypercall - reachable from --with-xen=yes|dl + if test "$ac_cv_lib_xenctrl_xc_kexec_load" = yes ; then + AC_CHECK_LIB(xenctrl, xc_kexec_status, --- a/kexec/arch/arm64/kexec-arm64.c +++ b/kexec/arch/arm64/kexec-arm64.c @@ -34,6 +34,11 @@ @@ -23,3 +35,30 @@ Signed-off-by: Petr Tesarik #define ROOT_NODE_ADDR_CELLS_DEFAULT 1 #define ROOT_NODE_SIZE_CELLS_DEFAULT 1 +--- a/kexec/arch/i386/x86-linux-setup.c ++++ b/kexec/arch/i386/x86-linux-setup.c +@@ -24,7 +24,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -38,6 +37,16 @@ + #include "x86-linux-setup.h" + #include "../../kexec/kexec-syscall.h" + ++#ifdef HAVE_SYS_RANDOM_H ++#include ++#else ++#include ++static ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) ++{ ++ return syscall(SYS_getrandom, buf, buflen, flags); ++} ++#endif ++ + #ifndef VIDEO_CAPABILITY_64BIT_BASE + #define VIDEO_CAPABILITY_64BIT_BASE (1 << 1) /* Frame buffer base is 64-bit */ + #endif diff --git a/kexec-tools.changes b/kexec-tools.changes index 3baf53f..fd46b0f 100644 --- a/kexec-tools.changes +++ b/kexec-tools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Apr 4 04:04:04 UTC 2023 - olaf@aepfle.de + +- Update kexec-tools-SYS_getrandom.patch to fix build errors on + old x86_64 distributions + ------------------------------------------------------------------- Thu Feb 23 15:01:24 UTC 2023 - Michal Suchanek