summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-kernel
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-08-09 16:29:51 -0700
committerKhem Raj <raj.khem@gmail.com>2024-08-10 15:57:57 -0700
commit1dc3523ef21b4764d32e2244660c2b3176877c57 (patch)
treeb11f4b60b03cb6c278e19a3fadcbc46a98516add /meta-oe/recipes-kernel
parent4642c541c4f4f368941ce3956ad47c787bfb2a35 (diff)
downloadmeta-openembedded-1dc3523ef21b4764d32e2244660c2b3176877c57.tar.gz
turbostat: Add band-aid to build from 6.10+ kernel
Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'meta-oe/recipes-kernel')
-rw-r--r--meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb18
1 files changed, 17 insertions, 1 deletions
diff --git a/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb b/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb
index 4770fae50e..cfe3bb9682 100644
--- a/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb
+++ b/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb
@@ -33,7 +33,7 @@ do_populate_lic[depends] = "${PN}:do_configure"
33 33
34 34
35EXTRA_OEMAKE = '\ 35EXTRA_OEMAKE = '\
36 CC="${CC}" 'CFLAGS=-Wall ${LDFLAGS}' \ 36 CC="${CC}" 'CFLAGS=-Wall ${LDFLAGS}' \
37 ' 37 '
38 38
39# If we build under STAGING_KERNEL_DIR, source will not be put 39# If we build under STAGING_KERNEL_DIR, source will not be put
@@ -52,12 +52,21 @@ do_configure:prepend() {
52 cp -r ${STAGING_KERNEL_DIR}/include/linux/bits.h ${S} 52 cp -r ${STAGING_KERNEL_DIR}/include/linux/bits.h ${S}
53 cp -r ${STAGING_KERNEL_DIR}/include/linux/const.h ${S} 53 cp -r ${STAGING_KERNEL_DIR}/include/linux/const.h ${S}
54 fi 54 fi
55 if [ -f "${STAGING_KERNEL_DIR}/tools/include/linux/build_bug.h" ]; then
56 cp -r ${STAGING_KERNEL_DIR}/tools/include/linux/build_bug.h ${S}
57 fi
58 cp -r ${STAGING_KERNEL_DIR}/tools/include/linux/compiler.h ${S}
59 cp -r ${STAGING_KERNEL_DIR}/tools/include/linux/compiler_types.h ${S}
60 cp -r ${STAGING_KERNEL_DIR}/tools/include/linux/compiler-gcc.h ${S}
55 cp -r ${STAGING_KERNEL_DIR}/tools/power/x86/turbostat/* ${S} 61 cp -r ${STAGING_KERNEL_DIR}/tools/power/x86/turbostat/* ${S}
56} 62}
57 63
58 64
59do_compile() { 65do_compile() {
60 sed -i 's#<linux/bits.h>#"bits.h"#' msr-index.h 66 sed -i 's#<linux/bits.h>#"bits.h"#' msr-index.h
67 sed -i 's#<linux/compiler.h>#"compiler.h"#' build_bug.h
68 sed -i 's#<linux/compiler_types.h>#"compiler_types.h"#' compiler.h
69 sed -i 's#<linux/compiler-gcc.h>#"compiler-gcc.h"#' compiler_types.h
61 'TMPCHECK='grep "<vdso/const.h>" bits.h'' || true 70 'TMPCHECK='grep "<vdso/const.h>" bits.h'' || true
62 if [ -n $TMPCHECK ]; then 71 if [ -n $TMPCHECK ]; then
63 sed -i 's#<vdso/const.h>#"const.h"#' bits.h 72 sed -i 's#<vdso/const.h>#"const.h"#' bits.h
@@ -66,8 +75,15 @@ do_compile() {
66 sed -i 's#<linux/const.h>#"const.h"#' bits.h 75 sed -i 's#<linux/const.h>#"const.h"#' bits.h
67 sed -i -e 's#<uapi/linux/const.h>#<linux/const.h>#' -e 's#_LINUX_CONST_H#_LINUX_CONST_H_KERNEL#' const.h 76 sed -i -e 's#<uapi/linux/const.h>#<linux/const.h>#' -e 's#_LINUX_CONST_H#_LINUX_CONST_H_KERNEL#' const.h
68 fi 77 fi
78 echo '#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))' >> msr-index.h
79 echo "#define BIT(x) (1 << (x))" > bits.h
80 echo "#define BIT_ULL(nr) (1ULL << (nr))" >> bits.h
81 echo "#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (sizeof(long) * 8 - 1 - (h))))" >> bits.h
82 echo "#define GENMASK_ULL(h, l) (((~0ULL) << (l)) & (~0ULL >> (sizeof(long long) * 8 - 1 - (h))))" >> bits.h
83
69 sed -i 's#MSRHEADER#"msr-index.h"#' turbostat.c 84 sed -i 's#MSRHEADER#"msr-index.h"#' turbostat.c
70 sed -i 's#INTEL_FAMILY_HEADER#"intel-family.h"#' turbostat.c 85 sed -i 's#INTEL_FAMILY_HEADER#"intel-family.h"#' turbostat.c
86 sed -i 's#BUILD_BUG_HEADER#"build_bug.h"#' turbostat.c
71 sed -i 's#\$(CC) \$(CFLAGS) \$< -o \$(BUILD_OUTPUT)/\$@#\$(CC) \$(CFLAGS) \$(LDFLAGS) \$< -o \$(BUILD_OUTPUT)/\$@#' Makefile 87 sed -i 's#\$(CC) \$(CFLAGS) \$< -o \$(BUILD_OUTPUT)/\$@#\$(CC) \$(CFLAGS) \$(LDFLAGS) \$< -o \$(BUILD_OUTPUT)/\$@#' Makefile
72 oe_runmake STAGING_KERNEL_DIR=${STAGING_KERNEL_DIR} 88 oe_runmake STAGING_KERNEL_DIR=${STAGING_KERNEL_DIR}
73} 89}