summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Suvorov <oleksandr.suvorov@toradex.com>2020-05-20 11:11:22 +0300
committerOleksandr Suvorov <oleksandr.suvorov@toradex.com>2020-05-20 17:38:54 +0300
commit2a75820e130e36382a2d6c592afdbc145cea3c5a (patch)
tree58c15bfe39faa3163fd87a94b3ddf110ffc74e2e
parentce34d815ef6be7cd30c173e8305ec9cdc39f06ff (diff)
backports: fix recipe building
Tune the recipe to build the backports-5.4 with rocko successfully. Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
-rw-r--r--recipes-kernel/backports/backports_5.4.bb11
-rw-r--r--recipes-kernel/backports/files/makefile.patch24
2 files changed, 31 insertions, 4 deletions
diff --git a/recipes-kernel/backports/backports_5.4.bb b/recipes-kernel/backports/backports_5.4.bb
index efa8436..a6c4bd7 100644
--- a/recipes-kernel/backports/backports_5.4.bb
+++ b/recipes-kernel/backports/backports_5.4.bb
@@ -20,6 +20,7 @@ SRCREV = "e8ef623db4bd6fb85df341d583000e1b12a64a63"
SRCREV_use-head-next = "${AUTOREV}"
SRC_URI = " \
git://git.toradex.com/backports-toradex.git;protocol=git;branch=toradex-${PV} \
+ file://makefile.patch \
file://config \
file://${DEPMOD_CONF} \
"
@@ -32,17 +33,19 @@ DEPENDS += "bison-native coreutils-native flex-native"
S = "${WORKDIR}/git"
EXTRA_OEMAKE = " \
- KLIB_BUILD=${KBUILD_OUTPUT} \
- KLIB=${B} \
+ KLIB_BUILD=${STAGING_KERNEL_BUILDDIR} \
+ KLIB=${STAGING_KERNEL_DIR} \
"
do_configure() {
# Somehow lex does not automatically get linked to flex!
ln -fs flex ../recipe-sysroot-native/usr/bin/lex
- make CFLAGS="" CPPFLAGS="" CXXFLAGS="" LDFLAGS="" CC="${BUILD_CC}" LD="${BUILD_LD}" \
- AR="${BUILD_AR}" -C ${S}/kconf O=${S}/kconf conf
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ make CC="${BUILD_CC}" LD="${BUILD_LD}" AR="${BUILD_AR}" \
+ -C ${S}/kconf O=${S}/kconf conf
cp ${WORKDIR}/config ${S}/.config
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
oe_runmake oldconfig
}
diff --git a/recipes-kernel/backports/files/makefile.patch b/recipes-kernel/backports/files/makefile.patch
new file mode 100644
index 0000000..4023570
--- /dev/null
+++ b/recipes-kernel/backports/files/makefile.patch
@@ -0,0 +1,24 @@
+commit 9e0b7ead828993280955f71afa3ad689f5e6e0a8
+Author: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
+Date: Wed May 20 10:56:56 2020 +0300
+
+ Makefile: fix getting kernel version
+
+ When backports build as a recipe, there is no Makefile available
+ in STAGING_KERNEL_BUILDDIR. Instead use the preset KERNEL_VERSION.
+
+ Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
+
+diff --git a/Makefile b/Makefile
+index ee7df4ba..11044c0a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -84,7 +84,7 @@ mrproper:
+ echo "" ;\
+ done \
+ ) > Kconfig.kernel ;\
+- kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \
++ kver=$$(echo $(KERNEL_VERSION) | \
+ sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\
+ test "$$kver" != "" || echo "Kernel version parse failed!" ;\
+ test "$$kver" != "" ;\