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