All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] turbostat: fix the build failure for new v5.7-rc6 kernel
@ 2020-05-22  8:14 Xu, Yanfei
  0 siblings, 0 replies; only message in thread
From: Xu, Yanfei @ 2020-05-22  8:14 UTC (permalink / raw)
  To: raj.khem; +Cc: openembedded-devel

From: Yanfei Xu <yanfei.xu@windriver.com>

Due to the new v5.7-rc6 kernel has some modify in header
files, turbostat build failed. Now match the files.

Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
---
 .../recipes-kernel/turbostat/turbostat_3.4.bb | 20 +++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb b/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb
index 60040a47a..48c72140c 100644
--- a/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb
+++ b/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb
@@ -42,16 +42,28 @@ do_configure_prepend() {
 	mkdir -p ${S}
 	cp -r ${STAGING_KERNEL_DIR}/arch/x86/include/asm/msr-index.h ${S}
 	cp -r ${STAGING_KERNEL_DIR}/arch/x86/include/asm/intel-family.h ${S}
-	cp -r ${STAGING_KERNEL_DIR}/include/linux/bits.h ${S}
-	cp -r ${STAGING_KERNEL_DIR}/include/linux/const.h ${S}
+	if [ -f "${STAGING_KERNEL_DIR}/include/vdso/bits.h" ]; then
+		cp -r ${STAGING_KERNEL_DIR}/include/vdso/bits.h ${S}
+		cp -r ${STAGING_KERNEL_DIR}/include/vdso/const.h ${S}
+	else
+		cp -r ${STAGING_KERNEL_DIR}/include/linux/bits.h ${S}
+		cp -r ${STAGING_KERNEL_DIR}/include/linux/const.h ${S}
+	fi
 	cp -r ${STAGING_KERNEL_DIR}/tools/power/x86/turbostat/* ${S}
 	cp -r ${WORKDIR}/COPYING ${S}
 }
 
+
 do_compile() {
 	sed -i 's#<linux/bits.h>#"bits.h"#' msr-index.h
-	sed -i 's#<linux/const.h>#"const.h"#' bits.h
-	sed -i -e 's#<uapi/linux/const.h>#<linux/const.h>#' -e 's#_LINUX_CONST_H#_LINUX_CONST_H_KERNEL#' const.h
+	'TMPCHECK='grep "<vdso/const.h>" bits.h'' || true
+	if [ -n $TMPCHECK ]; then
+		sed -i 's#<vdso/const.h>#"const.h"#' bits.h
+		sed -i 's#<uapi/linux/const.h>#<linux/const.h>#' const.h
+	else
+		sed -i 's#<linux/const.h>#"const.h"#' bits.h
+		sed -i -e 's#<uapi/linux/const.h>#<linux/const.h>#' -e 's#_LINUX_CONST_H#_LINUX_CONST_H_KERNEL#' const.h
+	fi
 	sed -i 's#MSRHEADER#"msr-index.h"#' turbostat.c
 	sed -i 's#INTEL_FAMILY_HEADER#"intel-family.h"#' turbostat.c
 	sed -i 's#\$(CC) \$(CFLAGS) \$< -o \$(BUILD_OUTPUT)/\$@#\$(CC) \$(CFLAGS) \$(LDFLAGS) \$< -o \$(BUILD_OUTPUT)/\$@#' Makefile
-- 
2.18.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-22  8:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22  8:14 [meta-oe][PATCH] turbostat: fix the build failure for new v5.7-rc6 kernel Xu, Yanfei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.