From c04bac092910c7abb3ff328597c57cc204ba51a6 Mon Sep 17 00:00:00 2001 From: Michael 'Mickey' Lauer Date: Thu, 6 Aug 2009 17:10:35 +0200 Subject: vala: here comes 0.7.5+fso2 --- classes/vala.bbclass | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/vala.bbclass b/classes/vala.bbclass index bcd906aeb9..125820c00c 100644 --- a/classes/vala.bbclass +++ b/classes/vala.bbclass @@ -1,3 +1,14 @@ DEPENDS += "vala-native" -FILES_${PN}-dev += "${datadir}/vala/vapi/*.vapi" +FILES_${PN}-dev += "\ + ${datadir}/vala/vapi/*.vapi \ + ${datadir}/vala/vapi/*.deps \ +" + +# .vapi and .deps files are arch independent and need to be present in the +# staging datadir for the native vala compiler +do_stage_append() { + install -d ${STAGING_DATADIR_NATIVE}/vala/vapi + find . -name "*.vapi" -exec install -m 0644 {} ${STAGING_DATADIR_NATIVE}/vala/vapi/ \; + find . -name "*.deps" -exec install -m 0644 {} ${STAGING_DATADIR_NATIVE}/vala/vapi/ \; +} -- cgit v1.2.3 From 6e4f48a748a6c6ed73e68db307eaca5cec7ebc7c Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Wed, 5 Aug 2009 15:23:05 -0700 Subject: gconf.bbclass: adjust the ordering of things so that a package pkg_postinst_append is executed after the class postinst. This is important since recipes like gpanel need to to execute gconftool-2 --load after the gconf class code has processed the schema info --- classes/gconf.bbclass | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'classes') diff --git a/classes/gconf.bbclass b/classes/gconf.bbclass index 99f33e433a..47df06329b 100644 --- a/classes/gconf.bbclass +++ b/classes/gconf.bbclass @@ -45,9 +45,10 @@ python populate_packages_append () { if schemas != []: bb.note("adding gconf postinst and prerm scripts to %s" % pkg) bb.data.setVar('SCHEMA_FILES', " ".join(schemas), d) - postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) - if not postinst: - postinst = '#!/bin/sh\n' + postinst = '#!/bin/sh\n' + pkgpostinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) + if pkgpostinst: + postinst += pkgpostinst postinst += bb.data.getVar('gconf_postinst', d, 1) bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) prerm = bb.data.getVar('pkg_prerm_%s' % pkg, d, 1) or bb.data.getVar('pkg_prerm', d, 1) -- cgit v1.2.3 From 6c47435bdb4abb5e5c4831ff774fe2c604d3aadf Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Thu, 6 Aug 2009 12:49:09 -0700 Subject: image.bbclass: fix bug in lingua code (code wasn't spitting entries like fr-fr and thus locale-fr packages were bing omitted) --- classes/image.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/image.bbclass b/classes/image.bbclass index 385043bfc7..f7afbab81e 100644 --- a/classes/image.bbclass +++ b/classes/image.bbclass @@ -243,8 +243,10 @@ if [ -e ${IMAGE_ROOTFS}/usr/bin/opkg-cl ] ; then ${OPKG} list_installed | awk '{print $1}' |sort | uniq > /tmp/installed-packages for i in $(cat /tmp/installed-packages | grep -v locale) ; do - for translation in ${IMAGE_LINGUAS} $(echo ${IMAGE_LINGUAS} | awk -F_ '{print $1}'); do + for translation in ${IMAGE_LINGUAS}; do + translation_split=$(echo ${translation} | awk -F '-' '{print $1}') echo ${i}-locale-${translation} + echo ${i}-locale-${translation_split} done done | sort | uniq > /tmp/wanted-locale-packages -- cgit v1.2.3 From a394010d4405423dd117e67e872513caafc1d0b7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 9 Aug 2009 01:55:39 -0700 Subject: sanity.bbclass: Correct typo to refer to PACKAGE_EXTRA_ARCHS We were using EXTRA_PACKAGE_ARCHS which was sort of misleading if you started to search for this variable. It was a typo hence fixed as obvious. Signed-off-by: Khem Raj --- classes/sanity.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass index 29624c3f78..83c03299bf 100644 --- a/classes/sanity.bbclass +++ b/classes/sanity.bbclass @@ -185,7 +185,7 @@ def check_sanity(e): archs = data.getVar('PACKAGE_ARCHS', e.data, True).split() for arch in archs: if archs.count(arch) != 1: - messages = messages + "Error, Your PACKAGE_ARCHS field contains duplicates. Perhaps you set EXTRA_PACKAGE_ARCHS twice accidently through some tune file?\n" + messages = messages + "Error, Your PACKAGE_ARCHS field contains duplicates. Perhaps you set PACKAGE_EXTRA_ARCHS twice accidently through some tune file?\n" break if messages != "": -- cgit v1.2.3 From 1708207a54e1195d43fb412a3bbef9aa7135fce1 Mon Sep 17 00:00:00 2001 From: Denys Dmytriyenko Date: Wed, 5 Aug 2009 13:06:32 -0400 Subject: kernel.bbclass: introduce MODULES_IMAGE_BASE_NAME Similar to KERNEL_IMAGE_BASE_NAME, allow overwriting from a recipe Signed-off-by: Denys Dmytriyenko Acked-by: Henning Heinold --- classes/kernel.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index b4987608ed..3ee7f53a29 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -510,6 +510,7 @@ addtask uboot_mkimage before do_install after do_compile KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}" KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}" +MODULES_IMAGE_BASE_NAME ?= modules-${PV}-${PR}-${MACHINE} do_deploy() { install -d ${DEPLOY_DIR_IMAGE} @@ -517,7 +518,7 @@ do_deploy() { package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin if [ -d "${D}/lib" ]; then - tar -cvzf ${DEPLOY_DIR_IMAGE}/modules-${PV}-${PR}-${MACHINE}.tgz -C ${D} lib + tar -cvzf ${DEPLOY_DIR_IMAGE}/${MODULES_IMAGE_BASE_NAME}.tgz -C ${D} lib fi cd ${DEPLOY_DIR_IMAGE} -- cgit v1.2.3 From b0393327217ccb3fbc911e389713c7595cd76391 Mon Sep 17 00:00:00 2001 From: Rolf Leggewie Date: Wed, 12 Aug 2009 23:43:02 +0200 Subject: base.bbclass: ftp.matrix.com.br no longer exists * Acked-By: Holger Freyther * Acked-by: Phil Blundell --- classes/base.bbclass | 1 - 1 file changed, 1 deletion(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index ef6c0abf8f..5363e5c69f 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -1279,7 +1279,6 @@ ${DEBIAN_MIRROR} ftp://ftp.es.debian.org/debian/pool ${DEBIAN_MIRROR} ftp://ftp.se.debian.org/debian/pool ${DEBIAN_MIRROR} ftp://ftp.tr.debian.org/debian/pool ${GNU_MIRROR} ftp://mirrors.kernel.org/gnu -${GNU_MIRROR} ftp://ftp.matrix.com.br/pub/gnu ${GNU_MIRROR} ftp://ftp.cs.ubc.ca/mirror2/gnu ${GNU_MIRROR} ftp://sunsite.ust.hk/pub/gnu ${GNU_MIRROR} ftp://ftp.ayamura.org/pub/gnu -- cgit v1.2.3 From 7861be0ddd3e7a8c1ea0d6f26daa651efe4c9481 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 17 Aug 2009 15:41:48 +0200 Subject: package_tar.bbclass: Do not set IMAGE_PKGTYPE to unbreak parsing image.bbclass is trying to inherit package_${IMAGE_PKGTYPE} and this will fail because a rootfs_tar.bbclass doesn't exist. When planning to build images one needs to inherit package_ipk, package_rpm or package_deb in addition to INHERIT += "package_tar". Signed-off-by: Holger Hans Peter Freyther Acked-by: Philip Balister --- classes/package_tar.bbclass | 2 -- 1 file changed, 2 deletions(-) (limited to 'classes') diff --git a/classes/package_tar.bbclass b/classes/package_tar.bbclass index cb70a5fae8..a0eacf27f5 100644 --- a/classes/package_tar.bbclass +++ b/classes/package_tar.bbclass @@ -1,7 +1,5 @@ inherit package -IMAGE_PKGTYPE ?= "tar" - python package_tar_fn () { import os from bb import data -- cgit v1.2.3 From ad0ba478018ac64598b6701df5a79b1f71f9b58f Mon Sep 17 00:00:00 2001 From: Rolf Leggewie Date: Fri, 14 Aug 2009 16:01:10 +0200 Subject: base.bbclass: introduce OE source mirror network as last resort for do_fetch Updating recipes and checksums.ini for vanishing upstream hosts or simple restructuring can quickly become a chore for OE devs if taken seriously. The OE user experience suffers severely when at any given point in time 4 to 5 recipes on average fail do_fetch for a simple image. The solution is for OE to provide its own caching of upstream sources. mirrors.openembedded.org is a swarm of possibly incomplete source mirrors provided by the community and load-balanced via DNS round robin. They act as a first line of defense and lower bandwidth load on melo which hosts sources.openembedded.org. The melo mirror aims to have a complete copy of free-to-publish sources used by the current org.oe.dev branch. More information at http://wiki.openembedded.net/index.php/Sources_mirror Acked-by: Holger Freyther Acked-by: Chris Larson --- classes/base.bbclass | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 5363e5c69f..51648dae92 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -1312,6 +1312,10 @@ ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://gd.tuwien.ac.at/utils/adm ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://sunsite.ualberta.ca/pub/Mirror/lsof/ ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://the.wiretapped.net/pub/security/host-security/lsof/ http://www.apache.org/dist http://archive.apache.org/dist +ftp://.*/.* http://mirrors.openembedded.org/ +https?$://.*/.* http://mirrors.openembedded.org/ +ftp://.*/.* http://sources.openembedded.org/ +https?$://.*/.* http://sources.openembedded.org/ } -- cgit v1.2.3 From aea9acb329d715db851c1bed8506c3d0f9b42ae1 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Fri, 10 Jul 2009 11:27:31 -0700 Subject: Let the distro control whether we include hostap or madwifi. - Add base_ifelse convenience function to base.bbclass. - Replace all conditionals in the recipes relating to hostap and madwifi to look for their name in COMBINED_FEATURES rather than looking for specific buses (pci, pcmcia). - Change the default COMBINED_FEATURES to enable: - madwifi, when: - distro has pci, wifi, and madwifi in its features - machine has pci in its features - hostap, when: - 'wifi' and 'hostap' are in distro features - either 'pci' or 'pcmcia' are in both distro and machine features Signed-off-by: Chris Larson --- classes/base.bbclass | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 51648dae92..aed927404a 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -159,6 +159,12 @@ def base_read_file(filename): return f.read().strip() return None +def base_ifelse(condition, iftrue = True, iffalse = False): + if condition: + return iftrue + else: + return iffalse + def base_conditional(variable, checkvalue, truevalue, falsevalue, d): import bb if bb.data.getVar(variable,d,1) == checkvalue: -- cgit v1.2.3 From ac729cee6058e9e601af4869874213ccd129c732 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Tue, 7 Jul 2009 15:19:07 -0700 Subject: base.bbclass: catch bb.MalformedUrl in do_fetch. Signed-off-by: Chris Larson --- classes/base.bbclass | 3 +++ 1 file changed, 3 insertions(+) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index aed927404a..598a7bb77f 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -620,6 +620,9 @@ python base_do_fetch() { except bb.fetch.NoMethodError: (type, value, traceback) = sys.exc_info() raise bb.build.FuncFailed("No method: %s" % value) + except bb.MalformedUrl: + (type, value, traceback) = sys.exc_info() + raise bb.build.FuncFailed("Malformed URL: %s" % value) try: bb.fetch.go(localdata) -- cgit v1.2.3 From e20e2ebb2a22138227b1420e625b8df8593c51b9 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 18 Jun 2009 12:41:50 -0700 Subject: package_rpm: don't run against native/cross recipes, explicitly In the past, it only avoided adding the rpm-native/fakeroot-native deps if PACKAGES is empty, but unfortunately some native recipes have PACKAGES set to non-empty, so let's explicitly check for native/cross. Signed-off-by: Chris Larson --- classes/package_rpm.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/package_rpm.bbclass b/classes/package_rpm.bbclass index 9755bf1d2d..13cb8773af 100644 --- a/classes/package_rpm.bbclass +++ b/classes/package_rpm.bbclass @@ -210,7 +210,9 @@ python do_package_rpm () { python () { import bb - if bb.data.getVar('PACKAGES', d, True) != '': + if bb.data.getVar('PACKAGES', d, True) != '' and \ + not bb.data.inherits_class('native', d) and \ + not bb.data.inherits_class('cross', d): deps = (bb.data.getVarFlag('do_package_write_rpm', 'depends', d) or "").split() deps.append('rpm-native:do_populate_staging') deps.append('fakeroot-native:do_populate_staging') -- cgit v1.2.3 From 6b86d4060be13734848bcda7bc52760765baeafe Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Wed, 15 Jul 2009 11:00:27 -0700 Subject: devshell.bbclass: set a default for XAUTHORITY and export DBUS_SESSION_BUS_ADDRESS. Signed-off-by: Chris Larson --- classes/devshell.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/devshell.bbclass b/classes/devshell.bbclass index 2944dbbfc2..9327b55d0a 100644 --- a/classes/devshell.bbclass +++ b/classes/devshell.bbclass @@ -4,7 +4,8 @@ do_devshell[dirs] = "${S}" do_devshell[nostamp] = "1" export DISPLAY -export XAUTHORITY +export DBUS_SESSION_BUS_ADDRESS +export XAUTHORITY ?= "${HOME}/.Xauthority" devshell_do_devshell() { export TERMWINDOWTITLE="Bitbake Developer Shell" -- cgit v1.2.3 From ee09ed852dd3e6a831a9ae5c31f260a4a9057645 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 28 May 2009 15:27:31 -0700 Subject: src_distribute*.bbclass: cleanup, revamp parts, distribute all sources. - Kill the big shell function with the case statement used in _local in favor of a set of bitbake variables, with the appropriate one selected as SRC_DISTRIBUTECOMMAND. - Add and use SRC_DISTRIBUTE_DLONLY to toggle distribution of all sources versus just those downloaded to DL_DIR. This variable expects to be set to an integer, anything but 0 will enable dlonly operation. This is disabled by default. - Add a more sanely named distribute_sources_all, and make distsrcall depend on it, for compatibility. - By default, distributes the sources into ${SRC_DISTRIBUTEDIR}/${LIC}/${PN}/. - Move some _local specific bits, like use of SRC_DISTRIBUTEDIR, out of the main class. - Set a "LIC" var along with the "SRC" when running SRC_DISTRIBUTECOMMAND, to facilitate the above. Signed-off-by: Chris Larson --- classes/src_distribute.bbclass | 41 +++++++++++++++++-------- classes/src_distribute_local.bbclass | 58 ++++++++++++++++++++---------------- 2 files changed, 60 insertions(+), 39 deletions(-) (limited to 'classes') diff --git a/classes/src_distribute.bbclass b/classes/src_distribute.bbclass index 30b2670011..3a033b9673 100644 --- a/classes/src_distribute.bbclass +++ b/classes/src_distribute.bbclass @@ -1,29 +1,44 @@ +SRC_DISTRIBUTE_DLONLY ?= "0" SRC_DISTRIBUTECOMMAND[func] = "1" + +addtask distribute_sources before do_build after do_fetch python do_distribute_sources () { + import os, re, bb + l = bb.data.createCopy(d) bb.data.update_data(l) - licenses = (bb.data.getVar('LICENSE', d, 1) or "unknown").split() - sources_dir = bb.data.getVar('SRC_DISTRIBUTEDIR', d, 1) - import re + licenses = (bb.data.getVar('LICENSE', d, 1) or "unknown").split() for license in licenses: for entry in license.split("|"): for url in ((bb.data.getVar('SRC_URI', d, 1) or '').split()): bb.fetch.init([url], d) s = bb.fetch.localpath(url, d) s = re.sub(';.*$', '', s) + + try: + dlonly = int(d.getVar("SRC_DISTRIBUTE_DLONLY", 1)) + except ValueError: + raise bb.build.FuncFailed("Invalid value for SRC_DISTRIBUTE_DLONLY: expected integer.") + if dlonly: + dldir = os.path.realpath(d.getVar("DL_DIR", 1) or "") + if dldir and not \ + os.path.realpath(s).startswith(dldir + os.path.sep): + continue + cmd = bb.data.getVar('SRC_DISTRIBUTECOMMAND', d, 1) if not cmd: - raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not defined") - bb.data.setVar('SRC', s, d) - bb.data.setVar('SRC_DISTRIBUTEDIR', "%s/%s" % (sources_dir, entry), d) - bb.build.exec_func('SRC_DISTRIBUTECOMMAND', d) + raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not set") + bb.debug(2, "srcdist: running %s" % cmd) + bb.data.setVar('SRC', os.path.normpath(s), l) + bb.data.setVar('LIC', entry, l) + bb.build.exec_func('SRC_DISTRIBUTECOMMAND', l) } -addtask distribute_sources before do_build after do_fetch +addtask distribute_sources_all after do_distribute_sources +do_distribute_sources_all[recrdeptask] = "do_distribute_sources" +do_distribute_sources_all[nostamp] = "1" -addtask distsrcall after do_distribute_sources -do_distsrcall[recrdeptask] = "do_distribute_sources" -base_do_distsrcall() { - : -} +# compatability wrapper +addtask distsrcall after do_distribute_sources_all +do_distsrcall[nostamp] = "1" diff --git a/classes/src_distribute_local.bbclass b/classes/src_distribute_local.bbclass index 5f0cef5bec..ed58ed14e1 100644 --- a/classes/src_distribute_local.bbclass +++ b/classes/src_distribute_local.bbclass @@ -1,31 +1,37 @@ inherit src_distribute -# SRC_DIST_LOCAL possible values: -# copy copies the files from ${A} to the distributedir -# symlink symlinks the files from ${A} to the distributedir -# move+symlink moves the files into distributedir, and symlinks them back SRC_DIST_LOCAL ?= "move+symlink" SRC_DISTRIBUTEDIR ?= "${DEPLOY_DIR}/sources" -SRC_DISTRIBUTECOMMAND () { - s="${SRC}" - if [ ! -L "$s" ] && (echo "$s"|grep "^${DL_DIR}"); then - : - else - exit 0; - fi - mkdir -p ${SRC_DISTRIBUTEDIR} - case "${SRC_DIST_LOCAL}" in - copy) - test -e $s.md5 && cp -f $s.md5 ${SRC_DISTRIBUTEDIR}/ - cp -f $s ${SRC_DISTRIBUTEDIR}/ - ;; - symlink) - test -e $s.md5 && ln -sf $s.md5 ${SRC_DISTRIBUTEDIR}/ - ln -sf $s ${SRC_DISTRIBUTEDIR}/ - ;; - move+symlink) - mv $s ${SRC_DISTRIBUTEDIR}/ - ln -sf ${SRC_DISTRIBUTEDIR}/`basename $s` $s - ;; - esac +SRC_DISTRIBUTECOMMAND[dirs] = "${SRC_DISTRIBUTEDIR}/${LIC}/${PN}" + +# symlinks the files to the SRC_DISTRIBUTEDIR +SRC_DISTRIBUTECOMMAND-symlink () { + test -e ${SRC}.md5 && ln -sf ${SRC}.md5 . + ln -sf ${SRC} . +} + +# copies the files to the SRC_DISTRIBUTEDIR +SRC_DISTRIBUTECOMMAND-copy () { + test -e ${SRC}.md5 && cp -f ${SRC}.md5 . + cp -f ${SRC} . +} + +# moves the files to the SRC_DISTRIBUTEDIR and symlinks them back +SRC_DISTRIBUTECOMMAND-move+symlink () { + if ! [ -L ${SRC} ]; then + mv ${SRC} . + ln -sf $PWD/`basename ${SRC}` ${SRC} + if [ -e ${SRC}.md5 ]; then + mv ${SRC}.md5 . + ln -sf $PWD/`basename ${SRC}.md5` ${SRC}.md5 + fi + fi +} + +#SRC_DISTRIBUTECOMMAND = "${@str(d.getVar('SRC_DISTRIBUTECOMMAND-%s' % d.getVar('SRC_DIST_LOCAL', 1), 1))}" +python () { + if d.getVar("SRC_DISTRIBUTECOMMAND", 1) is None: + cmd = d.getVar("SRC_DISTRIBUTECOMMAND-%s" % d.getVar("SRC_DIST_LOCAL", 1), 0) + if cmd: + d.setVar("SRC_DISTRIBUTECOMMAND", cmd) } -- cgit v1.2.3 From a6a23f7369bf725b6acdf45a42967558b2221659 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 7 May 2009 13:37:09 -0700 Subject: src_distribute: force do_fetch execution in do_distribute_sources. Works around src_distribute failures with the use of packaged staging. Signed-off-by: Chris Larson --- classes/src_distribute.bbclass | 2 ++ 1 file changed, 2 insertions(+) (limited to 'classes') diff --git a/classes/src_distribute.bbclass b/classes/src_distribute.bbclass index 3a033b9673..7d75c9e16f 100644 --- a/classes/src_distribute.bbclass +++ b/classes/src_distribute.bbclass @@ -5,6 +5,8 @@ addtask distribute_sources before do_build after do_fetch python do_distribute_sources () { import os, re, bb + bb.build.exec_func("do_fetch", d) + l = bb.data.createCopy(d) bb.data.update_data(l) -- cgit v1.2.3 From 7ab4382774acd717e4dfe85ba74d06851dfb5247 Mon Sep 17 00:00:00 2001 From: Jeremy Puhlman Date: Tue, 16 Jun 2009 16:53:41 -0700 Subject: src_distribute_local: Change cp -f to cp -fr to account for directories. Signed-off-by: Jeremy Puhlman Signed-off-by: Chris Larson --- classes/src_distribute_local.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/src_distribute_local.bbclass b/classes/src_distribute_local.bbclass index ed58ed14e1..5cec2880aa 100644 --- a/classes/src_distribute_local.bbclass +++ b/classes/src_distribute_local.bbclass @@ -13,7 +13,7 @@ SRC_DISTRIBUTECOMMAND-symlink () { # copies the files to the SRC_DISTRIBUTEDIR SRC_DISTRIBUTECOMMAND-copy () { test -e ${SRC}.md5 && cp -f ${SRC}.md5 . - cp -f ${SRC} . + cp -fr ${SRC} . } # moves the files to the SRC_DISTRIBUTEDIR and symlinks them back -- cgit v1.2.3 From afe0641baf060813e57e880c3a3f4b202a0dfefe Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 6 May 2009 03:38:35 +0000 Subject: kernel.bbclass: stage more include files for x86 in 2.6.27+ Some packages include , which requires . Supplement b6220af33a70d96345dea130005ce842eeadfdf5 to copy files from arch/x86/include/asm to include/asm-x86. Signed-off-by: Michael Smith Acked-by: Roman I Khimov --- classes/kernel.bbclass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index 3ee7f53a29..d084cefee8 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -103,8 +103,15 @@ kernel_do_stage() { cp -fR arch/${ARCH}/include/asm/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/ install -d ${STAGING_KERNEL_DIR}/arch/${ARCH}/include cp -fR arch/${ARCH}/* ${STAGING_KERNEL_DIR}/arch/${ARCH}/ + + # Check for arch/x86 on i386 + elif [ -d arch/x86/include/asm/ ]; then + cp -fR arch/x86/include/asm/* ${STAGING_KERNEL_DIR}/include/asm-x86/ + install -d ${STAGING_KERNEL_DIR}/arch/x86/include + cp -fR arch/x86/* ${STAGING_KERNEL_DIR}/arch/x86/ fi - rm -f $ASMDIR ${STAGING_KERNEL_DIR}/include/asm + + rm -f ${STAGING_KERNEL_DIR}/include/asm ln -sf $ASMDIR ${STAGING_KERNEL_DIR}/include/asm mkdir -p ${STAGING_KERNEL_DIR}/include/asm-generic -- cgit v1.2.3 From f73c64e7295be1e1065f898b49f50a02e812161c Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 23 Aug 2009 19:24:57 -0700 Subject: base.bbclass: Replace os.system with subprocess call. Often gzip is reporting broken pipe errors with do_unpack of tar.gz files. If you use the commands described above to extract a tar.gz file, gzip sometimes emits a Broken pipe error message. This can safely be ignored if tar extracted all files without any other error message. We do not let python install its SIGPIPE handler and use subprocess call to invoke the command. This is based on the following python bug report. http://bugs.python.org/issue1652 Signed-off-by: Khem Raj --- classes/base.bbclass | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 598a7bb77f..4e9b65c285 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -728,9 +728,14 @@ base_do_buildall() { : } +def subprocess_setup(): + import signal, subprocess + # Python installs a SIGPIPE handler by default. This is usually not what + # non-Python subprocesses expect. + signal.signal(signal.SIGPIPE, signal.SIG_DFL) def oe_unpack_file(file, data, url = None): - import bb, os + import bb, os, signal, subprocess if not url: url = "file://%s" % file dots = file.split(".") @@ -799,7 +804,7 @@ def oe_unpack_file(file, data, url = None): cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd) bb.note("Unpacking %s to %s/" % (base_path_out(file, data), base_path_out(os.getcwd(), data))) - ret = os.system(cmd) + ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True) os.chdir(save_cwd) -- cgit v1.2.3 From dfe2bb428bb6db6938859927a8004caa167b96a8 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 13 Jul 2009 15:07:18 -0400 Subject: mesa-dri: move tls configure logic to a class Will allow reuse by xorg-xserver. Signed-off-by: Michael Smith --- classes/glx-use-tls.bbclass | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 classes/glx-use-tls.bbclass (limited to 'classes') diff --git a/classes/glx-use-tls.bbclass b/classes/glx-use-tls.bbclass new file mode 100644 index 0000000000..7530872fa4 --- /dev/null +++ b/classes/glx-use-tls.bbclass @@ -0,0 +1,7 @@ +def get_tls_setting(bb, d): + # until we have no prober TLS support in uclibc disable it + if bb.data.getVar('TARGET_OS', d, 1).find('uclibc') >= 0 : + return "" + return "--enable-glx-tls" + +EXTRA_OECONF += "${@get_tls_setting(bb, d)}" -- cgit v1.2.3 From 743aaf30cc10e1490bbc126cfe96f94695dca32c Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Tue, 16 Jun 2009 10:32:23 -0700 Subject: distutils-common-base.bbclass: only raise missing python-native error if python-native isn't in DEPENDS. Signed-off-by: Chris Larson Acked-by: Michael 'Mickey' Lauer --- classes/distutils-common-base.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/distutils-common-base.bbclass b/classes/distutils-common-base.bbclass index 9ca392b84a..01bf9eaeba 100644 --- a/classes/distutils-common-base.bbclass +++ b/classes/distutils-common-base.bbclass @@ -8,7 +8,9 @@ def python_dir(d): staging_incdir = bb.data.getVar( "STAGING_INCDIR", d, 1 ) for majmin in "2.6 2.5 2.4 2.3".split(): if os.path.exists( "%s/python%s" % ( staging_incdir, majmin ) ): return "python%s" % majmin - raise "No Python in STAGING_INCDIR. Forgot to build python-native ?" + if not "python-native" in bb.data.getVar( "DEPENDS", d, 1 ).split(): + raise "No Python in STAGING_INCDIR. Forgot to build python-native ?" + return "INVALID" PYTHON_DIR = "${@python_dir(d)}" -- cgit v1.2.3 From 278cec5e0eba9ce1d18ac4eb0699ce3ee167168f Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Tue, 28 Jul 2009 12:29:51 -0700 Subject: kernel.bbclass: Install & package symvers as /boot/Module.symvers-. Signed-off-by: Chris Larson Acked-by: Michael Smith --- classes/kernel.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index d084cefee8..4cf5bed448 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -182,6 +182,7 @@ kernel_do_install() { install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} + [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION} install -d ${D}/etc/modutils if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then install -d ${D}/etc/modprobe.d @@ -232,7 +233,7 @@ EXPORT_FUNCTIONS do_compile do_install do_stage do_configure PACKAGES = "kernel kernel-base kernel-image kernel-dev kernel-vmlinux" FILES = "" FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*" -FILES_kernel-dev = "/boot/System.map* /boot/config*" +FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*" FILES_kernel-vmlinux = "/boot/vmlinux*" RDEPENDS_kernel = "kernel-base" RRECOMMENDS_kernel-module-hostap-cs += '${@base_version_less_or_equal("KERNEL_VERSION", "2.6.17", "", "apm-wifi-suspendfix", d)}' -- cgit v1.2.3 From 34cd6c2a37c03d694ba98414e902b9250cd67b77 Mon Sep 17 00:00:00 2001 From: Dale Farnsworth Date: Tue, 21 Jul 2009 11:32:21 -0700 Subject: kernel.bbclass: Set EXTRA_OEMAKE to null for kernel Currently the only thing in EXTRA_OEMAKE is '-e MAKEFLAGS='. We don't want to overide the kernel's Makefile variables from the environment. It caused the passed -j parameter from PARALLEL_MAKE to be ignored. Signed-off-by: Dale Farnsworth Signed-off-by: Chris Larson Acked-by: Denys Dmytriyenko --- classes/kernel.bbclass | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'classes') diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index 4cf5bed448..c5192d59d4 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -78,6 +78,10 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" UBOOT_ENTRYPOINT ?= "20008000" UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" +# For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE. +# We don't want to override kernel Makefile variables from the environment +EXTRA_OEMAKE = "" + kernel_do_compile() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}" -- cgit v1.2.3 From 97cd9822750689a733b07b01b21acf93f3877e33 Mon Sep 17 00:00:00 2001 From: Dale Farnsworth Date: Wed, 8 Jul 2009 13:47:18 -0700 Subject: patch.bbclass: Add "git" patchtool mechanism, which uses git-apply It can be selected by setting PATCHTOOL = "git". This is useful because git-apply honors the permissions information produced by git-format-patch. Signed-off-by: Dale Farnsworth Signed-off-by: Chris Larson Acked-by: Denys Dmytriyenko --- classes/patch.bbclass | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'classes') diff --git a/classes/patch.bbclass b/classes/patch.bbclass index 2f99e4cf30..dfb8ec960f 100644 --- a/classes/patch.bbclass +++ b/classes/patch.bbclass @@ -189,6 +189,24 @@ def patch_init(d): def Clean(self): """""" + class GitApplyTree(PatchTree): + def __init__(self, dir, d): + PatchTree.__init__(self, dir, d) + + def _applypatch(self, patch, force = False, reverse = False, run = True): + shellcmd = ["git", "--git-dir=.", "apply", "-p%s" % patch['strippath']] + + if reverse: + shellcmd.append('-R') + + shellcmd.append(patch['file']) + + if not run: + return "sh" + "-c" + " ".join(shellcmd) + + return runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) + + class QuiltTree(PatchSet): def _runcmd(self, args, run = True): quiltrc = bb.data.getVar('QUILTRCFILE', self.d, 1) @@ -424,6 +442,7 @@ def patch_init(d): g["PatchSet"] = PatchSet g["PatchTree"] = PatchTree g["QuiltTree"] = QuiltTree + g["GitApplyTree"] = GitApplyTree g["Resolver"] = Resolver g["UserResolver"] = UserResolver g["NOOPResolver"] = NOOPResolver @@ -449,6 +468,7 @@ python patch_do_patch() { patchsetmap = { "patch": PatchTree, "quilt": QuiltTree, + "git": GitApplyTree, } cls = patchsetmap[bb.data.getVar('PATCHTOOL', d, 1) or 'quilt'] -- cgit v1.2.3 From 482e70f47fed52f27c83cc41e6bdeeb8ad36c779 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Wed, 26 Aug 2009 03:58:03 -0700 Subject: package_ipk.bbclass: don't choke on empty SRC_URI. Signed-off-by: Chris Larson --- classes/package_ipk.bbclass | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'classes') diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass index e3a7522619..e5561082fd 100644 --- a/classes/package_ipk.bbclass +++ b/classes/package_ipk.bbclass @@ -266,10 +266,9 @@ python do_package_ipk () { ctrlfile.write("Replaces: %s\n" % ", ".join(rreplaces)) if rconflicts: ctrlfile.write("Conflicts: %s\n" % ", ".join(rconflicts)) - src_uri = bb.data.getVar("SRC_URI", localdata, 1) - if src_uri: - src_uri = re.sub("\s+", " ", src_uri) - ctrlfile.write("Source: %s\n" % " ".join(src_uri.split())) + src_uri = bb.data.getVar("SRC_URI", localdata, 1) or d.getVar("FILE", True) + src_uri = re.sub("\s+", " ", src_uri) + ctrlfile.write("Source: %s\n" % " ".join(src_uri.split())) ctrlfile.close() for script in ["preinst", "postinst", "prerm", "postrm"]: -- cgit v1.2.3 From 4dc61b382a9e13b3271c69ff6fcbf69432273172 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Wed, 26 Aug 2009 03:58:24 -0700 Subject: srctree.bbclass: add initial version. This enables operation inside of an existing source tree for a project, rather than using the fetch/unpack/patch idiom. By default, it expects that you're keeping the recipe(s) inside the aforementioned source tree, but you could override S to point at an external directory and place the recipes in a normal collection/overlay, if you so chose. It also provides some convenience python functions for assembling your do_clean, if you want to leverage things like 'git clean' to simplify the operation. Signed-off-by: Chris Larson --- classes/srctree.bbclass | 141 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 classes/srctree.bbclass (limited to 'classes') diff --git a/classes/srctree.bbclass b/classes/srctree.bbclass new file mode 100644 index 0000000000..2a324cf1be --- /dev/null +++ b/classes/srctree.bbclass @@ -0,0 +1,141 @@ +# Copyright (C) 2009 Chris Larson +# Released under the MIT license (see COPYING.MIT for the terms) +# +# srctree.bbclass enables operation inside of an existing source tree for a +# project, rather than using the fetch/unpack/patch idiom. +# +# By default, it expects that you're keeping the recipe(s) inside the +# aforementioned source tree, but you could override S to point at an external +# directory and place the recipes in a normal collection/overlay, if you so +# chose. +# +# It also provides some convenience python functions for assembling your +# do_clean, if you want to leverage things like 'git clean' to simplify the +# operation. + + +S = "${FILE_DIRNAME}" +SRC_URI = "" + +#TYPE = "${@'${PN}'.replace('${BPN}', '').strip()}" +#WORKDIR = "${S}/tmp${TYPE}.${MULTIMACH_HOST_SYS}" +#STAMP = "${WORKDIR}/tasks/stamp" +#WORKDIR_LOCAL = "${S}/tmp${TYPE}.${MULTIMACH_HOST_SYS}" +#T = "${WORKDIR_LOCAL}/bitbake-tasks" + +# Hack, so things don't explode in builds that don't inherit package +do_package ?= " pass" +do_package[func] = "1" +do_package[python] = "1" + +# Ensure that do_package depends on populate_staging, rather than install +addtask package after do_populate_staging + +# This stuff is needed to facilitate variants (normal, native, cross, sdk) +# that share a ${S}. It's ugly as hell. Only really necessary for recipes +# that can't use a ${B}, and which have variants like native. Not sure what +# the best solution is long term. +# +# We merge configure+compile+install into the populate_staging task, uses a +# lock file. This ensures that none of the tasks which access ${S} can +# interleave amongst the recipes that share that ${S}. + +def variant_hack(d): + from itertools import chain + + # Kill dependencies on the fromtasks + fromtasks = ["do_configure", "do_compile", "do_install"] + for key in d.keys(): + task = d.getVarFlag(key, "task") + if task: + deps = d.getVarFlag(key, "deps") + for task_ in fromtasks: + if task_ in deps: + deps.remove(task_) + # if not key in fromtasks + ["do_populate_staging"]: + # deps.append("do_populate_staging") + d.setVarFlag(key, "deps", deps) + + # Pull the task deps from fromtasks over to the new task, minus deltasks + deltasks = ("do_patch", "do_unpack", "do_fetch") + deps = set(chain(*[(d.getVarFlag(old, "deps")) for old in fromtasks + ["do_populate_staging"]])) + d.setVarFlag("do_populate_staging", "deps", deps.difference(deltasks)) + + # Pull cross recipe task deps over + d.setVarFlag("do_populate_staging", "depends", " ".join((d.getVarFlag(old, "depends") or "" for old in fromtasks))) + +python () { + variant_hack(d) +} + +python do_populate_staging () { + from bb.build import exec_task, exec_func + + exec_task("do_configure", d) + exec_task("do_compile", d) + exec_task("do_install", d) + exec_func("do_stage", d) +} +do_populate_staging[lockfiles] += "${S}/.lock" + +make_do_clean () { + oe_runmake clean +} + +def clean_builddir(d): + from shutil import rmtree + + builddir = d.getVar("B", True) + srcdir = d.getVar("S", True) + if builddir != srcdir: + rmtree(builddir, ignore_errors=True) + +def clean_stamps(d): + from glob import glob + from bb import note + from bb.data import expand + from os import unlink + + note("Removing stamps") + for stamp in glob(expand('${STAMP}.*', d)): + try: + unlink(stamp) + except OSError: + pass + +def clean_workdir(d): + from shutil import rmtree + from bb import note + + workdir = d.getVar("WORKDIR", 1) + note("Removing %s" % workdir) + rmtree(workdir, ignore_errors=True) + +def clean_git(d): + from subprocess import call + + call(["git", "clean", "-d", "-f", "-X"], cwd=d.getVar("S", True)) + +def clean_make(d): + import bb + + bb.note("Running make clean") + try: + bb.build.exec_func("make_do_clean", d) + except bb.build.FuncFailed: + pass + +python do_clean () { + from os.path import exists + from bb.build import FuncFailed + from bb.data import expand + + clean_stamps(d) + clean_workdir(d) + if exists(expand("${S}/.git", d)) and \ + exists(expand("${S}/.gitignore", d)): + clean_git(d) + else: + clean_builddir(d) + clean_make(d) +} -- cgit v1.2.3 From e5b751653cb17d60665a648c8f9aaeda028aa122 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Wed, 26 Aug 2009 03:59:25 -0700 Subject: gitver.bbclass: add initial version. This provides a GITVER variable which is a (fairly) sane version, for use in ${PV}, extracted from the ${S} git checkout, assuming it is one. This is most useful in concert with srctree.bbclass. Signed-off-by: Chris Larson --- classes/gitver.bbclass | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 classes/gitver.bbclass (limited to 'classes') diff --git a/classes/gitver.bbclass b/classes/gitver.bbclass new file mode 100644 index 0000000000..92c053ae24 --- /dev/null +++ b/classes/gitver.bbclass @@ -0,0 +1,54 @@ +# Copyright (C) 2009 Chris Larson +# Released under the MIT license (see COPYING.MIT for the terms) +# +# gitver.bbclass provides a GITVER variable which is a (fairly) sane version, +# for use in ${PV}, extracted from the ${S} git checkout, assuming it is one. +# This is most useful in concert with srctree.bbclass. + + +GITVER = "${@get_git_pv('${S}', d)}" + +def gitver_mark_dependency(d): + from bb.data import expand + from bb.parse import mark_dependency + from os.path import abspath + + fn = abspath(expand("${S}/.git/HEAD", d)) + mark_dependency(d, fn) + +def get_git_pv(path, d, tagadjust=None): + from subprocess import Popen, PIPE + from os.path import join + from bb import error + + env = {"GIT_DIR": join(d.getVar("S", True), ".git")} + + def popen(cmd, **kwargs): + kwargs["stderr"] = PIPE + kwargs["stdout"] = PIPE + kwargs["env"] = env + try: + pipe = Popen(cmd, **kwargs) + except OSError, e: + #error("Execution of %s failed: %s" % (cmd, e)) + return + + (stdout, stderr) = pipe.communicate(None) + if pipe.returncode != 0: + #error("Execution of %s failed: %s" % (cmd, stderr)) + return + return stdout.rstrip() + + gitver_mark_dependency(d) + + ver = popen(["git", "describe", "--tags"], cwd=path) + if not ver: + ver = popen(["git", "rev-parse", "--short", "HEAD"], cwd=path) + if ver: + return "0.0-%s" % ver + else: + return "0.0" + else: + if tagadjust: + ver = tagadjust(ver) + return ver -- cgit v1.2.3 From af56cd467bcc76f5499199fb1f14252abe1e1e2a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 26 Aug 2009 00:38:30 -0700 Subject: base.bbclass: Remove redundant import of subprocess and signal. Signed-off-by: Khem Raj --- classes/base.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 4e9b65c285..a350b38850 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -729,13 +729,13 @@ base_do_buildall() { } def subprocess_setup(): - import signal, subprocess + import signal # Python installs a SIGPIPE handler by default. This is usually not what # non-Python subprocesses expect. signal.signal(signal.SIGPIPE, signal.SIG_DFL) def oe_unpack_file(file, data, url = None): - import bb, os, signal, subprocess + import bb, os, subprocess if not url: url = "file://%s" % file dots = file.split(".") -- cgit v1.2.3 From 6a5e3eadec25bfe03fdeff44197ffec45726484e Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Wed, 26 Aug 2009 14:02:19 -0700 Subject: srctree.bbclass: Don't automatically use git clean. This should be an opt-in feature. Signed-off-by: Chris Larson --- classes/srctree.bbclass | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'classes') diff --git a/classes/srctree.bbclass b/classes/srctree.bbclass index 2a324cf1be..e2a4303472 100644 --- a/classes/srctree.bbclass +++ b/classes/srctree.bbclass @@ -126,16 +126,8 @@ def clean_make(d): pass python do_clean () { - from os.path import exists - from bb.build import FuncFailed - from bb.data import expand - clean_stamps(d) clean_workdir(d) - if exists(expand("${S}/.git", d)) and \ - exists(expand("${S}/.gitignore", d)): - clean_git(d) - else: - clean_builddir(d) - clean_make(d) + clean_builddir(d) + clean_make(d) } -- cgit v1.2.3 From c45f041e4a65efd4e8e7565d186f87798d740601 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Wed, 26 Aug 2009 14:02:48 -0700 Subject: srctree: completely reimplement the task merging into do_populate_staging. This fixes issues seen with the use of kernel.bbclass, so in existing source tree kernel builds work happily now. Signed-off-by: Chris Larson --- classes/srctree.bbclass | 102 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 77 insertions(+), 25 deletions(-) (limited to 'classes') diff --git a/classes/srctree.bbclass b/classes/srctree.bbclass index e2a4303472..67cb9ffe8c 100644 --- a/classes/srctree.bbclass +++ b/classes/srctree.bbclass @@ -27,8 +27,6 @@ SRC_URI = "" do_package ?= " pass" do_package[func] = "1" do_package[python] = "1" - -# Ensure that do_package depends on populate_staging, rather than install addtask package after do_populate_staging # This stuff is needed to facilitate variants (normal, native, cross, sdk) @@ -40,40 +38,94 @@ addtask package after do_populate_staging # lock file. This ensures that none of the tasks which access ${S} can # interleave amongst the recipes that share that ${S}. -def variant_hack(d): +def merge_tasks(d): + """ + merge_tasks performs two operations: + 1) removes do_patch and its deps from the build entirely. + 2) merges all of the operations that occur prior to do_populate_staging + into do_populate_staging. + + This is necessary, because of recipe variants (normal, native, cross, + sdk). If a bitbake run happens to want to build more than one of + these variants in a single run, it's possible for them to step on one + another's toes, due to the shared ${S}. Interleaved + configure/compile/install amongst variants will break things badly. + """ from itertools import chain + from bb import note - # Kill dependencies on the fromtasks - fromtasks = ["do_configure", "do_compile", "do_install"] - for key in d.keys(): - task = d.getVarFlag(key, "task") - if task: - deps = d.getVarFlag(key, "deps") - for task_ in fromtasks: - if task_ in deps: - deps.remove(task_) - # if not key in fromtasks + ["do_populate_staging"]: - # deps.append("do_populate_staging") - d.setVarFlag(key, "deps", deps) - - # Pull the task deps from fromtasks over to the new task, minus deltasks - deltasks = ("do_patch", "do_unpack", "do_fetch") - deps = set(chain(*[(d.getVarFlag(old, "deps")) for old in fromtasks + ["do_populate_staging"]])) - d.setVarFlag("do_populate_staging", "deps", deps.difference(deltasks)) + def __gather_taskdeps(task, seen): + for dep in d.getVarFlag(task, "deps"): + if not dep in seen: + __gather_taskdeps(dep, seen) + if not task in seen: + seen.append(task) + + def gather_taskdeps(task): + items = [] + __gather_taskdeps(task, items) + return items + + newtask = "do_populate_staging" + mergedtasks = gather_taskdeps(newtask) + mergedtasks.pop() + deltasks = gather_taskdeps("do_patch") + + for task in (key for key in d.keys() + if d.getVarFlag(key, "task") and + not key in mergedtasks): + deps = d.getVarFlag(task, "deps") + for mergetask in mergedtasks: + if mergetask in (d.getVarFlag(task, "recrdeptask"), + d.getVarFlag(task, "recdeptask"), + d.getVarFlag(task, "deptask")): + continue + + if mergetask in deps: + deps.remove(mergetask) + #note("removing dep on %s from %s" % (mergetask, task)) + + if not mergetask in deltasks and \ + not newtask in deps: + #note("adding dep on %s to %s" % (newtask, task)) + deps.append(newtask) + d.setVarFlag(task, "deps", deps) + + for task in mergedtasks[:-1]: + deps = d.getVarFlag(task, "deps") + for deltask in deltasks: + if deltask in deps: + deps.remove(deltask) + d.setVarFlag(task, "deps", deps) # Pull cross recipe task deps over - d.setVarFlag("do_populate_staging", "depends", " ".join((d.getVarFlag(old, "depends") or "" for old in fromtasks))) + depends = (d.getVarFlag(task, "depends") or "" + for task in mergedtasks[:-1] + if not task in deltasks) + d.setVarFlag("do_populate_staging", "depends", " ".join(depends)) python () { - variant_hack(d) + merge_tasks(d) } +# Manually run do_install & all of its deps, then do_stage python do_populate_staging () { + from os.path import exists from bb.build import exec_task, exec_func + from bb import note + + stamp = d.getVar("STAMP", True) + + def rec_exec_task(task, seen): + for dep in d.getVarFlag(task, "deps"): + if not dep in seen: + rec_exec_task(dep, seen) + seen.add(task) + #if not exists("%s.%s" % (stamp, task)): + note("Executing task %s" % task) + exec_task(task, d) - exec_task("do_configure", d) - exec_task("do_compile", d) - exec_task("do_install", d) + rec_exec_task("do_install", set()) exec_func("do_stage", d) } do_populate_staging[lockfiles] += "${S}/.lock" -- cgit v1.2.3 From 2259a81628ac8bafb19e2b9ba9acca1c0dad341d Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Wed, 26 Aug 2009 14:44:04 -0700 Subject: srctree, clean: cleanup & split out do_clean bits into clean.bbclass. Signed-off-by: Chris Larson --- classes/clean.bbclass | 53 ++++++++++++++++++++++++++++++++ classes/srctree.bbclass | 82 ++++++------------------------------------------- 2 files changed, 62 insertions(+), 73 deletions(-) create mode 100644 classes/clean.bbclass (limited to 'classes') diff --git a/classes/clean.bbclass b/classes/clean.bbclass new file mode 100644 index 0000000000..65c1ab5d76 --- /dev/null +++ b/classes/clean.bbclass @@ -0,0 +1,53 @@ +def clean_builddir(d): + from shutil import rmtree + + builddir = d.getVar("B", True) + srcdir = d.getVar("S", True) + if builddir != srcdir: + rmtree(builddir, ignore_errors=True) + +def clean_stamps(d): + from glob import glob + from bb import note + from bb.data import expand + from os import unlink + + note("Removing stamps") + for stamp in glob(expand('${STAMP}.*', d)): + try: + unlink(stamp) + except OSError: + pass + +def clean_workdir(d): + from shutil import rmtree + from bb import note + + workdir = d.getVar("WORKDIR", 1) + note("Removing %s" % workdir) + rmtree(workdir, ignore_errors=True) + +def clean_git(d): + from subprocess import call + + call(["git", "clean", "-d", "-f", "-X"], cwd=d.getVar("S", True)) + +def clean_make(d): + import bb + + bb.note("Running make clean") + try: + bb.build.exec_func("__do_clean_make", d) + except bb.build.FuncFailed: + pass + +__do_clean_make () { + oe_runmake clean +} + +python do_clean () { + clean_stamps(d) + clean_workdir(d) + clean_builddir(d) + clean_make(d) +} diff --git a/classes/srctree.bbclass b/classes/srctree.bbclass index 67cb9ffe8c..ce9cb834bb 100644 --- a/classes/srctree.bbclass +++ b/classes/srctree.bbclass @@ -14,29 +14,13 @@ # operation. +# Grab convenience methods & sane default for do_clean +inherit clean + +# Build here S = "${FILE_DIRNAME}" SRC_URI = "" -#TYPE = "${@'${PN}'.replace('${BPN}', '').strip()}" -#WORKDIR = "${S}/tmp${TYPE}.${MULTIMACH_HOST_SYS}" -#STAMP = "${WORKDIR}/tasks/stamp" -#WORKDIR_LOCAL = "${S}/tmp${TYPE}.${MULTIMACH_HOST_SYS}" -#T = "${WORKDIR_LOCAL}/bitbake-tasks" - -# Hack, so things don't explode in builds that don't inherit package -do_package ?= " pass" -do_package[func] = "1" -do_package[python] = "1" -addtask package after do_populate_staging - -# This stuff is needed to facilitate variants (normal, native, cross, sdk) -# that share a ${S}. It's ugly as hell. Only really necessary for recipes -# that can't use a ${B}, and which have variants like native. Not sure what -# the best solution is long term. -# -# We merge configure+compile+install into the populate_staging task, uses a -# lock file. This ensures that none of the tasks which access ${S} can -# interleave amongst the recipes that share that ${S}. def merge_tasks(d): """ @@ -130,56 +114,8 @@ python do_populate_staging () { } do_populate_staging[lockfiles] += "${S}/.lock" -make_do_clean () { - oe_runmake clean -} - -def clean_builddir(d): - from shutil import rmtree - - builddir = d.getVar("B", True) - srcdir = d.getVar("S", True) - if builddir != srcdir: - rmtree(builddir, ignore_errors=True) - -def clean_stamps(d): - from glob import glob - from bb import note - from bb.data import expand - from os import unlink - - note("Removing stamps") - for stamp in glob(expand('${STAMP}.*', d)): - try: - unlink(stamp) - except OSError: - pass - -def clean_workdir(d): - from shutil import rmtree - from bb import note - - workdir = d.getVar("WORKDIR", 1) - note("Removing %s" % workdir) - rmtree(workdir, ignore_errors=True) - -def clean_git(d): - from subprocess import call - - call(["git", "clean", "-d", "-f", "-X"], cwd=d.getVar("S", True)) - -def clean_make(d): - import bb - - bb.note("Running make clean") - try: - bb.build.exec_func("make_do_clean", d) - except bb.build.FuncFailed: - pass - -python do_clean () { - clean_stamps(d) - clean_workdir(d) - clean_builddir(d) - clean_make(d) -} +# Hack, so things don't explode in builds that don't inherit package +do_package ?= " pass" +do_package[func] = "1" +do_package[python] = "1" +addtask package after do_populate_staging -- cgit v1.2.3 From 4cd5e9101dbefdefa183e4103989819893b2ffea Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Wed, 26 Aug 2009 15:31:03 -0700 Subject: base.bbclass: add cleanall task. Can be particularly useful when using multiple srctree recipes. Signed-off-by: Chris Larson --- classes/base.bbclass | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index a350b38850..97ccf5dfc3 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -523,6 +523,12 @@ python base_do_clean() { os.system('rm -f '+ dir) } +python do_cleanall() { + pass +} +do_cleanall[recrdeptask] = "do_clean" +addtask cleanall after do_clean + #Uncomment this for bitbake 1.8.12 #addtask rebuild after do_${BB_DEFAULT_TASK} addtask rebuild -- cgit v1.2.3 From 09b6a74a6f03bb114cbc3620b00ce60cbd17ab0b Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Wed, 26 Aug 2009 15:32:30 -0700 Subject: srctree: prefix messages with ${PF} and kill do_package hacks. Signed-off-by: Chris Larson --- classes/srctree.bbclass | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'classes') diff --git a/classes/srctree.bbclass b/classes/srctree.bbclass index ce9cb834bb..dbf8ad2c3f 100644 --- a/classes/srctree.bbclass +++ b/classes/srctree.bbclass @@ -106,16 +106,10 @@ python do_populate_staging () { rec_exec_task(dep, seen) seen.add(task) #if not exists("%s.%s" % (stamp, task)): - note("Executing task %s" % task) + note("%s: executing task %s" % (d.getVar("PF", True), task)) exec_task(task, d) rec_exec_task("do_install", set()) exec_func("do_stage", d) } do_populate_staging[lockfiles] += "${S}/.lock" - -# Hack, so things don't explode in builds that don't inherit package -do_package ?= " pass" -do_package[func] = "1" -do_package[python] = "1" -addtask package after do_populate_staging -- cgit v1.2.3 From 42dc52e38db1fd2c57dadec26ca54a9f4a6db1aa Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 27 Aug 2009 11:04:07 -0700 Subject: Add task-metadata-track.bbclass, for tracking task changes to metadata. This class uses events to capture the state of the datastore when the task starts, and after it completes. It diffs those captured states, and emits messages showing which variables changed, and what their values were changed to. It provides a mechanism to blacklist variables you expect to change, both globally and on a per-task basis. Signed-off-by: Chris Larson --- classes/task-metadata-track.bbclass | 96 +++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 classes/task-metadata-track.bbclass (limited to 'classes') diff --git a/classes/task-metadata-track.bbclass b/classes/task-metadata-track.bbclass new file mode 100644 index 0000000000..d3622aef68 --- /dev/null +++ b/classes/task-metadata-track.bbclass @@ -0,0 +1,96 @@ +# Copyright (C) 2009 Chris Larson +# Released under the MIT license (see COPYING.MIT for the terms) +# +# This class uses events to capture the state of the datastore when the task +# starts, and after it completes. It diffs those captured states, and emits +# messages showing which variables changed, and what their values were changed +# to. +# +# It provides a mechanism to blacklist variables you expect to change, both +# globally and on a per-task basis. +# +# Known instances of tasks changing metadata: +# +# PSTAGE_PKGMANAGER changes by calls to pstage_set_pkgmanager in: +# do_clean, do_setscene, do_package_stage +# +# Subpackage metadata, read by the pkgdata functions in base.bbclass, in: +# do_package, do_package_stage, do_package_write_* + + +TASK_METADATA_BLACKLIST = "\ + __RUNQUEUE_DO_NOT_USE_EXTERNALLY \ +" + +#TASK_METADATA_BLACKLIST_do_clean = "\ +# PSTAGE_PKGMANAGER \ +#" + + +def dict_diff(olddict, newdict): + diff = {} + for key in set(olddict).union(set(newdict)): + old = olddict.get(key) + new = newdict.get(key) + if old != new: + diff[key] = (old, new) + + return diff + +def dict_for_data(data): + newdict = {} + for key in data.keys(): + newdict[key] = data.getVar(key, False) + return newdict + +def task_metadata_track_start(task, data): + originaldata = dict_for_data(data) + data.setVar("__originaldata_%s" % task, originaldata) + +def task_metadata_track_stop(task, data): + from bb import note + + pf = data.getVar("PF", True) + def emit(msg): + note("%s: %s" % (pf, msg)) + + originaldata = data.getVar("__originaldata_%s" % task, False) + newdata = dict_for_data(data) + blacklist = data.getVar("TASK_METADATA_BLACKLIST", True).split() + \ + (data.getVar("TASK_METADATA_BLACKLIST_%s" % task, True) or "").split() + + diff = dict_diff(originaldata, newdata) + diff_clean = [key for key in diff \ + if not key in blacklist and \ + not key.startswith("__originaldata_")] + + if diff_clean: + emit("Variables changed by %s:" % task) + for key in diff_clean: + (old, new) = diff[key] + emit(" %s:" % key) + emit(" '%s' -> '%s'" % (old, new)) + +python __task_metadata_track_eh () { + from bb.build import TaskStarted, TaskSucceeded + + if isinstance(e, TaskStarted): + if e.data is None: + from bb import fatal + fatal("e.data is none for %s" % e) + task_metadata_track_start(e.task, e.data) + elif isinstance(e, TaskSucceeded): + task_metadata_track_stop(e.task, e.data) +} +addhandler __task_metadata_track_eh + +addtask py_listtasks +do_py_listtasks[nostamp] = "1" +do_py_listtasks[recrdeptask] = "do_py_listtasks" +python do_py_listtasks() { + import sys + for e in d.keys(): + if d.getVarFlag(e, "task") and \ + d.getVarFlag(e, "python"): + sys.stdout.write("%s\n" % e) +} -- cgit v1.2.3 From e6bdc929a0281e3bc5d69c099d37bf4d1f2bae23 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 29 Aug 2009 14:42:42 -0700 Subject: base.bbclass: Pass in PATH to popen. On Mac OSX its not able to find md5sum if path is not passed to os.popen shell. Signed-off-by: Khem Raj Acked-by: Koen Kooi --- classes/base.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 97ccf5dfc3..d29ba4bfcf 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -84,7 +84,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath, data): # call md5(sum) and shasum try: - md5pipe = os.popen('md5sum ' + localpath) + md5pipe = os.popen('PATH=%s md5sum %s' % (bb.data.getVar('PATH', data, True), localpath)) md5data = (md5pipe.readline().split() or [ "" ])[0] md5pipe.close() except OSError: -- cgit v1.2.3 From a5c9970599cbfe15b776cbb57cb9b1b06fbdcb1c Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 17 Aug 2009 15:14:28 -0400 Subject: package_deb: create md5sums control files These are created with the package and get installed in /var/dpkg/info. Afterward it's a great way to find modified files for backup with a little shell script magic. It feels a bit weird to still use MD5, but that seems to be the convention in the Debian world. Signed-off-by: Michael Smith Acked-by: Chris Larson --- classes/package.bbclass | 45 +++++++++++++++++++++++++++++++++++++++++++++ classes/package_deb.bbclass | 7 +++++++ 2 files changed, 52 insertions(+) (limited to 'classes') diff --git a/classes/package.bbclass b/classes/package.bbclass index f6bd7c5b4a..5a9fa503ae 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -202,6 +202,51 @@ def runstrip(file, d): return 1 +def write_package_md5sums (root, outfile, ignorepaths): + # For each regular file under root, writes an md5sum to outfile. + # With thanks to patch.bbclass. + import bb, os + + try: + # Python 2.5+ + import hashlib + ctor = hashlib.md5 + except ImportError: + import md5 + ctor = md5.new + + outf = file(outfile, 'w') + + # Each output line looks like: " " + striplen = len(root) + if not root.endswith('/'): + striplen += 1 + + for walkroot, dirs, files in os.walk(root): + # Skip e.g. the DEBIAN directory + if walkroot[striplen:] in ignorepaths: + dirs[:] = [] + continue + + for name in files: + fullpath = os.path.join(walkroot, name) + if os.path.islink(fullpath) or (not os.path.isfile(fullpath)): + continue + + m = ctor() + f = file(fullpath, 'rb') + while True: + d = f.read(8192) + if not d: + break + m.update(d) + f.close() + + print >> outf, "%s %s" % (m.hexdigest(), fullpath[striplen:]) + + outf.close() + + # # Package data handling routines # diff --git a/classes/package_deb.bbclass b/classes/package_deb.bbclass index e5339a9064..4a17010538 100644 --- a/classes/package_deb.bbclass +++ b/classes/package_deb.bbclass @@ -243,6 +243,13 @@ python do_package_deb () { conffiles.write('%s\n' % f) conffiles.close() + try: + write_package_md5sums(root, os.path.join(controldir, 'md5sums'), + ['DEBIAN']) + except: + bb.utils.unlockfile(lf) + raise + os.chdir(basedir) ret = os.system("PATH=\"%s\" fakeroot dpkg-deb -b %s %s" % (bb.data.getVar("PATH", localdata, 1), root, pkgoutdir)) if ret != 0: -- cgit v1.2.3 From c73cd5fdeb25c5cd4cfa316e2dd59304a776f7af Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 2 Sep 2009 23:15:58 +0200 Subject: gnome bbclass: remove to more auto generated cruft that breaks package management --- classes/gnome.bbclass | 1 + 1 file changed, 1 insertion(+) (limited to 'classes') diff --git a/classes/gnome.bbclass b/classes/gnome.bbclass index da88884dde..3d04298ac6 100644 --- a/classes/gnome.bbclass +++ b/classes/gnome.bbclass @@ -23,5 +23,6 @@ gnome_stage_includes() { do_install_append() { rm -rf ${D}${localstatedir}/lib/scrollkeeper/* + rm -f ${D}${datadir}/applications/*.cache } -- cgit v1.2.3 From 558f6d44365f062523fbba3926ab46e5cd1984b8 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 3 Sep 2009 15:22:46 -0700 Subject: OpenEmbedded: Switch to using linux-uclibceabi and linux-gnu for TARGET_OS * Bump the ABI_LAYOUT. Build from scratch will be needed. * Replace using TARGET_OS from linux->linux-gnu. * Replace using linux-uclibcgnueabi->linux-uclibceabi. * Add 'eabi' to DISTRO_FEATURES (only for minimal and micro). * Use eabi and BASE_PACKAGE_ARCH to compute real TARGET_OS. * Fix the micro conf to get console image building. * Fix the linux-uclibcgnueabi overrides in all recipes. Signed-off-by: Khem Raj Acked-by: Phill Blundell Acked-by: Michael 'Mickey' Lauer --- classes/insane.bbclass | 2 +- classes/qmake_base.bbclass | 2 +- classes/siteinfo.bbclass | 22 ++++++++++++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) (limited to 'classes') diff --git a/classes/insane.bbclass b/classes/insane.bbclass index 606270d62c..c41b84a4c0 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -73,7 +73,7 @@ def package_qa_get_machine_dict(): "arm" : (40, 0, 0, True, True), "armeb" : (40, 0, 0, False, True), }, - "linux-uclibcgnueabi" : { + "linux-uclibceabi" : { "arm" : (40, 0, 0, True, True), "armeb" : (40, 0, 0, False, True), }, diff --git a/classes/qmake_base.bbclass b/classes/qmake_base.bbclass index 5eccfa47e4..50d8bb53da 100644 --- a/classes/qmake_base.bbclass +++ b/classes/qmake_base.bbclass @@ -33,7 +33,7 @@ oe_qmake_mkspecs () { qmake_base_do_configure() { case ${QMA