Commit c58cc7d3 authored by Koen Kooi's avatar Koen Kooi

move layer into meta-oe in preparation for future splits

As per TSC decision
Signed-off-by: default avatarKoen Kooi <koen@dominion.thruhere.net>
parent eec6ab97
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
From 65780d06117be92941b3c5404dc31597b6807263 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Sun, 23 Jan 2011 10:58:46 +0100
Subject: [PATCH] kernel bbclass: merge in OE improvements for mkimage, PR and initramfs
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
classes/kernel.bbclass | 60 +++++++++++++++++++++++++++++++++++------------
1 files changed, 44 insertions(+), 16 deletions(-)
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index 827046e..d94930b 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -14,8 +14,20 @@ python __anonymous () {
depends = bb.data.getVar("DEPENDS", d, 1)
depends = "%s u-boot-mkimage-native" % depends
bb.data.setVar("DEPENDS", depends, d)
+
+ image = bb.data.getVar('INITRAMFS_IMAGE', d, True)
+ if image != '' and image is not None:
+ bb.data.setVar('INITRAMFS_TASK', '${INITRAMFS_IMAGE}:do_rootfs', d)
+
+ machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True)
+
+ if machine_kernel_pr:
+ bb.data.setVar('PR', machine_kernel_pr, d)
}
+INITRAMFS_IMAGE ?= ""
+INITRAMFS_TASK ?= ""
+
inherit kernel-arch deploy
PACKAGES_DYNAMIC += "kernel-module-*"
@@ -196,8 +208,17 @@ sysroot_stage_all_append() {
kernel_do_configure() {
yes '' | oe_runmake oldconfig
+ if [ ! -z "${INITRAMFS_IMAGE}" ]; then
+ for img in cpio.gz cpio.lzo cpio.lzma; do
+ if [ -e "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" ]; then
+ cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" initramfs.$img
+ fi
+ done
+ fi
}
+kernel_do_configure[depends] += "${INITRAMFS_TASK}"
+
do_menuconfig() {
export TERMWINDOWTITLE="${PN} Kernel Configuration"
export SHELLCMDS="make menuconfig"
@@ -476,6 +497,29 @@ do_sizecheck() {
addtask sizecheck before do_install after do_compile
+do_uboot_mkimage() {
+ if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
+ ENTRYPOINT=${UBOOT_ENTRYPOINT}
+ if test -n "${UBOOT_ENTRYSYMBOL}"; then
+ ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
+ awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
+ fi
+ if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
+ ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
+ uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C none -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage
+ rm -f linux.bin
+ else
+ ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
+ rm -f linux.bin.gz
+ gzip -9 linux.bin
+ uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C gzip -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz arch/${ARCH}/boot/uImage
+ rm -f linux.bin.gz
+ fi
+ fi
+}
+
+addtask uboot_mkimage before do_install after do_compile
+
KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
# Don't include the DATETIME variable in the sstate package signatures
KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
@@ -487,22 +531,6 @@ kernel_do_deploy() {
tar -cvzf ${DEPLOYDIR}/modules-${KERNEL_VERSION}-${PR}-${MACHINE}.tgz -C ${D} lib
fi
- if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
- if test -e arch/${ARCH}/boot/uImage ; then
- cp arch/${ARCH}/boot/uImage ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
- elif test -e arch/${ARCH}/boot/compressed/vmlinux ; then
- ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
- uboot-mkimage -A ${ARCH} -O linux -T kernel -C none -a ${UBOOT_ENTRYPOINT} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
- rm -f linux.bin
- else
- ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
- rm -f linux.bin.gz
- gzip -9 linux.bin
- uboot-mkimage -A ${ARCH} -O linux -T kernel -C gzip -a ${UBOOT_ENTRYPOINT} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
- rm -f linux.bin.gz
- fi
- fi
-
cd ${DEPLOYDIR}
rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin
ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin
--
1.6.6.1
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index d94930b..2a0f3da 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -220,6 +196,9 @@ kernel_do_configure() {
kernel_do_configure[depends] += "${INITRAMFS_TASK}"
do_menuconfig() {
+ export DISPLAY='${DISPLAY}'
+ export DBUS_SESSION_BUS_ADDRESS='${DBUS_SESSION_BUS_ADDRESS}'
+ export XAUTHORITY='${XAUTHORITY}'
export TERMWINDOWTITLE="${PN} Kernel Configuration"
export SHELLCMDS="make menuconfig"
${TERMCMDRUN}
@@ -318,13 +297,16 @@ module_conf_rfcomm = "alias bt-proto-3 rfcomm"
python populate_packages_prepend () {
def extract_modinfo(file):
- import re
- tmpfile = os.tmpnam()
+ import tempfile, re
+ tempfile.tempdir = bb.data.getVar("WORKDIR", d, 1)
+ tf = tempfile.mkstemp()
+ tmpfile = tf[1]
cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (bb.data.getVar("PATH", d, 1), bb.data.getVar("HOST_PREFIX", d, 1) or "", file, tmpfile)
os.system(cmd)
f = open(tmpfile)
l = f.read().split("\000")
f.close()
+ os.close(tf[0])
os.unlink(tmpfile)
exp = re.compile("([^=]+)=(.*)")
vals = {}
DESCRIPTION = "GNU Radio"
URL = "http://gnuradio.org"
SECTION = "apps"
PRIORITY = "optional"
LICENSE = "GPLv3"
DEPENDS = "uhd gsl guile-native fftwf python alsa-lib boost cppunit swig-native python-numpy"
INC_PR = "r8"
inherit distutils-base autotools pkgconfig
export BUILD_SYS
export HOST_SYS=${MULTIMACH_TARGET_SYS}
EXTRA_OECONF = " \
--program-prefix= \
--disable-gr-atsc \
--enable-gr-audio-alsa \
--disable-gr-audio-jack \
--disable-html-docs \
--with-boost=${STAGING_DIR_TARGET}/usr \
--disable-usrp1 \
--disable-usrp2 \
--with-pythondir=${PYTHON_SITEPACKAGES_DIR} \
PYTHON_CPPFLAGS=-I${STAGING_INCDIR}/${PYTHON_DIR} \
"
RDEPENDS_${PN} = "python-core python-audio python-threading python-codecs python-lang python-textutils \
python-shell python-pickle python-compiler python-pkgutil python-pydoc python-mmap \
python-netclient python-unittest python-difflib python-pprint python-numpy \
"
PACKAGES =+ "\
${PN}-examples \
${PN}-grc \
${PN}-conf \
"
FILES_${PN}-examples = "${datadir}/gnuradio/examples"
FILES_${PN}-grc = "${datadir}/gnuradio/grc"
FILES_${PN}-conf = "${sysconfdir}/gnuradio"
FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}/gnuradio/*"
FILES_${PN}-dbg += "${PYTHON_SITEPACKAGES_DIR}/gnuradio/.debug \
${PYTHON_SITEPACKAGES_DIR}/gnuradio/*/.debug \
"
require gnuradio.inc
PR = "${INC_PR}.1"
PV = "3.3.0-${PR}+gitr${SRCREV}"
SRCREV = "cdca1c917626f7c63f820da921a17187efc92cd5"
# Make it easy to test against developer repos and branches
GIT_REPO = "gnuradio.git"
GIT_BRANCH = "next"
SRC_URI = "git://gnuradio.org/git/${GIT_REPO};branch=${GIT_BRANCH};protocol=http \
"
S="${WORKDIR}/git"
DESCRIPTION = "Universal Hardware Driver for Ettus Research products."
HOMEPAGE = "http://www.ettus.com"
LICENSE = "GPLV3+"
DEPENDS = "git-native python-cheetah-native boost libusb1 uhd-firmware"
RDEPENDS_${PN} += "uhd-firmware"
INC_PR = "r4"
inherit cmake
PACKAGES =+ "${PN}-tests ${PN}-examples"
FILES_${PN} += "${libdir}/libuhd.so"
FILES_${PN} += "${datadir}/uhd/utils/*"
FILES_${PN}-tests += "${datadir}/uhd/tests/*"
FILES_${PN}-dbg += "${datadir}/uhd/examples/.debug/*"
FILES_${PN}-dbg += "${datadir}/uhd/utils/.debug/*"
FILES_${PN}-dbg += "${datadir}/uhd/tests/.debug/*"
FILES_${PN}-examples = "${datadir}/uhd/examples/*"
OECMAKE_BUILDPATH = "${S}/build"
OECMAKE_SOURCEPATH = "${S}"
EXTRA_OECMAKE = "-DENABLE_USRP_E100=TRUE"
EXTRA_OEMAKE = "-C ${OECMAKE_BUILDPATH}"
require uhd.inc
PR = "${INC_PR}.2"
SRC_URI = "git://ettus.sourcerepo.com/ettus/uhd.git;protocol=git"
S = "${WORKDIR}/git/host"
SRCREV = "cc639e876f326e958dace8438ae41b8cd9563780"