summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/kmod
diff options
context:
space:
mode:
authorTing Liu <b28495@freescale.com>2013-09-10 06:00:20 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-14 16:55:24 +0100
commit0f431a3123c399ef0b3ddae5aa85c701bdd0a32a (patch)
tree874a23744c7ff8941a1d95e62ced2bec4768737e /meta/recipes-kernel/kmod
parentf33afade31d2ac2f5457f4131c2c35207606b846 (diff)
downloadast2050-yocto-poky-0f431a3123c399ef0b3ddae5aa85c701bdd0a32a.zip
ast2050-yocto-poky-0f431a3123c399ef0b3ddae5aa85c701bdd0a32a.tar.gz
kmod-native: use bswap to work on older Linux hosts
We can't use htobe* and be*toh functions because they are not available on older versions of glibc, For example, shipped on Centos 5.5. Change to directly calling bswap_* as defined in byteswap.h. (From OE-Core rev: 63edb6b9a8bdf2f5541edd618f2f598185e37223) Signed-off-by: Ting Liu <b28495@freescale.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/kmod')
-rw-r--r--meta/recipes-kernel/kmod/kmod-native_git.bb1
-rw-r--r--meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch39
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-kernel/kmod/kmod-native_git.bb b/meta/recipes-kernel/kmod/kmod-native_git.bb
index f22efc0..d008cbf 100644
--- a/meta/recipes-kernel/kmod/kmod-native_git.bb
+++ b/meta/recipes-kernel/kmod/kmod-native_git.bb
@@ -6,6 +6,7 @@ inherit native
SRC_URI += "file://fix-undefined-O_CLOEXEC.patch \
file://0001-Fix-build-with-older-gcc-4.6.patch \
+ file://Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch \
"
do_install_append (){
diff --git a/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
new file mode 100644
index 0000000..82b83b3
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
@@ -0,0 +1,39 @@
+From 0c4dbadc9db3cda1cfca64e44ea08c6e89919ea7 Mon Sep 17 00:00:00 2001
+From: Ting Liu <b28495@freescale.com>
+Date: Tue, 10 Sep 2013 13:44:18 +0800
+Subject: [PATCH] Change to calling bswap_* instead of htobe* and be*toh
+
+We can't use htobe* and be*toh functions because they are not
+available on older versions of glibc, For example, shipped on Centos 5.5.
+
+Change to directly calling bswap_* as defined in+byteswap.h.
+
+Signed-off-by: Ting Liu <b28495@freescale.com>
+---
+ libkmod/libkmod-signature.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
+index 6b80caa..3544a36 100644
+--- a/libkmod/libkmod-signature.c
++++ b/libkmod/libkmod-signature.c
+@@ -19,6 +19,7 @@
+ */
+
+ #include <endian.h>
++#include <byteswap.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -121,7 +122,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
+ modsig->hash >= PKEY_HASH__LAST ||
+ modsig->id_type >= PKEY_ID_TYPE__LAST)
+ return false;
+- sig_len = be32toh(modsig->sig_len);
++ sig_len = bswap_32(modsig->sig_len);
+ if (size < (off_t)(modsig->signer_len + modsig->key_id_len + sig_len))
+ return false;
+
+--
+1.7.5.4
+
OpenPOWER on IntegriCloud