diff options
Diffstat (limited to 'meta/recipes-kernel/linux/linux-wrs_git.bb')
-rw-r--r-- | meta/recipes-kernel/linux/linux-wrs_git.bb | 147 |
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 @@ | |||
1 | DESCRIPTION = "Wind River Kernel" | ||
2 | SECTION = "kernel" | ||
3 | LICENSE = "GPL" | ||
4 | |||
5 | # Set this to 'preempt_rt' in the local.conf if you want a real time kernel | ||
6 | LINUX_KERNEL_TYPE ?= standard | ||
7 | SRCREV_FORMAT = "meta_machine" | ||
8 | PV = "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" | ||
13 | SRC_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 | |||
16 | SRC_URI_append_qemux86-64 = "\ | ||
17 | file://connect-size.patch \ | ||
18 | file://qemux86-64.cfg" | ||
19 | |||
20 | |||
21 | WRMACHINE = "${MACHINE}" | ||
22 | WRMACHINE_qemux86 = "common_pc" | ||
23 | WRMACHINE_qemux86-64 = "common_pc_64" | ||
24 | WRMACHINE_qemuppc = "qemu_ppc32" | ||
25 | WRMACHINE_qemumips = "mti_malta32_be" | ||
26 | WRMACHINE_qemuarm = "arm_versatile_926ejs" | ||
27 | |||
28 | COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemux86-64)" | ||
29 | |||
30 | LINUX_VERSION = "v2.6.34" | ||
31 | LINUX_VERSION_EXTENSION = "-wr-${LINUX_KERNEL_TYPE}" | ||
32 | PR = "r6" | ||
33 | |||
34 | S = "${WORKDIR}/linux" | ||
35 | B = "${WORKDIR}/linux-${WRMACHINE}-${LINUX_KERNEL_TYPE}-build" | ||
36 | |||
37 | do_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 | |||
62 | do_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 | ||
72 | IFS=' | ||
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 | |||
90 | addtask wrlinux_checkout before do_patch after do_unpack | ||
91 | |||
92 | do_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 | |||
107 | do_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 | |||
113 | do_wrlinux_link_vmlinux() { | ||
114 | cd ${B}/arch/${ARCH}/boot | ||
115 | ln -sf ../../../vmlinux | ||
116 | } | ||
117 | |||
118 | do_compile_perf() { | ||
119 | oe_runmake -C ${S}/tools/perf CC="${KERNEL_CC}" LD="${KERNEL_LD}" prefix=${prefix} | ||
120 | } | ||
121 | |||
122 | do_install_perf() { | ||
123 | oe_runmake -C ${S}/tools/perf CC="${KERNEL_CC}" LD="${KERNEL_LD}" prefix=${prefix} DESTDIR=${D} install | ||
124 | } | ||
125 | |||
126 | do_patch[depends] = "kern-tools-native:do_populate_sysroot" | ||
127 | addtask wrlinux_configme before do_configure after do_patch | ||
128 | addtask wrlinux_link_vmlinux after do_compile before do_install | ||
129 | addtask wrlinux_configcheck after do_configure before do_compile | ||
130 | |||
131 | inherit kernel | ||
132 | |||
133 | # perf subpackage variables | ||
134 | PROVIDES += perf | ||
135 | |||
136 | PACKAGES =+ "perf" | ||
137 | FILES_perf = "${bindir}/* \ | ||
138 | ${libexecdir}" | ||
139 | |||
140 | |||
141 | # perf tasks | ||
142 | addtask compile_perf after do_compile before do_install | ||
143 | addtask install_perf after do_install before do_package do_deploy | ||
144 | |||
145 | do_compile_perf[depends] = "virtual/libc:do_populate_sysroot" | ||
146 | do_compile_perf[depends] =+ "elfutils:do_populate_sysroot" | ||
147 | RDEPENDS_perf += "python perl" | ||