diff options
author | ToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp> | 2020-03-30 09:24:26 +0900 |
---|---|---|
committer | ToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp> | 2020-03-30 09:24:26 +0900 |
commit | 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd (patch) | |
tree | b4bb18dcd1487dbf1ea8127e5671b7bb2eded033 /external/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/arm64_kexec-arm64.c-workaround-for-getrandom-syscall.patch | |
parent | 706ad73eb02caf8532deaf5d38995bd258725cb8 (diff) |
agl-basesystem
Diffstat (limited to 'external/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/arm64_kexec-arm64.c-workaround-for-getrandom-syscall.patch')
-rw-r--r-- | external/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/arm64_kexec-arm64.c-workaround-for-getrandom-syscall.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/external/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/arm64_kexec-arm64.c-workaround-for-getrandom-syscall.patch b/external/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/arm64_kexec-arm64.c-workaround-for-getrandom-syscall.patch new file mode 100644 index 00000000..b22ac3ac --- /dev/null +++ b/external/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/arm64_kexec-arm64.c-workaround-for-getrandom-syscall.patch @@ -0,0 +1,61 @@ +From 10afeecd10499fbd64b2c68d3b076c6906df441f Mon Sep 17 00:00:00 2001 +From: Andrea Adami <andrea.adami@gmail.com> +Date: Wed, 5 Sep 2018 17:07:48 +0200 +Subject: [PATCH] kexec-arm64.c: workaround for getrandom() syscall + +The syscall was added to OE's klibc. +Fix + +| ../git/kexec/arch/arm64/kexec-arm64.c:19:10: fatal error: syscall.h: No such file or directory +| #include <syscall.h> + +and + +| ../git/kexec/arch/arm64/kexec-arm64.c: In function 'setup_2nd_dtb': +| ../git/kexec/arch/arm64/kexec-arm64.c:499:12: warning: implicit declaration of function 'getrandom'; did you mean 'srandom'? [-Wimplicit-function-declaration] +| result = getrandom(&fdt_val64, + + +Upstream-Status: Inappropriate [klibc specific] +Signed-off-by: Andrea Adami <andrea.adami@gmail.com> +--- + kexec/arch/arm64/kexec-arm64.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c +index 7a12479..8a7f5c5 100644 +--- a/kexec/arch/arm64/kexec-arm64.c ++++ b/kexec/arch/arm64/kexec-arm64.c +@@ -16,7 +16,11 @@ + #include <elf.h> + + #include <unistd.h> ++ ++#ifndef __KLIBC__ + #include <syscall.h> ++#endif ++ + #include <errno.h> + #include <linux/random.h> + +@@ -487,10 +491,16 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line, int on_crash) + * have a valid random seed to pass to the + * secondary kernel. + */ ++#ifndef __KLIBC__ + result = syscall(SYS_getrandom, &fdt_val64, + sizeof(fdt_val64), + GRND_NONBLOCK); +- ++#else ++ extern ssize_t getrandom(void *, size_t, unsigned int); ++ result = getrandom(&fdt_val64, ++ sizeof(fdt_val64), ++ GRND_NONBLOCK); ++#endif + if(result == -1) { + dbgprintf("%s: Reading random bytes failed.\n", + __func__); +-- +2.7.4 + |