From c70816cb9022dfedd78817bb1dfe20219fe2dd90 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Mon, 15 Nov 2010 11:25:58 -0500 Subject: linux-wrs: rename to linux-yocto The existing preferred yocto kernel wasn't named appropriately and needs to be updated. In keeping the changes small and isolated, this commit simply renames the recipe and some internal variables. Future commits will refactor the code into more usable blocks. Now that linuy-wrs has been renamed linux-yocto, we need to rename and update an board configurations and append files. Now that linux-wrs has been renamed linux-yocto, we need to update the SRCREVs to have the new name. Signed-off-by: Bruce Ashfield --- .../linux-libc-headers-wrs_git.bb | 51 ----- .../linux-libc-headers-yocto_git.bb | 51 +++++ meta/recipes-kernel/linux/linux-wrs_git.bb | 222 -------------------- meta/recipes-kernel/linux/linux-yocto_git.bb | 223 +++++++++++++++++++++ 4 files changed, 274 insertions(+), 273 deletions(-) delete mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers-wrs_git.bb create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers-yocto_git.bb delete mode 100644 meta/recipes-kernel/linux/linux-wrs_git.bb create mode 100644 meta/recipes-kernel/linux/linux-yocto_git.bb (limited to 'meta/recipes-kernel') diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers-wrs_git.bb b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers-wrs_git.bb deleted file mode 100644 index ab25e500b..000000000 --- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers-wrs_git.bb +++ /dev/null @@ -1,51 +0,0 @@ -require linux-libc-headers.inc - -INHIBIT_DEFAULT_DEPS = "1" -DEPENDS += "unifdef-native" -PROVIDES = "linux-libc-headers" -PV = "2.6.34+git-${SRCPV}" -PR = "r0" - -SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;fullclone=1" - -S = "${WORKDIR}/linux" - -set_arch() { - case ${TARGET_ARCH} in - arm*) ARCH=arm ;; - i*86*) ARCH=i386 ;; - ia64*) ARCH=ia64 ;; - mips*) ARCH=mips ;; - powerpc*) ARCH=powerpc ;; - x86_64*) ARCH=x86_64 ;; - esac -} - -do_configure() { - set_arch - oe_runmake allnoconfig ARCH=$ARCH -} - -do_wrlinux_checkout() { - if [ -d ${WORKDIR}/.git/refs/remotes/origin ]; then - rm -rf ${S} - mkdir ${S} - mv ${WORKDIR}/.git ${S} - mv ${S}/.git/refs/remotes/origin/* ${S}/.git/refs/heads - rmdir ${S}/.git/refs/remotes/origin - fi - cd ${S} - git checkout -f standard -} - -addtask wrlinux_checkout before do_patch after do_unpack - -do_compile () { -} - -do_install() { - set_arch - oe_runmake headers_install_all INSTALL_HDR_PATH=${D}${exec_prefix} ARCH=$ARCH -} - -BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers-yocto_git.bb b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers-yocto_git.bb new file mode 100644 index 000000000..6ae6d5f64 --- /dev/null +++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers-yocto_git.bb @@ -0,0 +1,51 @@ +require linux-libc-headers.inc + +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS += "unifdef-native" +PROVIDES = "linux-libc-headers" +PV = "2.6.34+git-${SRCPV}" +PR = "r0" + +SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;fullclone=1" + +S = "${WORKDIR}/linux" + +set_arch() { + case ${TARGET_ARCH} in + arm*) ARCH=arm ;; + i*86*) ARCH=i386 ;; + ia64*) ARCH=ia64 ;; + mips*) ARCH=mips ;; + powerpc*) ARCH=powerpc ;; + x86_64*) ARCH=x86_64 ;; + esac +} + +do_configure() { + set_arch + oe_runmake allnoconfig ARCH=$ARCH +} + +do_kernel_checkout() { + if [ -d ${WORKDIR}/.git/refs/remotes/origin ]; then + rm -rf ${S} + mkdir ${S} + mv ${WORKDIR}/.git ${S} + mv ${S}/.git/refs/remotes/origin/* ${S}/.git/refs/heads + rmdir ${S}/.git/refs/remotes/origin + fi + cd ${S} + git checkout -f standard +} + +addtask kernel_checkout before do_patch after do_unpack + +do_compile () { +} + +do_install() { + set_arch + oe_runmake headers_install_all INSTALL_HDR_PATH=${D}${exec_prefix} ARCH=$ARCH +} + +BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-kernel/linux/linux-wrs_git.bb b/meta/recipes-kernel/linux/linux-wrs_git.bb deleted file mode 100644 index 209648b8e..000000000 --- a/meta/recipes-kernel/linux/linux-wrs_git.bb +++ /dev/null @@ -1,222 +0,0 @@ -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 -SRCREV_FORMAT = "meta_machine" -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" -SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;fullclone=1;branch=${KBRANCH};name=machine \ - git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;noclone=1;branch=wrs_meta;name=meta" - -WRMACHINE = "UNDEFINED" -WRMACHINE_qemux86 = "common_pc" -WRMACHINE_qemux86-64 = "common_pc_64" -WRMACHINE_qemuppc = "qemu_ppc32" -WRMACHINE_qemumips = "mti_malta32_be" -WRMACHINE_qemuarm = "arm_versatile_926ejs" -WRMACHINE_atom-pc = "atom-pc" -WRMACHINE_routerstationpro = "routerstationpro" -WRMACHINE_mpc8315e-rdb = "fsl-mpc8315e-rdb" -WRMACHINE_beagleboard = "beagleboard" - -# Determine which branch to fetch and build. Not all branches are in the -# upstream repo (but will be locally created after the fetchers run) so -# a fallback branch needs to be chosen. -# -# The default machine 'UNDEFINED'. If the machine is not set to a specific -# branch in this recipe or in a recipe extension, then we fallback to a -# branch that is always present 'standard'. This sets the KBRANCH variable -# and is used in the SRC_URI. The machine is then set back to ${MACHINE}, -# since futher processing will use that to create local branches -python __anonymous () { - import bb, re - - bb.data.setVar("KBRANCH", "${WRMACHINE}-${LINUX_KERNEL_TYPE}", d) - mach = bb.data.getVar("WRMACHINE", d, 1) - if mach == "UNDEFINED": - bb.data.setVar("KBRANCH", "standard", d) - bb.data.setVar("WRMACHINE", "${MACHINE}", d) - # track the global configuration on a bootstrapped BSP - bb.data.setVar("SRCREV_machine", "${SRCREV_meta}", d) - bb.data.setVar("BOOTSTRAP", "t", d) -} - -COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemux86-64|atom-pc|routerstationpro|mpc8315e-rdb|beagleboard)" - -LINUX_VERSION = "v2.6.34" -LINUX_VERSION_EXTENSION = "-wr-${LINUX_KERNEL_TYPE}" -PR = "r13" - -S = "${WORKDIR}/linux" -B = "${WORKDIR}/linux-${WRMACHINE}-${LINUX_KERNEL_TYPE}-build" - -# functionality flags -KERNEL_REVISION_CHECKING ?= "t" -KERNEL_FEATURES=features/netfilter - -do_patch() { - cd ${S} - if [ -f ${WORKDIR}/defconfig ]; then - defconfig=${WORKDIR}/defconfig - fi - - # simply ensures that a branch of the right name has been created - createme ${ARCH} ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${defconfig} - if [ $? -ne 0 ]; then - echo "ERROR. Could not create ${WRMACHINE}-${LINUX_KERNEL_TYPE}" - exit 1 - fi - - # updates or generates the target description - if [ -n "${KERNEL_FEATURES}" ]; then - addon_features="--features ${KERNEL_FEATURES}" - fi - updateme ${addon_features} ${ARCH} ${WORKDIR} - if [ $? -ne 0 ]; then - echo "ERROR. Could not update ${WRMACHINE}-${LINUX_KERNEL_TYPE}" - exit 1 - fi - - # executes and modifies the source tree as required - patchme ${WRMACHINE}-${LINUX_KERNEL_TYPE} - if [ $? -ne 0 ]; then - echo "ERROR. Could not modify ${WRMACHINE}-${LINUX_KERNEL_TYPE}" - exit 1 - fi -} - -validate_branches() { - branch_head=`git show-ref -s --heads ${KBRANCH}` - meta_head=`git show-ref -s --heads wrs_meta` - target_branch_head="${SRCREV_machine}" - target_meta_head="${SRCREV_meta}" - - if [ -n "$target_branch_head" ] && [ "$branch_head" != "$target_branch_head" ]; then - if [ -n "${KERNEL_REVISION_CHECKING}" ]; then - git show ${target_branch_head} > /dev/null 2>&1 - if [ $? -eq 0 ]; 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} - else - echo "ERROR ${target_branch_head} is not a valid commit ID." - echo "The kernel source tree may be out of sync" - exit 1 - fi - fi - fi - - if [ "$meta_head" != "$target_meta_head" ]; then - if [ -n "${KERNEL_REVISION_CHECKING}" ]; then - git show ${target_meta_head} > /dev/null 2>&1 - if [ $? -eq 0 ]; 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} - else - echo "ERROR ${target_meta_head} is not a valid commit ID" - echo "The kernel source tree may be out of sync" - exit 1 - fi - fi - fi -} - -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} - - 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 - fi - cd ${S} - - # checkout and clobber and unimportant files - git checkout -f ${KBRANCH} - - if [ -z "${BOOTSTRAP}" ]; then - validate_branches - fi - - # 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 - git checkout -f ${KBRANCH} -} -do_wrlinux_checkout[dirs] = "${S}" - -addtask wrlinux_checkout before do_patch after do_unpack - -do_wrlinux_configme() { - echo "Doing wrlinux configme" - - cd ${S} - configme --reconfig - if [ $? -ne 0 ]; then - echo "ERROR. Could not configure ${WRMACHINE}-${LINUX_KERNEL_TYPE}" - exit 1 - fi - - 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() { - if [ ! -d "${B}/arch/${ARCH}/boot" ]; then - mkdir ${B}/arch/${ARCH}/boot - fi - cd ${B}/arch/${ARCH}/boot - ln -sf ../../../vmlinux -} - -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 -} - -do_patch[depends] = "kern-tools-native:do_populate_sysroot" -addtask wrlinux_configme before do_configure after do_patch -addtask wrlinux_link_vmlinux after do_compile before do_install -addtask wrlinux_configcheck after do_configure before do_compile - -inherit kernel - -# perf tasks -addtask compile_perf after do_compile before do_install -addtask install_perf after do_install before do_package do_deploy - -do_compile_perf[depends] = "virtual/libc:do_populate_sysroot" -do_compile_perf[depends] =+ "elfutils:do_populate_sysroot" -RDEPENDS_perf += "python perl elfutils" diff --git a/meta/recipes-kernel/linux/linux-yocto_git.bb b/meta/recipes-kernel/linux/linux-yocto_git.bb new file mode 100644 index 000000000..ef005aefc --- /dev/null +++ b/meta/recipes-kernel/linux/linux-yocto_git.bb @@ -0,0 +1,223 @@ +DESCRIPTION = "Yocto 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 +SRCREV_FORMAT = "meta_machine" +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" +SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;fullclone=1;branch=${KBRANCH};name=machine \ + git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;noclone=1;branch=wrs_meta;name=meta" + +# map the poky machine to a 'kernel machine' +KMACHINE = "UNDEFINED" +KMACHINE_qemux86 = "common_pc" +KMACHINE_qemux86-64 = "common_pc_64" +KMACHINE_qemuppc = "qemu_ppc32" +KMACHINE_qemumips = "mti_malta32_be" +KMACHINE_qemuarm = "arm_versatile_926ejs" +KMACHINE_atom-pc = "atom-pc" +KMACHINE_routerstationpro = "routerstationpro" +KMACHINE_mpc8315e-rdb = "fsl-mpc8315e-rdb" +KMACHINE_beagleboard = "beagleboard" + +# Determine which branch to fetch and build. Not all branches are in the +# upstream repo (but will be locally created after the fetchers run) so +# a fallback branch needs to be chosen. +# +# The default machine 'UNDEFINED'. If the machine is not set to a specific +# branch in this recipe or in a recipe extension, then we fallback to a +# branch that is always present 'standard'. This sets the KBRANCH variable +# and is used in the SRC_URI. The machine is then set back to ${MACHINE}, +# since futher processing will use that to create local branches +python __anonymous () { + import bb, re + + bb.data.setVar("KBRANCH", "${KMACHINE}-${LINUX_KERNEL_TYPE}", d) + mach = bb.data.getVar("KMACHINE", d, 1) + if mach == "UNDEFINED": + bb.data.setVar("KBRANCH", "standard", d) + bb.data.setVar("KMACHINE", "${MACHINE}", d) + # track the global configuration on a bootstrapped BSP + bb.data.setVar("SRCREV_machine", "${SRCREV_meta}", d) + bb.data.setVar("BOOTSTRAP", "t", d) +} + +COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemux86-64|atom-pc|routerstationpro|mpc8315e-rdb|beagleboard)" + +LINUX_VERSION = "v2.6.34" +LINUX_VERSION_EXTENSION = "-wr-${LINUX_KERNEL_TYPE}" +PR = "r13" + +S = "${WORKDIR}/linux" +B = "${WORKDIR}/linux-${KMACHINE}-${LINUX_KERNEL_TYPE}-build" + +# functionality flags +KERNEL_REVISION_CHECKING ?= "t" +KERNEL_FEATURES=features/netfilter + +do_patch() { + cd ${S} + if [ -f ${WORKDIR}/defconfig ]; then + defconfig=${WORKDIR}/defconfig + fi + + # simply ensures that a branch of the right name has been created + createme ${ARCH} ${KMACHINE}-${LINUX_KERNEL_TYPE} ${defconfig} + if [ $? -ne 0 ]; then + echo "ERROR. Could not create ${KMACHINE}-${LINUX_KERNEL_TYPE}" + exit 1 + fi + + # updates or generates the target description + if [ -n "${KERNEL_FEATURES}" ]; then + addon_features="--features ${KERNEL_FEATURES}" + fi + updateme ${addon_features} ${ARCH} ${WORKDIR} + if [ $? -ne 0 ]; then + echo "ERROR. Could not update ${KMACHINE}-${LINUX_KERNEL_TYPE}" + exit 1 + fi + + # executes and modifies the source tree as required + patchme ${KMACHINE}-${LINUX_KERNEL_TYPE} + if [ $? -ne 0 ]; then + echo "ERROR. Could not modify ${KMACHINE}-${LINUX_KERNEL_TYPE}" + exit 1 + fi +} + +validate_branches() { + branch_head=`git show-ref -s --heads ${KBRANCH}` + meta_head=`git show-ref -s --heads wrs_meta` + target_branch_head="${SRCREV_machine}" + target_meta_head="${SRCREV_meta}" + + if [ -n "$target_branch_head" ] && [ "$branch_head" != "$target_branch_head" ]; then + if [ -n "${KERNEL_REVISION_CHECKING}" ]; then + git show ${target_branch_head} > /dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "Forcing branch ${KMACHINE}-${LINUX_KERNEL_TYPE} to ${target_branch_head}" + git branch -m ${KMACHINE}-${LINUX_KERNEL_TYPE} ${KMACHINE}-${LINUX_KERNEL_TYPE}-orig + git checkout -b ${KMACHINE}-${LINUX_KERNEL_TYPE} ${target_branch_head} + else + echo "ERROR ${target_branch_head} is not a valid commit ID." + echo "The kernel source tree may be out of sync" + exit 1 + fi + fi + fi + + if [ "$meta_head" != "$target_meta_head" ]; then + if [ -n "${KERNEL_REVISION_CHECKING}" ]; then + git show ${target_meta_head} > /dev/null 2>&1 + if [ $? -eq 0 ]; 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} + else + echo "ERROR ${target_meta_head} is not a valid commit ID" + echo "The kernel source tree may be out of sync" + exit 1 + fi + fi + fi +} + +do_kernel_checkout() { + if [ -d ${WORKDIR}/.git/refs/remotes/origin ]; then + echo "Fixing up git directory for ${KMACHINE}-${LINUX_KERNEL_TYPE}" + rm -rf ${S} + mkdir ${S} + mv ${WORKDIR}/.git ${S} + + 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 + fi + cd ${S} + + # checkout and clobber and unimportant files + git checkout -f ${KBRANCH} + + if [ -z "${BOOTSTRAP}" ]; then + validate_branches + fi + + # 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 + git checkout -f ${KBRANCH} +} +do_kernel_checkout[dirs] = "${S}" + +addtask kernel_checkout before do_patch after do_unpack + +do_kernel_configme() { + echo "Doing kernel configme" + + cd ${S} + configme --reconfig + if [ $? -ne 0 ]; then + echo "ERROR. Could not configure ${KMACHINE}-${LINUX_KERNEL_TYPE}" + exit 1 + fi + + 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_kernel_configcheck() { + echo "[INFO] validating kernel configuration" + cd ${B}/.. + kconf_check ${B}/.config ${B} ${S} ${B} ${LINUX_VERSION} ${KMACHINE}-${LINUX_KERNEL_TYPE} +} + +do_kernel_link_vmlinux() { + if [ ! -d "${B}/arch/${ARCH}/boot" ]; then + mkdir ${B}/arch/${ARCH}/boot + fi + cd ${B}/arch/${ARCH}/boot + ln -sf ../../../vmlinux +} + +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 +} + +do_patch[depends] = "kern-tools-native:do_populate_sysroot" +addtask kernel_configme before do_configure after do_patch +addtask kernel_link_vmlinux after do_compile before do_install +addtask kernel_configcheck after do_configure before do_compile + +inherit kernel + +# perf tasks +addtask compile_perf after do_compile before do_install +addtask install_perf after do_install before do_package do_deploy + +do_compile_perf[depends] = "virtual/libc:do_populate_sysroot" +do_compile_perf[depends] =+ "elfutils:do_populate_sysroot" +RDEPENDS_perf += "python perl elfutils" -- cgit v1.2.3