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
This commit is contained in:
Petr Tesařík 2023-04-14 08:08:17 +00:00 committed by Git OBS Bridge
parent 3d2309cb94
commit f6c8d35c9d
2 changed files with 47 additions and 2 deletions

View File

@ -6,9 +6,21 @@ SLE12 did not provide a definition for SYS_getrandom.
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
---
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 <ptesarik@suse.com>
#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 <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/random.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
@@ -38,6 +37,16 @@
#include "x86-linux-setup.h"
#include "../../kexec/kexec-syscall.h"
+#ifdef HAVE_SYS_RANDOM_H
+#include <sys/random.h>
+#else
+#include <linux/random.h>
+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

View File

@ -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 <msuchanek@suse.com>