summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-wrs_git.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/linux/linux-wrs_git.bb')
-rw-r--r--meta/recipes-kernel/linux/linux-wrs_git.bb147
1 files changed, 147 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-wrs_git.bb b/meta/recipes-kernel/linux/linux-wrs_git.bb
new file mode 100644
index 0000000000..eaa8e4447d
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-wrs_git.bb
@@ -0,0 +1,147 @@
1DESCRIPTION = "Wind River Kernel"
2SECTION = "kernel"
3LICENSE = "GPL"
4
5# Set this to 'preempt_rt' in the local.conf if you want a real time kernel
6LINUX_KERNEL_TYPE ?= standard
7SRCREV_FORMAT = "meta_machine"
8PV = "2.6.34+git${SRCPV}"
9
10# To use a staged, on-disk bare clone of a Wind River Kernel, use a
11# variant of the below
12# SRC_URI = "git://///path/to/kernel/default_kernel.git;fullclone=1"
13SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;fullclone=1;branch=${WRMACHINE}-${LINUX_KERNEL_TYPE};name=machine \
14 git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;noclone=1;branch=wrs_meta;name=meta"
15
16SRC_URI_append_qemux86-64 = "\
17 file://connect-size.patch \
18 file://qemux86-64.cfg"
19
20
21WRMACHINE = "${MACHINE}"
22WRMACHINE_qemux86 = "common_pc"
23WRMACHINE_qemux86-64 = "common_pc_64"
24WRMACHINE_qemuppc = "qemu_ppc32"
25WRMACHINE_qemumips = "mti_malta32_be"
26WRMACHINE_qemuarm = "arm_versatile_926ejs"
27
28COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemux86-64)"
29
30LINUX_VERSION = "v2.6.34"
31LINUX_VERSION_EXTENSION = "-wr-${LINUX_KERNEL_TYPE}"
32PR = "r6"
33
34S = "${WORKDIR}/linux"
35B = "${WORKDIR}/linux-${WRMACHINE}-${LINUX_KERNEL_TYPE}-build"
36
37do_patch() {
38 cd ${S}
39 if [ -f ${WORKDIR}/defconfig ]; then
40 defconfig=${WORKDIR}/defconfig
41 fi
42
43 createme ${ARCH} ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${defconfig}
44 if [ $? -ne 0 ]; then
45 echo "ERROR. Could not create ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
46 exit 1
47 fi
48
49 updateme ${WORKDIR}
50 if [ $? -ne 0 ]; then
51 echo "ERROR. Could not update ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
52 exit 1
53 fi
54
55 patchme ${WRMACHINE}-${LINUX_KERNEL_TYPE}
56 if [ $? -ne 0 ]; then
57 echo "ERROR. Could not modify ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
58 exit 1
59 fi
60}
61
62do_wrlinux_checkout() {
63 if [ -d ${WORKDIR}/.git/refs/remotes/origin ]; then
64 echo "Fixing up git directory for ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
65 rm -rf ${S}
66 mkdir ${S}
67 mv ${WORKDIR}/.git ${S}
68
69 if [ -e ${S}/.git/packed-refs ]; then
70 cd ${S}
71 rm -f .git/refs/remotes/origin/HEAD
72IFS='
73';
74
75 for r in `git show-ref | grep remotes`; do
76 ref=`echo $r | cut -d' ' -f1`;
77 b=`echo $r | cut -d'/' -f4`;
78 echo $ref > .git/refs/heads/$b
79 done
80 cd ..
81 else
82 mv ${S}/.git/refs/remotes/origin/* ${S}/.git/refs/heads
83 rmdir ${S}/.git/refs/remotes/origin
84 fi
85 fi
86 cd ${S}
87 git checkout -f ${WRMACHINE}-${LINUX_KERNEL_TYPE}
88}
89
90addtask wrlinux_checkout before do_patch after do_unpack
91
92do_wrlinux_configme() {
93 echo "Doing wrlinux configme"
94
95 cd ${S}
96 configme --reconfig
97 if [ $? -ne 0 ]; then
98 echo "ERROR. Could not configure ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
99 exit 1
100 fi
101
102 echo "# CONFIG_WRNOTE is not set" >> ${B}/.config
103 echo "# Global settings from linux recipe" >> ${B}/.config
104 echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
105}
106
107do_wrlinux_configcheck() {
108 echo "[INFO] validating kernel configuration"
109 cd ${B}/..
110 kconf_check ${B}/.config ${B} ${S} ${B} ${LINUX_VERSION} ${WRMACHINE}-${LINUX_KERNEL_TYPE}
111}
112
113do_wrlinux_link_vmlinux() {
114 cd ${B}/arch/${ARCH}/boot
115 ln -sf ../../../vmlinux
116}
117
118do_compile_perf() {
119 oe_runmake -C ${S}/tools/perf CC="${KERNEL_CC}" LD="${KERNEL_LD}" prefix=${prefix}
120}
121
122do_install_perf() {
123 oe_runmake -C ${S}/tools/perf CC="${KERNEL_CC}" LD="${KERNEL_LD}" prefix=${prefix} DESTDIR=${D} install
124}
125
126do_patch[depends] = "kern-tools-native:do_populate_sysroot"
127addtask wrlinux_configme before do_configure after do_patch
128addtask wrlinux_link_vmlinux after do_compile before do_install
129addtask wrlinux_configcheck after do_configure before do_compile
130
131inherit kernel
132
133# perf subpackage variables
134PROVIDES += perf
135
136PACKAGES =+ "perf"
137FILES_perf = "${bindir}/* \
138 ${libexecdir}"
139
140
141# perf tasks
142addtask compile_perf after do_compile before do_install
143addtask install_perf after do_install before do_package do_deploy
144
145do_compile_perf[depends] = "virtual/libc:do_populate_sysroot"
146do_compile_perf[depends] =+ "elfutils:do_populate_sysroot"
147RDEPENDS_perf += "python perl"