summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/turbostat/turbostat.bb
blob: 6c927c5aeca0893277dca0a06aa75f866e438a4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
SUMMARY = "Report processor frequency and idle statistics"
DESCRIPTION = "turbostat  reports processor topology, frequency, idle \
power-state statistics, temperature and power on modern X86 processors. \
Either command is forked and statistics are printed upon its completion, \
or statistics are printed periodically."

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

DEPENDS = "virtual/kernel"
PROVIDES = "virtual/turbostat"

inherit linux-kernel-base

do_populate_lic[depends] += "virtual/kernel:do_populate_sysroot"

S = "${STAGING_KERNEL_DIR}"
# The source should be ready after the do_unpack
do_unpack[depends] += "virtual/kernel:do_populate_sysroot"

B = "${WORKDIR}/${BPN}-${PV}"

EXTRA_OEMAKE = '\
    -C ${S}/tools/power/x86/turbostat \
    O=${B} \
    CROSS_COMPILE=${TARGET_PREFIX} \
    ARCH=${ARCH} \
    CC="${CC}" \
    AR="${AR}" \
'

EXTRA_OEMAKE += "\
    'prefix=${prefix}' \
    'bindir=${bindir}' \
    'sharedir=${datadir}' \
    'sysconfdir=${sysconfdir}' \
    'sharedir=${@os.path.relpath(datadir, prefix)}' \
    'mandir=${@os.path.relpath(mandir, prefix)}' \
    'infodir=${@os.path.relpath(infodir, prefix)}' \
"

do_compile() {
	# Linux kernel build system is expected to do the right thing
	unset CFLAGS
	oe_runmake turbostat
}

do_install() {
	# Linux kernel build system is expected to do the right thing
	unset CFLAGS
	oe_runmake DESTDIR=${D} install
}

python do_package_prepend() {
    bb.data.setVar('PKGV', get_kernelversion('${S}').split("-")[0], d)
}