2010-06-18 05:09:42 +00:00
|
|
|
DESCRIPTION = "Wind River Kernel"
|
|
|
|
SECTION = "kernel"
|
|
|
|
LICENSE = "GPL"
|
|
|
|
|
|
|
|
# Set this to 'preempt_rt' in the local.conf if you want a real time kernel
|
|
|
|
LINUX_KERNEL_TYPE ?= standard
|
2010-08-13 10:13:48 +00:00
|
|
|
SRCREV_FORMAT = "meta_machine"
|
2010-06-18 05:09:42 +00:00
|
|
|
PV = "2.6.34+git${SRCPV}"
|
|
|
|
|
|
|
|
# To use a staged, on-disk bare clone of a Wind River Kernel, use a
|
|
|
|
# variant of the below
|
|
|
|
# SRC_URI = "git://///path/to/kernel/default_kernel.git;fullclone=1"
|
2010-08-13 10:13:48 +00:00
|
|
|
SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;fullclone=1;branch=${WRMACHINE}-${LINUX_KERNEL_TYPE};name=machine \
|
|
|
|
git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;noclone=1;branch=wrs_meta;name=meta"
|
2010-08-13 15:10:55 +00:00
|
|
|
|
2010-07-23 21:32:49 +00:00
|
|
|
WRMACHINE = "${MACHINE}"
|
2010-06-18 05:09:42 +00:00
|
|
|
WRMACHINE_qemux86 = "common_pc"
|
2010-07-26 18:03:45 +00:00
|
|
|
WRMACHINE_qemux86-64 = "common_pc_64"
|
2010-06-18 05:09:42 +00:00
|
|
|
WRMACHINE_qemuppc = "qemu_ppc32"
|
|
|
|
WRMACHINE_qemumips = "mti_malta32_be"
|
|
|
|
WRMACHINE_qemuarm = "arm_versatile_926ejs"
|
|
|
|
|
2010-08-13 15:10:55 +00:00
|
|
|
COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemux86-64)"
|
2010-07-21 21:48:16 +00:00
|
|
|
|
2010-07-23 21:32:49 +00:00
|
|
|
LINUX_VERSION = "v2.6.34"
|
|
|
|
LINUX_VERSION_EXTENSION = "-wr-${LINUX_KERNEL_TYPE}"
|
2010-08-13 15:10:55 +00:00
|
|
|
PR = "r6"
|
2010-06-18 05:09:42 +00:00
|
|
|
|
|
|
|
S = "${WORKDIR}/linux"
|
|
|
|
B = "${WORKDIR}/linux-${WRMACHINE}-${LINUX_KERNEL_TYPE}-build"
|
|
|
|
|
2010-09-09 03:18:59 +00:00
|
|
|
# functionality flags
|
|
|
|
force_revisions = "t"
|
|
|
|
|
2010-06-18 05:09:42 +00:00
|
|
|
do_patch() {
|
2010-07-23 16:58:21 +00:00
|
|
|
cd ${S}
|
|
|
|
if [ -f ${WORKDIR}/defconfig ]; then
|
|
|
|
defconfig=${WORKDIR}/defconfig
|
|
|
|
fi
|
|
|
|
|
2010-08-13 14:16:58 +00:00
|
|
|
createme ${ARCH} ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${defconfig}
|
2010-07-23 16:58:21 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "ERROR. Could not create ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
updateme ${WORKDIR}
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "ERROR. Could not update ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
patchme ${WRMACHINE}-${LINUX_KERNEL_TYPE}
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "ERROR. Could not modify ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
|
|
|
|
exit 1
|
|
|
|
fi
|
2010-06-18 05:09:42 +00:00
|
|
|
}
|
|
|
|
|
2010-09-09 03:18:59 +00:00
|
|
|
validate_branches() {
|
|
|
|
branch_head=`git show-ref -s --heads ${WRMACHINE}-${LINUX_KERNEL_TYPE}`
|
|
|
|
meta_head=`git show-ref -s --heads wrs_meta`
|
|
|
|
target_branch_head="${SRCREV_pn-linux-wrs_machine}"
|
|
|
|
target_meta_head="${SRCREV_pn-linux-wrs_meta}"
|
|
|
|
|
|
|
|
if [ -n "$target_branch_head" ] && [ "$branch_head" != "$target_branch_head" ]; then
|
|
|
|
if [ -n "${force_revisions}" ]; then
|
|
|
|
echo "Forcing branch ${WRMACHINE}-${LINUX_KERNEL_TYPE} to ${target_branch_head}"
|
|
|
|
git branch -m ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${WRMACHINE}-${LINUX_KERNEL_TYPE}-orig
|
|
|
|
git checkout -b ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${target_branch_head}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$meta_head" != "$target_meta_head" ]; then
|
|
|
|
if [ -n "${force_revisions}" ]; then
|
|
|
|
echo "Forcing branch wrs_meta to ${target_meta_head}"
|
|
|
|
git branch -m wrs_meta wrs_meta-orig
|
|
|
|
git checkout -b wrs_meta ${target_meta_head}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2010-06-18 05:09:42 +00:00
|
|
|
do_wrlinux_checkout() {
|
|
|
|
if [ -d ${WORKDIR}/.git/refs/remotes/origin ]; then
|
|
|
|
echo "Fixing up git directory for ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
|
|
|
|
rm -rf ${S}
|
|
|
|
mkdir ${S}
|
|
|
|
mv ${WORKDIR}/.git ${S}
|
2010-08-19 20:37:03 +00:00
|
|
|
|
|
|
|
if [ -e ${S}/.git/packed-refs ]; then
|
|
|
|
cd ${S}
|
|
|
|
rm -f .git/refs/remotes/origin/HEAD
|
|
|
|
IFS='
|
|
|
|
';
|
|
|
|
|
|
|
|
for r in `git show-ref | grep remotes`; do
|
|
|
|
ref=`echo $r | cut -d' ' -f1`;
|
|
|
|
b=`echo $r | cut -d'/' -f4`;
|
|
|
|
echo $ref > .git/refs/heads/$b
|
|
|
|
done
|
|
|
|
cd ..
|
|
|
|
else
|
|
|
|
mv ${S}/.git/refs/remotes/origin/* ${S}/.git/refs/heads
|
|
|
|
rmdir ${S}/.git/refs/remotes/origin
|
|
|
|
fi
|
2010-06-18 05:09:42 +00:00
|
|
|
fi
|
|
|
|
cd ${S}
|
2010-09-09 03:18:59 +00:00
|
|
|
|
|
|
|
# checkout and clobber and unimportant files
|
|
|
|
git checkout -f ${WRMACHINE}-${LINUX_KERNEL_TYPE}
|
|
|
|
|
|
|
|
validate_branches
|
|
|
|
|
|
|
|
# this second checkout is intentional, we want to leave ourselves
|
|
|
|
# on the branch to be built, but validate_branches could have changed
|
|
|
|
# our initial checkout. So we do it a second time to be sure
|
2010-06-18 05:09:42 +00:00
|
|
|
git checkout -f ${WRMACHINE}-${LINUX_KERNEL_TYPE}
|
|
|
|
}
|
2010-09-06 22:18:28 +00:00
|
|
|
do_wrlinux_checkout[dirs] = "${S}"
|
2010-06-18 05:09:42 +00:00
|
|
|
|
|
|
|
addtask wrlinux_checkout before do_patch after do_unpack
|
|
|
|
|
|
|
|
do_wrlinux_configme() {
|
|
|
|
echo "Doing wrlinux configme"
|
2010-07-23 16:58:21 +00:00
|
|
|
|
2010-06-18 05:09:42 +00:00
|
|
|
cd ${S}
|
2010-07-23 16:58:21 +00:00
|
|
|
configme --reconfig
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "ERROR. Could not configure ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2010-06-18 05:09:42 +00:00
|
|
|
echo "# CONFIG_WRNOTE is not set" >> ${B}/.config
|
|
|
|
echo "# Global settings from linux recipe" >> ${B}/.config
|
|
|
|
echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
|
|
|
|
}
|
|
|
|
|
|
|
|
do_wrlinux_configcheck() {
|
|
|
|
echo "[INFO] validating kernel configuration"
|
|
|
|
cd ${B}/..
|
|
|
|
kconf_check ${B}/.config ${B} ${S} ${B} ${LINUX_VERSION} ${WRMACHINE}-${LINUX_KERNEL_TYPE}
|
|
|
|
}
|
|
|
|
|
|
|
|
do_wrlinux_link_vmlinux() {
|
2010-06-24 19:00:48 +00:00
|
|
|
cd ${B}/arch/${ARCH}/boot
|
|
|
|
ln -sf ../../../vmlinux
|
2010-06-18 05:09:42 +00:00
|
|
|
}
|
|
|
|
|
2010-08-05 20:38:23 +00:00
|
|
|
do_compile_perf() {
|
|
|
|
oe_runmake -C ${S}/tools/perf CC="${KERNEL_CC}" LD="${KERNEL_LD}" prefix=${prefix}
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install_perf() {
|
|
|
|
oe_runmake -C ${S}/tools/perf CC="${KERNEL_CC}" LD="${KERNEL_LD}" prefix=${prefix} DESTDIR=${D} install
|
|
|
|
}
|
|
|
|
|
2010-08-18 10:49:21 +00:00
|
|
|
do_patch[depends] = "kern-tools-native:do_populate_sysroot"
|
2010-06-18 05:09:42 +00:00
|
|
|
addtask wrlinux_configme before do_configure after do_patch
|
|
|
|
addtask wrlinux_link_vmlinux after do_compile before do_install
|
2010-07-23 16:58:21 +00:00
|
|
|
addtask wrlinux_configcheck after do_configure before do_compile
|
2010-06-18 05:09:42 +00:00
|
|
|
|
|
|
|
inherit kernel
|
|
|
|
|
2010-08-05 20:38:23 +00:00
|
|
|
# perf tasks
|
|
|
|
addtask compile_perf after do_compile before do_install
|
2010-08-09 16:21:57 +00:00
|
|
|
addtask install_perf after do_install before do_package do_deploy
|
2010-08-05 20:38:23 +00:00
|
|
|
|
2010-08-09 16:27:05 +00:00
|
|
|
do_compile_perf[depends] = "virtual/libc:do_populate_sysroot"
|
2010-08-05 20:38:23 +00:00
|
|
|
do_compile_perf[depends] =+ "elfutils:do_populate_sysroot"
|
2010-08-09 17:04:09 +00:00
|
|
|
RDEPENDS_perf += "python perl"
|