diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/autotools.bbclass | 62 | ||||
-rw-r--r-- | classes/base.bbclass | 20 | ||||
-rw-r--r-- | classes/cpan.bbclass | 13 | ||||
-rw-r--r-- | classes/image.bbclass | 6 | ||||
-rw-r--r-- | classes/insane.bbclass | 20 | ||||
-rw-r--r-- | classes/native.bbclass | 7 | ||||
-rw-r--r-- | classes/package.bbclass | 44 | ||||
-rw-r--r-- | classes/package_deb.bbclass | 18 | ||||
-rw-r--r-- | classes/package_ipk.bbclass | 29 | ||||
-rw-r--r-- | classes/packaged-staging.bbclass | 223 | ||||
-rw-r--r-- | classes/qmake2.bbclass | 2 | ||||
-rw-r--r-- | classes/qtopia4core.bbclass | 2 | ||||
-rw-r--r-- | classes/rm_work.bbclass | 4 | ||||
-rw-r--r-- | classes/rootfs_deb.bbclass | 19 | ||||
-rw-r--r-- | classes/rootfs_ipk.bbclass | 30 | ||||
-rw-r--r-- | classes/seppuku.bbclass | 17 | ||||
-rw-r--r-- | classes/siteinfo.bbclass | 61 | ||||
-rw-r--r-- | classes/testlab.bbclass | 14 |
18 files changed, 384 insertions, 207 deletions
diff --git a/classes/autotools.bbclass b/classes/autotools.bbclass index 4f3e0b1c4d..1f03825b92 100644 --- a/classes/autotools.bbclass +++ b/classes/autotools.bbclass @@ -1,5 +1,8 @@ inherit base +# use autotools_stage_all for native packages +AUTOTOOLS_NATIVE_STAGE_INSTALL = "1" + def autotools_dep_prepend(d): import bb; @@ -17,7 +20,6 @@ def autotools_dep_prepend(d): deps += 'libtool-native ' if not bb.data.inherits_class('native', d) \ and not bb.data.inherits_class('cross', d) \ - and not bb.data.inherits_class('sdk', d) \ and not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, 1): deps += 'libtool-cross ' @@ -56,6 +58,7 @@ oe_runconf () { --oldincludedir=${oldincludedir} \ --infodir=${infodir} \ --mandir=${mandir} \ + --enable-mainainer-mode \ ${EXTRA_OECONF} \ $@" oenote "Running $cfgcmd..." @@ -162,6 +165,17 @@ autotools_stage_includes() { fi } +autotools_stage_dir() { + from="$1" + to="$2" + # This will remove empty directories so we can ignore them + rmdir "$from" 2> /dev/null || true + if [ -d "$from" ]; then + mkdir -p "$to" + cp -fpPR -t "$to" "$from"/* + fi +} + autotools_stage_all() { if [ "${INHIBIT_AUTO_STAGE}" = "1" ] then @@ -170,26 +184,40 @@ autotools_stage_all() { rm -rf ${STAGE_TEMP} mkdir -p ${STAGE_TEMP} oe_runmake DESTDIR="${STAGE_TEMP}" install - if [ -d ${STAGE_TEMP}/${includedir} ]; then - cp -fpPR ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR} + autotools_stage_dir ${STAGE_TEMP}/${includedir} ${STAGING_INCDIR} + if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then + autotools_stage_dir ${STAGE_TEMP}/${bindir} ${STAGING_DIR_HOST}${layout_bindir} + autotools_stage_dir ${STAGE_TEMP}/${sbindir} ${STAGING_DIR_HOST}${layout_sbindir} + autotools_stage_dir ${STAGE_TEMP}/${base_bindir} ${STAGING_DIR_HOST}${layout_base_bindir} + autotools_stage_dir ${STAGE_TEMP}/${base_sbindir} ${STAGING_DIR_HOST}${layout_base_sbindir} + autotools_stage_dir ${STAGE_TEMP}/${libexecdir} ${STAGING_DIR_HOST}${layout_libexecdir} fi if [ -d ${STAGE_TEMP}/${libdir} ] then - find ${STAGE_TEMP}/${libdir} -name '*.la' -exec sed -i s,installed=yes,installed=no, {} \; - - for i in ${STAGE_TEMP}/${libdir}/*.la - do - if [ ! -f "$i" ]; then - cp -fpPR ${STAGE_TEMP}/${libdir}/* ${STAGING_LIBDIR} - break - fi - oe_libinstall -so $(basename $i .la) ${STAGING_LIBDIR} - done - fi - if [ -d ${STAGE_TEMP}/${datadir}/aclocal ]; then - install -d ${STAGING_DATADIR}/aclocal - cp -fpPR ${STAGE_TEMP}/${datadir}/aclocal/* ${STAGING_DATADIR}/aclocal + olddir=`pwd` + cd ${STAGE_TEMP}/${libdir} + las=$(find . -name \*.la -type f) + cd $olddir + echo "Found la files: $las" + if [ -n "$las" ]; then + # If there are .la files then libtool was used in the + # build, so install them with magic mangling. + for i in $las + do + dir=$(dirname $i) + echo "oe_libinstall -C ${S} -so $(basename $i .la) ${STAGING_LIBDIR}/${dir}" + oe_libinstall -C ${S} -so $(basename $i .la) ${STAGING_LIBDIR}/${dir} + done + else + # Otherwise libtool wasn't used, and lib/ can be copied + # directly. + echo "cp -fpPR ${STAGE_TEMP}/${libdir}/* ${STAGING_LIBDIR}" + cp -fpPR ${STAGE_TEMP}/${libdir}/* ${STAGING_LIBDIR} + fi fi + rm -rf ${STAGE_TEMP}/${mandir} || true + rm -rf ${STAGE_TEMP}/${infodir} || true + autotools_stage_dir ${STAGE_TEMP}/${datadir} ${STAGING_DATADIR} rm -rf ${STAGE_TEMP} } diff --git a/classes/base.bbclass b/classes/base.bbclass index 615d02d07e..c2ce508538 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -325,6 +325,7 @@ oe_libinstall() { __runcmd rm -f $destpath/$libname.la __runcmd sed -e 's/^installed=yes$/installed=no/' \ -e '/^dependency_libs=/s,${WORKDIR}[[:alnum:]/\._+-]*/\([[:alnum:]\._+-]*\),${STAGING_LIBDIR}/\1,g' \ + -e "/^dependency_libs=/s,\([[:space:]']+\)${libdir},\1${STAGING_LIBDIR},g" \ $dotlai >$destpath/$libname.la else __runcmd install -m 0644 $dotlai $destpath/$libname.la @@ -367,6 +368,25 @@ oe_libinstall() { __runcmd cd "$olddir" } +def package_stagefile(file, d): + import bb, os + + if bb.data.getVar('PSTAGING_ACTIVE', d, True) == "1": + destfile = file.replace(bb.data.getVar("TMPDIR", d, 1), bb.data.getVar("PSTAGE_TMPDIR_STAGE", d, 1)) + bb.mkdirhier(os.path.dirname(destfile)) + #print "%s to %s" % (file, destfile) + bb.copyfile(file, destfile) + +package_stagefile_shell() { + if [ "$PSTAGING_ACTIVE" = "1" ]; then + srcfile=$1 + destfile=`echo $srcfile | sed s#${TMPDIR}#${PSTAGE_TMPDIR_STAGE}#` + destdir=`dirname $destfile` + mkdir -p $destdir + cp -dp $srcfile $destfile + fi +} + oe_machinstall() { # Purpose: Install machine dependent files, if available # If not available, check if there is a default diff --git a/classes/cpan.bbclass b/classes/cpan.bbclass index 5a0b4a5c92..506d4c4c81 100644 --- a/classes/cpan.bbclass +++ b/classes/cpan.bbclass @@ -50,7 +50,16 @@ cpan_do_compile () { } cpan_do_install () { - oe_runmake install_vendor + if [ ${@is_target(d)} == "yes" ]; then + oe_runmake install_vendor + fi +} + +cpan_do_stage () { + if [ ${@is_target(d)} == "no" ]; then + oe_runmake install_vendor + fi } + -EXPORT_FUNCTIONS do_configure do_compile do_install +EXPORT_FUNCTIONS do_configure do_compile do_install do_stage diff --git a/classes/image.bbclass b/classes/image.bbclass index 67a3a4fa10..f8d896d813 100644 --- a/classes/image.bbclass +++ b/classes/image.bbclass @@ -85,8 +85,6 @@ fakeroot do_rootfs () { insert_feed_uris - rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/lists/* - ${IMAGE_PREPROCESS_COMMAND} export TOPDIR=${TOPDIR} @@ -132,7 +130,7 @@ insert_feed_uris () { echo "Added $feed_name feed with URL $feed_uri" # insert new feed-sources - echo "src/gz $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/ipkg/${feed_name}-feed.conf + echo "src/gz $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/opkg/${feed_name}-feed.conf done # Allow to use package deploy directory contents as quick devel-testing @@ -142,7 +140,7 @@ insert_feed_uris () { if [ -n "${FEED_DEPLOYDIR_BASE_URI}" ]; then for arch in ${PACKAGE_ARCHS} do - echo "src/gz local-$arch ${FEED_DEPLOYDIR_BASE_URI}/$arch" >> ${IMAGE_ROOTFS}/etc/ipkg/local-$arch-feed.conf + echo "src/gz local-$arch ${FEED_DEPLOYDIR_BASE_URI}/$arch" >> ${IMAGE_ROOTFS}/etc/opkg/local-$arch-feed.conf done fi } diff --git a/classes/insane.bbclass b/classes/insane.bbclass index 5ff49cd65e..1f7c761b47 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -162,7 +162,7 @@ def package_qa_get_elf(path, bits32): # 2 - package depends on debug package # 3 - non dbg contains .so # 4 - wrong architecture -# 5 - .la contains installed=yes +# 5 - .la contains installed=yes or reference to the workdir # 6 - .pc contains reference to /usr/include or workdir # 7 - the desktop file is not valid # 8 - .la contains reference to the workdir @@ -178,7 +178,7 @@ def package_qa_make_fatal_error(error_class, name, path,d): TODO: Load a whitelist of known errors """ - return not error_class in [0, 5, 7, 8] + return not error_class in [0, 5, 7] def package_qa_write_error(error_class, name, path, d): """ @@ -313,9 +313,8 @@ def package_qa_check_desktop(path, name, d): import bb, os sane = True if path.endswith(".desktop"): - validate = os.path.join(bb.data.getVar('STAGING_BINDIR_NATIVE',d,True), \ - 'desktop-file-validate') - output = os.popen("%s %s" % (validate, path)) + output = os.popen("desktop-file-validate %s" % path) + # This only produces output on errors for l in output: sane = package_qa_handle_error(7, l.strip(), name, path, d) @@ -336,11 +335,10 @@ def package_qa_check_staged(path,d): tmpdir = bb.data.getVar('TMPDIR', d, True) workdir = os.path.join(tmpdir, "work") + installed = "installed=yes" if bb.data.inherits_class("native", d) or bb.data.inherits_class("cross", d): - installed = "installed=no" pkgconfigcheck = workdir else: - installed = "installed=yes" pkgconfigcheck = tmpdir # find all .la and .pc files @@ -351,9 +349,11 @@ def package_qa_check_staged(path,d): path = os.path.join(root,file) if file[-2:] == "la": file_content = open(path).read() - if installed in file_content: - error_msg = "%s failed sanity test (installed) in path %s" % (file,root) - sane = package_qa_handle_error(5, error_msg, "staging", path, d) + # Don't check installed status for native/cross packages + if not bb.data.inherits_class("native", d) and not bb.data.inherits_class("cross", d): + if installed in file_content: + error_msg = "%s failed sanity test (installed) in path %s" % (file,root) + sane = package_qa_handle_error(5, error_msg, "staging", path, d) if workdir in file_content: error_msg = "%s failed sanity test (workdir) in path %s" % (file,root) sane = package_qa_handle_error(8, error_msg, "staging", path, d) diff --git a/classes/native.bbclass b/classes/native.bbclass index 63e9741397..4022cb09c0 100644 --- a/classes/native.bbclass +++ b/classes/native.bbclass @@ -76,7 +76,12 @@ export oldincludedir = "${STAGING_DIR_NATIVE}${layout_includedir}" do_stage () { if [ "${INHIBIT_NATIVE_STAGE_INSTALL}" != "1" ] then - oe_runmake install + if [ "${AUTOTOOLS_NATIVE_STAGE_INSTALL}" != "1" ] + then + oe_runmake install + else + autotools_stage_all + fi fi } diff --git a/classes/package.bbclass b/classes/package.bbclass index 325c0b52f5..eb43856c55 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -152,7 +152,7 @@ def runstrip(file, d): # If the file is in a .debug directory it was already stripped, # don't do it again... if os.path.dirname(file).endswith(".debug"): - bb.note("Already run strip") + bb.note("Already ran strip") return 0 strip = bb.data.getVar("STRIP", d, 1) @@ -472,24 +472,31 @@ python emit_pkgdata() { if val: f.write('%s_%s: %s\n' % (var, pkg, encode(val))) - packages = bb.data.getVar('PACKAGES', d, 1) + packages = bb.data.getVar('PACKAGES', d, True) + pkgdatadir = bb.data.getVar('PKGDATA_DIR', d, True) + + pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True) + if pstageactive == "1": + lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d)) - data_file = bb.data.expand("${PKGDATA_DIR}/${PN}", d) + data_file = pkgdatadir + bb.data.expand("/${PN}" , d) f = open(data_file, 'w') f.write("PACKAGES: %s\n" % packages) f.close() + package_stagefile(data_file, d) workdir = bb.data.getVar('WORKDIR', d, 1) for pkg in packages.split(): - subdata_file = bb.data.expand("${PKGDATA_DIR}/runtime/%s" % pkg, d) + subdata_file = pkgdatadir + "/runtime/%s" % pkg sf = open(subdata_file, 'w') + write_if_exists(sf, pkg, 'PN') + write_if_exists(sf, pkg, 'PR') write_if_exists(sf, pkg, 'DESCRIPTION') write_if_exists(sf, pkg, 'RDEPENDS') write_if_exists(sf, pkg, 'RPROVIDES') write_if_exists(sf, pkg, 'RRECOMMENDS') write_if_exists(sf, pkg, 'RSUGGESTS') - write_if_exists(sf, pkg, 'RPROVIDES') write_if_exists(sf, pkg, 'RREPLACES') write_if_exists(sf, pkg, 'RCONFLICTS') write_if_exists(sf, pkg, 'PKG') @@ -501,6 +508,10 @@ python emit_pkgdata() { write_if_exists(sf, pkg, 'pkg_prerm') sf.close() + package_stagefile(subdata_file, d) + #if pkgdatadir2: + # bb.copyfile(subdata_file, pkgdatadir2 + "/runtime/%s" % pkg) + allow_empty = bb.data.getVar('ALLOW_EMPTY_%s' % pkg, d, 1) if not allow_empty: allow_empty = bb.data.getVar('ALLOW_EMPTY', d, 1) @@ -508,8 +519,11 @@ python emit_pkgdata() { os.chdir(root) g = glob('*') if g or allow_empty == "1": - packagedfile = bb.data.expand('${PKGDATA_DIR}/runtime/%s.packaged' % pkg, d) + packagedfile = pkgdatadir + '/runtime/%s.packaged' % pkg file(packagedfile, 'w').close() + package_stagefile(packagedfile, d) + if pstageactive == "1": + bb.utils.unlockfile(lf) } emit_pkgdata[dirs] = "${PKGDATA_DIR}/runtime" @@ -549,6 +563,10 @@ python package_do_shlibs() { shlibs_dir = bb.data.getVar('SHLIBSDIR', d, 1) bb.mkdirhier(shlibs_dir) + pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True) + if pstageactive == "1": + lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d)) + needed = {} private_libs = bb.data.getVar('PRIVATE_LIBS', d, 1) for pkg in packages.split(): @@ -590,9 +608,11 @@ python package_do_shlibs() { for s in sonames: fd.write(s + '\n') fd.close() + package_stagefile(shlibs_file, d) fd = open(shver_file, 'w') fd.write(ver + '\n') fd.close() + package_stagefile(shver_file, d) if needs_ldconfig: bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg) postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) @@ -601,6 +621,9 @@ python package_do_shlibs() { postinst += bb.data.getVar('ldconfig_postinst_fragment', d, 1) bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) + if pstageactive == "1": + bb.utils.unlockfile(lf) + shlib_provider = {} list_re = re.compile('^(.*)\.list$') for dir in [shlibs_dir]: @@ -715,6 +738,10 @@ python package_do_pkgconfig () { if hdr == 'Requires': pkgconfig_needed[pkg] += exp.replace(',', ' ').split() + pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True) + if pstageactive == "1": + lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d)) + for pkg in packages.split(): pkgs_file = os.path.join(shlibs_dir, pkg + ".pclist") if os.path.exists(pkgs_file): @@ -724,6 +751,7 @@ python package_do_pkgconfig () { for p in pkgconfig_provided[pkg]: f.write('%s\n' % p) f.close() + package_stagefile(pkgs_file, d) for dir in [shlibs_dir]: if not os.path.exists(dir): @@ -758,6 +786,10 @@ python package_do_pkgconfig () { for dep in deps: fd.write(dep + '\n') fd.close() + package_stagefile(deps_file, d) + + if pstageactive == "1": + bb.utils.unlockfile(lf) } python read_shlibdeps () { diff --git a/classes/package_deb.bbclass b/classes/package_deb.bbclass index 22b6166685..e59d194aeb 100644 --- a/classes/package_deb.bbclass +++ b/classes/package_deb.bbclass @@ -88,20 +88,13 @@ python do_package_deb () { return bb.mkdirhier(dvar) - packages = bb.data.getVar('PACKAGES', d, 1) - if not packages: - bb.debug(1, "PACKAGES not defined, nothing to package") - return tmpdir = bb.data.getVar('TMPDIR', d, 1) if os.access(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"),os.R_OK): os.unlink(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN")) - if packages == []: - bb.debug(1, "No packages; nothing to do") - return - + packages = bb.data.getVar('PACKAGES', d, 1) for pkg in packages.split(): localdata = bb.data.createCopy(d) pkgdest = bb.data.getVar('PKGDEST', d, 1) @@ -273,8 +266,13 @@ python () { } python do_package_write_deb () { - bb.build.exec_func("read_subpackage_metadata", d) - bb.build.exec_func("do_package_deb", d) + packages = bb.data.getVar('PACKAGES', d, True) + if not packages: + bb.debug(1, "No PACKAGES defined, nothing to package") + return + + bb.build.exec_func("read_subpackage_metadata", d) + bb.build.exec_func("do_package_deb", d) } do_package_write_deb[dirs] = "${D}" addtask package_write_deb before do_package_write after do_package diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass index 2feaeba3b3..f05b7449cf 100644 --- a/classes/package_ipk.bbclass +++ b/classes/package_ipk.bbclass @@ -1,17 +1,17 @@ inherit package -BOOTSTRAP_EXTRA_RDEPENDS += "ipkg-collateral ipkg" +BOOTSTRAP_EXTRA_RDEPENDS += "opkg-collateral opkg" IMAGE_PKGTYPE ?= "ipk" -IPKGCONF_TARGET = "${STAGING_ETCDIR_NATIVE}/ipkg.conf" -IPKGCONF_SDK = "${STAGING_ETCDIR_NATIVE}/ipkg-sdk.conf" +IPKGCONF_TARGET = "${STAGING_ETCDIR_NATIVE}/opkg.conf" +IPKGCONF_SDK = "${STAGING_ETCDIR_NATIVE}/opkg-sdk.conf" python package_ipk_fn () { from bb import data bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d) } -python package_ipk_install () { +python package_ipk_install () { # # Warning - this function is not multimachine safe (see stagingdir reference)! # @@ -35,7 +35,7 @@ python package_ipk_install () { raise bb.build.FuncFailed # Generate ipk.conf if it or the stamp doesnt exist - conffile = os.path.join(stagingdir,"ipkg.conf") + conffile = os.path.join(stagingdir,"opkg.conf") if not os.access(conffile, os.R_OK): ipkg_archs = bb.data.getVar('PACKAGE_ARCHS',d) if ipkg_archs is None: @@ -60,8 +60,8 @@ python package_ipk_install () { f = open(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),"w") f.close() - ret = os.system('ipkg-cl -o %s -f %s update' % (rootfs, conffile)) - ret = os.system('ipkg-cl -o %s -f %s install %s' % (rootfs, conffile, pkgfn)) + ret = os.system('opkg-cl -o %s -f %s update' % (rootfs, conffile)) + ret = os.system('opkg-cl -o %s -f %s install %s' % (rootfs, conffile, pkgfn)) if (ret != 0 ): raise bb.build.FuncFailed } @@ -137,20 +137,12 @@ python do_package_ipk () { return bb.mkdirhier(dvar) - packages = bb.data.getVar('PACKAGES', d, 1) - if not packages: - bb.debug(1, "PACKAGES not defined, nothing to package") - return - tmpdir = bb.data.getVar('TMPDIR', d, 1) if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK): os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN")) - if packages == []: - bb.debug(1, "No packages; nothing to do") - return - + packages = bb.data.getVar('PACKAGES', d, True) for pkg in packages.split(): localdata = bb.data.createCopy(d) pkgdest = bb.data.getVar('PKGDEST', d, 1) @@ -313,6 +305,11 @@ python () { } python do_package_write_ipk () { + packages = bb.data.getVar('PACKAGES', d, True) + if not packages: + bb.debug(1, "No PACKAGES defined, nothing to package") + return + bb.build.exec_func("read_subpackage_metadata", d) bb.build.exec_func("do_package_ipk", d) } diff --git a/classes/packaged-staging.bbclass b/classes/packaged-staging.bbclass index b564136e3f..1c717b415e 100644 --- a/classes/packaged-staging.bbclass +++ b/classes/packaged-staging.bbclass @@ -4,35 +4,89 @@ # # To use it add that line to conf/local.conf: # -# INHERIT = "packaged-staging" +# INHERIT += "packaged-staging" +# + + +# +# bitbake.conf set PSTAGING_ACTIVE = "0", this class sets to "1" if we're active +# +PSTAGE_PKGVERSION = "${PV}-${PR}" +PSTAGE_PKGARCH = "${BUILD_SYS}" +PSTAGE_EXTRAPATH ?= "" +PSTAGE_PKGPATH = "${DISTRO}${PSTAGE_EXTRAPATH}" +PSTAGE_PKGPN = "${@bb.data.expand('staging-${PN}-${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}', d).replace('_', '-')}" +PSTAGE_PKGNAME = "${PSTAGE_PKGPN}_${PSTAGE_PKGVERSION}_${PSTAGE_PKGARCH}.ipk" +PSTAGE_PKG = "${DEPLOY_DIR_PSTAGE}/${PSTAGE_PKGPATH}/${PSTAGE_PKGNAME}" + +# multimachine.bbclass will override this but add a default in case we're not using it +MULTIMACH_ARCH ?= "${PACKAGE_ARCH}" + +PSTAGE_NATIVEDEPENDS = "\ + pkgconfig-native \ + autoconf-native \ + automake-native \ + curl-native \ + zlib-native \ + libtool-native \ + gnu-config-native \ + shasum-native \ + libtool-native \ + automake-native \ + update-alternatives-cworth-native \ + ipkg-utils-native \ + opkg-native \ + m4-native \ + quilt-native \ + stagemanager-native \ + " python () { import bb - if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('image', d) and not bb.data.inherits_class('cross', d) and not bb.data.inherits_class('sdk', d): + pstage_allowed = True + + # These classes encode staging paths into the binary data so can only be + # reused if the path doesn't change/ + if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('sdk', d): + path = bb.data.getVar('PSTAGE_PKGPATH', d, 1) + path = path + bb.data.getVar('TMPDIR', d, 1).replace('/', '-') + bb.data.setVar('PSTAGE_PKGPATH', path, d) + + # PSTAGE_NATIVEDEPENDS lists the packages we need before we can use packaged + # staging. There will always be some packages we depend on. + if bb.data.inherits_class('native', d): + pn = bb.data.getVar('PN', d, True) + nativedeps = bb.data.getVar('PSTAGE_NATIVEDEPENDS', d, True).split() + if pn in nativedeps: + pstage_allowed = False + + # Images aren't of interest to us + if bb.data.inherits_class('image', d): + pstage_allowed = False + + # Add task dependencies if we're active, otherwise mark packaged staging + # as inactive. + if pstage_allowed: deps = bb.data.getVarFlag('do_populate_staging', 'depends', d) or "" deps += " stagemanager-native:do_populate_staging" bb.data.setVarFlag('do_populate_staging', 'depends', deps, d) deps = bb.data.getVarFlag('do_prepackaged_stage', 'depends', d) or "" - deps += " ipkg-native:do_populate_staging ipkg-utils-native:do_populate_staging" + deps += " opkg-native:do_populate_staging ipkg-utils-native:do_populate_staging" bb.data.setVarFlag('do_prepackaged_stage', 'depends', deps, d) + bb.data.setVar("PSTAGING_ACTIVE", "1", d) else: - bb.data.setVar("PSTAGING_DISABLED", "1", d) + bb.data.setVar("PSTAGING_ACTIVE", "0", d) } -# multimachine.bbclass will override this -MULTIMACH_ARCH ?= "${PACKAGE_ARCH}" - -export PSTAGING_DISABLED = "0" - -DEPLOY_DIR_PSTAGE = "${DEPLOY_DIR}/pstage" +DEPLOY_DIR_PSTAGE = "${DEPLOY_DIR}/pstage" +PSTAGE_MACHCONFIG = "${DEPLOY_DIR_PSTAGE}/opkg.conf" PSTAGE_BUILD_CMD = "${IPKGBUILDCMD}" -PSTAGE_INSTALL_CMD = "ipkg-cl install -force-depends -f ${DEPLOY_DIR_PSTAGE}/ipkg-${MACHINE}.conf -o ${TMPDIR}" -PSTAGE_UPDATE_CMD = "ipkg-cl update -f ${DEPLOY_DIR_PSTAGE}/ipkg-${MACHINE}.conf -o ${TMPDIR}" -PSTAGE_REMOVE_CMD = "ipkg-cl remove -force-depends -f ${DEPLOY_DIR_PSTAGE}/ipkg-${MACHINE}.conf -o ${TMPDIR}" -PSTAGE_LIST_CMD = "ipkg-cl list_installed -f ${DEPLOY_DIR_PSTAGE}/ipkg-${MACHINE}.conf -o ${TMPDIR}" -PSTAGE_PKGNAME = "staging-${PN}_${PV}-${PR}_${MULTIMACH_ARCH}.ipk" +PSTAGE_INSTALL_CMD = "opkg-cl install -force-depends -f ${PSTAGE_MACHCONFIG} -o ${TMPDIR}" +PSTAGE_UPDATE_CMD = "opkg-cl update -f ${PSTAGE_MACHCONFIG} -o ${TMPDIR}" +PSTAGE_REMOVE_CMD = "opkg-cl remove -force-depends -f ${PSTAGE_MACHCONFIG} -o ${TMPDIR}" +PSTAGE_LIST_CMD = "opkg-cl list_installed -f ${PSTAGE_MACHCONFIG} -o ${TMPDIR}" PSTAGE_TMPDIR_STAGE = "${WORKDIR}/staging-pkg" @@ -43,56 +97,50 @@ do_clean_append() { bb.note("Uninstalling package from staging...") path = bb.data.getVar("PATH", d, 1) removecmd = bb.data.getVar("PSTAGE_REMOVE_CMD", d, 1) - removepkg = bb.data.expand("staging-${PN}", d) + removepkg = bb.data.expand("${PSTAGE_PKGPN}", d) ret = os.system("PATH=\"%s\" %s %s" % (path, removecmd, removepkg)) if ret != 0: bb.note("Failure removing staging package") - stagepkg = bb.data.expand("${DEPLOY_DIR_PSTAGE}/${PSTAGE_PKGNAME}", d) + stagepkg = bb.data.expand("${PSTAGE_PKG}", d) bb.note("Removing staging package %s" % stagepkg) - #os.system('rm -rf ' + stagepkg) + os.system('rm -rf ' + stagepkg) } staging_helper () { - #assemble appropriate ipkg.conf - conffile=${DEPLOY_DIR_PSTAGE}/ipkg-${MACHINE}.conf + # Assemble appropriate opkg.conf + conffile=${PSTAGE_MACHCONFIG} mkdir -p ${DEPLOY_DIR_PSTAGE}/pstaging_lists if [ ! -e $conffile ]; then - ipkgarchs="${BUILD_ARCH} all any noarch ${TARGET_ARCH} ${PACKAGE_ARCHS} ${PACKAGE_EXTRA_ARCHS} ${MACHINE}" + ipkgarchs="${BUILD_SYS}" priority=1 for arch in $ipkgarchs; do echo "arch $arch $priority" >> $conffile priority=$(expr $priority + 5) done - echo "src oe-staging file:${DEPLOY_DIR_PSTAGE}" >> $conffile - - OLD_PWD=`pwd` - cd ${DEPLOY_DIR_PSTAGE} - ipkg-make-index -p Packages . - cd ${OLD_PWD} - - ${PSTAGE_UPDATE_CMD} fi } +PSTAGE_TASKS_COVERED = "fetch unpack munge patch configure qa_configure rig_locales compile sizecheck install deploy package populate_staging package_write_deb package_write_ipk package_write package_stage qa_staging" + python do_prepackaged_stage () { import os - if bb.data.getVar("PSTAGING_DISABLED", d, 1) == "1": + if bb.data.getVar("PSTAGING_ACTIVE", d, 1) == "0": bb.build.make_stamp("do_prepackaged_stage", d) return bb.note("Uninstalling any existing package from staging...") path = bb.data.getVar("PATH", d, 1) removecmd = bb.data.getVar("PSTAGE_REMOVE_CMD", d, 1) - removepkg = bb.data.expand("staging-${PN}", d) + removepkg = bb.data.expand("${PSTAGE_PKGPN}", d) lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d)) ret = os.system("PATH=\"%s\" %s %s" % (path, removecmd, removepkg)) bb.utils.unlockfile(lf) if ret != 0: bb.note("Failure attempting to remove staging package") - stagepkg = bb.data.expand("${DEPLOY_DIR_PSTAGE}/${PSTAGE_PKGNAME}", d) + stagepkg = bb.data.expand("${PSTAGE_PKG}", d) if os.path.exists(stagepkg): bb.note("Following speedup\n") @@ -108,24 +156,10 @@ python do_prepackaged_stage () { if ret != 0: bb.note("Failure installing prestage package") - bb.build.make_stamp("do_prepackaged_stage", d) - bb.build.make_stamp("do_fetch", d) - bb.build.make_stamp("do_unpack", d) - bb.build.make_stamp("do_munge", d) - bb.build.make_stamp("do_patch", d) - bb.build.make_stamp("do_configure", d) - bb.build.make_stamp("do_qa_configure", d) - bb.build.make_stamp("do_rig_locales", d) - bb.build.make_stamp("do_compile", d) - bb.build.make_stamp("do_install", d) - bb.build.make_stamp("do_deploy", d) - bb.build.make_stamp("do_package", d) - bb.build.make_stamp("do_populate_staging", d) - bb.build.make_stamp("do_package_write_deb", d) - bb.build.make_stamp("do_package_write_ipk", d) - bb.build.make_stamp("do_package_write", d) - bb.build.make_stamp("do_package_stage", d) - bb.build.make_stamp("do_qa_staging", d) + #bb.build.make_stamp("do_prepackaged_stage", d) + #for task in bb.data.getVar("PSTAGE_TASKS_COVERED", d, 1).split(): + # bb.build.make_stamp("do_" + task, d) + bb.build.make_stamp("do_stage_package_populated", d) else: bb.build.make_stamp("do_prepackaged_stage", d) @@ -134,17 +168,38 @@ do_prepackaged_stage[cleandirs] = "${PSTAGE_TMPDIR_STAGE}" do_prepackaged_stage[selfstamp] = "1" addtask prepackaged_stage before do_fetch -populate_staging_preamble () { - if [ "$PSTAGING_DISABLED" != "1" ]; then - #mkdir -p ${DEPLOY_DIR_PSTAGE} +addhandler packagedstage_stampfixing_eventhandler +python packagedstage_stampfixing_eventhandler() { + from bb.event import getName + import os + + if getName(e) == "StampUpdate": + taskscovered = bb.data.getVar("PSTAGE_TASKS_COVERED", e.data, 1).split() + for (fn, task) in e.targets: + # strip off 'do_' + task = task[3:] + if task in taskscovered: + stamp = "%s.do_stage_package_populated" % e.stampPrefix[fn] + if os.path.exists(stamp): + # We're targetting a task which was skipped with packaged staging + # so we need to remove the autogenerated stamps. + for task in taskscovered: + dir = "%s.do_%s" % (e.stampPrefix[fn], task) + os.system('rm -f ' + dir) + os.system('rm -f ' + stamp) + + return NotHandled +} - stage-manager -p ${STAGING_DIR} -c ${DEPLOY_DIR_PSTAGE}/stamp-cache-staging -u - stage-manager -p ${CROSS_DIR} -c ${DEPLOY_DIR_PSTAGE}/stamp-cache-cross -u +populate_staging_preamble () { + if [ "$PSTAGING_ACTIVE" = "1" ]; then + stage-manager -p ${STAGING_DIR} -c ${DEPLOY_DIR_PSTAGE}/stamp-cache-staging -u || true + stage-manager -p ${CROSS_DIR} -c ${DEPLOY_DIR_PSTAGE}/stamp-cache-cross -u || true fi } populate_staging_postamble () { - if [ "$PSTAGING_DISABLED" != "1" ]; then + if [ "$PSTAGING_ACTIVE" = "1" ]; then # list the packages currently installed in staging ${PSTAGE_LIST_CMD} | awk '{print $1}' > ${DEPLOY_DIR_PSTAGE}/installed-list @@ -169,33 +224,42 @@ python do_populate_staging_append() { staging_packager () { mkdir -p ${PSTAGE_TMPDIR_STAGE}/CONTROL + mkdir -p ${DEPLOY_DIR_PSTAGE}/${PSTAGE_PKGPATH} - echo "Package: staging-${PN}" > ${PSTAGE_TMPDIR_STAGE}/CONTROL/control - echo "Version: ${PV}-${PR}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control + echo "Package: ${PSTAGE_PKGPN}" > ${PSTAGE_TMPDIR_STAGE}/CONTROL/control + echo "Version: ${PSTAGE_PKGVERSION}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control echo "Description: ${DESCRIPTION}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control echo "Section: ${SECTION}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control echo "Priority: Optional" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control echo "Maintainer: ${MAINTAINER}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control - echo "Architecture: ${MULTIMACH_ARCH}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control + echo "Architecture: ${PSTAGE_PKGARCH}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control echo "Source: ${SRC_URI}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control - ${PSTAGE_BUILD_CMD} ${PSTAGE_TMPDIR_STAGE} ${DEPLOY_DIR_PSTAGE} - ${PSTAGE_INSTALL_CMD} ${DEPLOY_DIR_PSTAGE}/${PSTAGE_PKGNAME} + ${PSTAGE_BUILD_CMD} ${PSTAGE_TMPDIR_STAGE} ${DEPLOY_DIR_PSTAGE}/${PSTAGE_PKGPATH} + ${PSTAGE_INSTALL_CMD} ${PSTAGE_PKG} +} + +staging_package_installer () { + ${PSTAGE_INSTALL_CMD} ${PSTAGE_PKG} } python do_package_stage () { - if bb.data.getVar("PSTAGING_DISABLED", d, 1) == "1": + if bb.data.getVar("PSTAGING_ACTIVE", d, 1) != "1": return + # + # Handle deploy/ packages + # bb.build.exec_func("read_subpackage_metadata", d) + stagepath = bb.data.getVar("PSTAGE_TMPDIR_STAGE", d, 1) + tmpdir = bb.data.getVar("TMPDIR", d, True) packages = (bb.data.getVar('PACKAGES', d, 1) or "").split() if len(packages) > 0: - stagepath = bb.data.getVar("PSTAGE_TMPDIR_STAGE", d, 1) if bb.data.inherits_class('package_ipk', d): - ipkpath = os.path.join(stagepath, "deploy", "ipk") + ipkpath = bb.data.getVar('DEPLOY_DIR_IPK', d, True).replace(tmpdir, stagepath) bb.mkdirhier(ipkpath) if bb.data.inherits_class('package_deb', d): - debpath = os.path.join(stagepath, "deploy", "deb") + debpath = bb.data.getVar('DEPLOY_DIR_DEB', d, True).replace(tmpdir, stagepath) bb.mkdirhier(debpath) for pkg in packages: @@ -205,28 +269,45 @@ python do_package_stage () { arch = bb.data.getVar('PACKAGE_ARCH_%s' % pkg, d, 1) if not arch: arch = bb.data.getVar('PACKAGE_ARCH', d, 1) + pr = bb.data.getVar('PR_%s' % pkg, d, 1) + if not pr: + pr = bb.data.getVar('PR', d, 1) if not packaged(pkg, d): continue if bb.data.inherits_class('package_ipk', d): - srcname = bb.data.expand(pkgname + "_${PV}-${PR}_" + arch + ".ipk", d) + srcname = bb.data.expand(pkgname + "_${PV}-" + pr + "_" + arch + ".ipk", d) srcfile = bb.data.expand("${DEPLOY_DIR_IPK}/" + arch + "/" + srcname, d) if not os.path.exists(srcfile): bb.fatal("Package %s does not exist yet it should" % srcfile) bb.copyfile(srcfile, ipkpath + "/" + srcname) if bb.data.inherits_class('package_deb', d): if arch == 'all': - srcname = bb.data.expand(pkgname + "_${PV}-${PR}_all.deb", d) - else: - srcname = bb.data.expand(pkgname + "_${PV}-${PR}_${DPKG_ARCH}.deb", d) + srcname = bb.data.expand(pkgname + "_${PV}-" + pr + "_all.deb", d) + else: + srcname = bb.data.expand(pkgname + "_${PV}-" + pr + "_${DPKG_ARCH}.deb", d) srcfile = bb.data.expand("${DEPLOY_DIR_DEB}/" + arch + "/" + srcname, d) if not os.path.exists(srcfile): bb.fatal("Package %s does not exist yet it should" % srcfile) bb.copyfile(srcfile, debpath + "/" + srcname) + + # + # Handle stamps/ files + # + stampfn = bb.data.getVar("STAMP", d, True) + destdir = os.path.dirname(stampfn.replace(tmpdir, stagepath)) + bb.mkdirhier(destdir) + # We need to include the package_stage stamp in the staging package so create one + bb.build.make_stamp("do_package_stage", d) + os.system("cp %s.do_* %s/" % (stampfn, destdir)) + bb.build.exec_func("staging_helper", d) - lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d)) bb.build.exec_func("staging_packager", d) + lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d)) + bb.build.exec_func("staging_package_installer", d) bb.utils.unlockfile(lf) } +# +# Note an assumption here is that do_deploy runs before do_package_write/do_populate_staging +# addtask package_stage after do_package_write do_populate_staging before do_build - diff --git a/classes/qmake2.bbclass b/classes/qmake2.bbclass index cf3419f824..9ac4945ab4 100644 --- a/classes/qmake2.bbclass +++ b/classes/qmake2.bbclass @@ -14,6 +14,6 @@ export OE_QMAKE_QMAKE = "${STAGING_BINDIR_NATIVE}/qmake2" export OE_QMAKE_LINK = "${CXX}" export OE_QMAKE_CXXFLAGS = "${CXXFLAGS}" export OE_QMAKE_INCDIR_QT = "${STAGING_INCDIR}/qt4" -export OE_QMAKE_LIBDIR_QT = "${STAGING_LIBDIR}/qt4" +export OE_QMAKE_LIBDIR_QT = "${STAGING_LIBDIR}" export OE_QMAKE_LIBS_QT = "qt" export OE_QMAKE_LIBS_X11 = "-lXext -lX11 -lm" diff --git a/classes/qtopia4core.bbclass b/classes/qtopia4core.bbclass index fd8939a23f..c6a05488ef 100644 --- a/classes/qtopia4core.bbclass +++ b/classes/qtopia4core.bbclass @@ -5,7 +5,7 @@ inherit qmake2 # override variables set by qmake-base to compile QtopiaCore apps # export OE_QMAKE_INCDIR_QT = "${STAGING_INCDIR}/qtopia" -export OE_QMAKE_LIBDIR_QT = "${STAGING_LIBDIR}/qtopia" +export OE_QMAKE_LIBDIR_QT = "${STAGING_LIBDIR}" export OE_QMAKE_LIBS_QT = "qt" export OE_QMAKE_LIBS_X11 = "" export OE_QMAKE_EXTRA_MODULES = "network" diff --git a/classes/rm_work.bbclass b/classes/rm_work.bbclass index 97de5e2774..917fadd750 100644 --- a/classes/rm_work.bbclass +++ b/classes/rm_work.bbclass @@ -6,6 +6,10 @@ # INHERIT += "rm_work" # +# Use the completion scheulder by default when rm_work is active +# to try and reduce disk usage +BB_SCHEDULER ?= "completion" + RMWORK_ORIG_TASK := "${BB_DEFAULT_TASK}" BB_DEFAULT_TASK = "rm_work_all" diff --git a/classes/rootfs_deb.bbclass b/classes/rootfs_deb.bbclass index 5237285e4c..3a69b82010 100644 --- a/classes/rootfs_deb.bbclass +++ b/classes/rootfs_deb.bbclass @@ -46,6 +46,7 @@ fakeroot rootfs_deb_do_rootfs () { export D=${IMAGE_ROOTFS} export OFFLINE_ROOT=${IMAGE_ROOTFS} export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} + export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT} mkdir -p ${IMAGE_ROOTFS}/var/lib/dpkg/alternatives @@ -109,22 +110,22 @@ fakeroot rootfs_deb_do_rootfs () { set -e - # Hacks to make dpkg/ipkg coexist for now + # Hacks to make dpkg/opkg coexist for now mv ${IMAGE_ROOTFS}/var/dpkg ${IMAGE_ROOTFS}/usr/ if [ -e ${IMAGE_ROOTFS}/usr/dpkg/alternatives ]; then rmdir ${IMAGE_ROOTFS}/usr/dpkg/alternatives fi - if [ ! -e ${IMAGE_ROOTFS}${libdir}/ipkg ] ; then - mkdir -p ${IMAGE_ROOTFS}${libdir}/ipkg + if [ ! -e ${IMAGE_ROOTFS}${libdir}/opkg ] ; then + mkdir -p ${IMAGE_ROOTFS}${libdir}/opkg fi - if [ ! -e ${IMAGE_ROOTFS}${sysconfdir}/ipkg ] ; then - mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/ipkg + if [ ! -e ${IMAGE_ROOTFS}${sysconfdir}/opkg ] ; then + mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/opkg fi - ln -sf ${libdir}/ipkg/alternatives ${IMAGE_ROOTFS}/usr/dpkg/alternatives - ln -sf /usr/dpkg/info ${IMAGE_ROOTFS}${libdir}/ipkg/info - ln -sf /usr/dpkg/status ${IMAGE_ROOTFS}${libdir}/ipkg/status + ln -sf ${libdir}/opkg/alternatives ${IMAGE_ROOTFS}/usr/dpkg/alternatives + ln -sf /usr/dpkg/info ${IMAGE_ROOTFS}${libdir}/opkg/info + ln -sf /usr/dpkg/status ${IMAGE_ROOTFS}${libdir}/opkg/status ${ROOTFS_POSTPROCESS_COMMAND} @@ -152,6 +153,6 @@ rootfs_deb_log_check() { } remove_packaging_data_files() { - rm -rf ${IMAGE_ROOTFS}${libdir}/ipkg/ + rm -rf ${IMAGE_ROOTFS}${libdir}/opkg/ rm -rf ${IMAGE_ROOTFS}/usr/dpkg/ } diff --git a/classes/rootfs_ipk.bbclass b/classes/rootfs_ipk.bbclass index 28ba03d675..c8e068f739 100644 --- a/classes/rootfs_ipk.bbclass +++ b/classes/rootfs_ipk.bbclass @@ -5,12 +5,12 @@ # See image.bbclass for a usage of this. # -do_rootfs[depends] += "ipkg-native:do_populate_staging ipkg-utils-native:do_populate_staging" +do_rootfs[depends] += "opkg-native:do_populate_staging ipkg-utils-native:do_populate_staging" do_rootfs[recrdeptask] += "do_package_write_ipk" IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} ${@base_conditional("PACKAGE_INSTALL_NO_DEPS", "1", "-nodeps", "", d)}" -DISTRO_EXTRA_RDEPENDS += " ipkg ipkg-collateral " +DISTRO_EXTRA_RDEPENDS += " opkg opkg-collateral " PACKAGE_INSTALL_NO_DEPS ?= "0" fakeroot rootfs_ipk_do_rootfs () { @@ -21,41 +21,45 @@ fakeroot rootfs_ipk_do_rootfs () { mkdir -p ${T} - ipkg-cl ${IPKG_ARGS} update + opkg-cl ${IPKG_ARGS} update # Uclibc builds don't provide this stuff... if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then if [ ! -z "${LINGUAS_INSTALL}" ]; then - ipkg-cl ${IPKG_ARGS} install glibc-localedata-i18n + opkg-cl ${IPKG_ARGS} install glibc-localedata-i18n for i in ${LINGUAS_INSTALL}; do - ipkg-cl ${IPKG_ARGS} install $i + opkg-cl ${IPKG_ARGS} install $i done fi fi if [ ! -z "${PACKAGE_INSTALL}" ]; then - ipkg-cl ${IPKG_ARGS} install ${PACKAGE_INSTALL} + opkg-cl ${IPKG_ARGS} install ${PACKAGE_INSTALL} fi export D=${IMAGE_ROOTFS} export OFFLINE_ROOT=${IMAGE_ROOTFS} export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} - mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/ipkg/ - grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}${sysconfdir}/ipkg/arch.conf + export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT} + + mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/opkg/ + grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}${sysconfdir}/opkg/arch.conf - for i in ${IMAGE_ROOTFS}${libdir}/ipkg/info/*.preinst; do + for i in ${IMAGE_ROOTFS}${libdir}/opkg/info/*.preinst; do if [ -f $i ] && ! sh $i; then - ipkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst` + opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst` fi done - for i in ${IMAGE_ROOTFS}${libdir}/ipkg/info/*.postinst; do + for i in ${IMAGE_ROOTFS}${libdir}/opkg/info/*.postinst; do if [ -f $i ] && ! sh $i configure; then - ipkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst` + opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst` fi done install -d ${IMAGE_ROOTFS}/${sysconfdir} echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version + rm -f ${IMAGE_ROOTFS}${libdir}/opkg/lists/* + ${ROOTFS_POSTPROCESS_COMMAND} log_check rootfs @@ -82,5 +86,5 @@ rootfs_ipk_log_check() { } remove_packaging_data_files() { - rm -rf ${IMAGE_ROOTFS}${libdir}/ipkg/ + rm -rf ${IMAGE_ROOTFS}${libdir}/opkg/ } diff --git a/classes/seppuku.bbclass b/classes/seppuku.bbclass index 2e097a812e..b7aa3e20f1 100644 --- a/classes/seppuku.bbclass +++ b/classes/seppuku.bbclass @@ -228,7 +228,7 @@ def seppuku_file_bug(poster, file, product, component, bugname, text): else: return res[0] -def seppuku_create_attachment(debug, poster, attach_query, product, component, bug_number, text, file): +def seppuku_create_attachment(data, debug, poster, attach_query, product, component, bug_number, text, file): """ Create a new attachment for the failed report @@ -246,9 +246,11 @@ def seppuku_create_attachment(debug, poster, attach_query, product, component, b print >> debug, "Can't create an attachment, no attach_query passed to method" return False + import bb + logdescription = "Build log for machine %s" % (bb.data.getVar('MACHINE', data, True)) import urllib2 - param = { "bugid" : bug_number, "action" : "insert", "data" : file, "description" : "Build log", "ispatch" : "0", "contenttypemethod" : "list", "contenttypeselection" : "text/plain", "comment" : text } + param = { "bugid" : bug_number, "action" : "insert", "data" : file, "description" : logdescription, "ispatch" : "0", "contenttypemethod" : "list", "contenttypeselection" : "text/plain", "comment" : text } try: result = poster.open( attach_query, param ) @@ -329,12 +331,11 @@ python seppuku_eventhandler() { file = None if name == "TaskFailed": - bugname = "%(package)s-%(pv)s-%(pr)s-%(task)s" % { "package" : bb.data.getVar("PN", data, True), + bugname = "%(package)s-%(pv)s-autobuild" % { "package" : bb.data.getVar("PN", data, True), "pv" : bb.data.getVar("PV", data, True), - "pr" : bb.data.getVar("PR", data, True), - "task" : e.task } + } log_file = glob.glob("%s/log.%s.*" % (bb.data.getVar('T', event.data, True), event.task)) - text = "The package failed to build at %s for machine %s" % (bb.data.getVar('DATETIME', data, True), bb.data.getVar( 'MACHINE', data, True ) ) + text = "The %s step in %s failed at %s for machine %s" % (e.task, bb.data.getVar("PN", data, True), bb.data.getVar('DATETIME', data, True), bb.data.getVar( 'MACHINE', data, True ) ) if len(log_file) != 0: print >> debug_file, "Adding log file %s" % log_file[0] file = open(log_file[0], 'r') @@ -351,7 +352,7 @@ python seppuku_eventhandler() { if bug_number and bug_open: print >> debug_file, "The bug is known as '%s'" % bug_number if file: - if not seppuku_create_attachment(debug_file, poster, attach, product, component, bug_number, text, file): + if not seppuku_create_attachment(data, debug_file, poster, attach, product, component, bug_number, text, file): print >> debug_file, "Failed to attach the build log for bug #%s" % bug_number else: print >> debug_file, "Created an attachment for '%s' '%s' '%s'" % (product, component, bug_number) @@ -372,7 +373,7 @@ python seppuku_eventhandler() { print >> debug_file, "The new bug_number: '%s'" % bug_number if bug_number and file: - if not seppuku_create_attachment(debug_file, poster, attach, product, component, bug_number, text, file): + if not seppuku_create_attachment(data, debug_file, poster, attach, product, component, bug_number, text, file): print >> debug_file, "Failed to attach the build log for bug #%s" % bug_number else: print >> debug_file, "Created an attachment for '%s' '%s' '%s'" % (product, component, bug_number) diff --git a/classes/siteinfo.bbclass b/classes/siteinfo.bbclass index a3b67b5798..0d31be4dc4 100644 --- a/classes/siteinfo.bbclass +++ b/classes/siteinfo.bbclass @@ -21,40 +21,39 @@ def get_siteinfo_list(d): target = bb.data.getVar('HOST_ARCH', d, 1) + "-" + bb.data.getVar('HOST_OS', d, 1) targetinfo = {\ - "armeb-linux": "endian-big bit-32 common-glibc arm-common",\ - "armeb-linux-gnueabi": "endian-big bit-32 common-glibc arm-common armeb-linux",\ - "armeb-linux-uclibc": "endian-big bit-32 common-uclibc arm-common",\ - "armeb-linux-uclibcgnueabi": "endian-big bit-32 common-uclibc arm-common armeb-linux-uclibc",\ + "armeb-linux": "endian-big bit-32 common-linux common-glibc arm-common",\ + "armeb-linux-gnueabi": "endian-big bit-32 common-linux common-glibc arm-common armeb-linux",\ + "armeb-linux-uclibc": "endian-big bit-32 common-linux common-uclibc arm-common",\ + "armeb-linux-uclibcgnueabi": "endian-big bit-32 common-linux common-uclibc arm-common armeb-linux-uclibc",\ "arm-darwin": "endian-little bit-32 common-darwin",\ - "arm-linux": "endian-little bit-32 common-glibc arm-common",\ - "arm-linux-gnueabi": "endian-little bit-32 common-glibc arm-common arm-linux",\ - "arm-linux-uclibc": "endian-little bit-32 common-uclibc arm-common",\ - "arm-linux-uclibcgnueabi": "endian-little bit-32 common-uclibc arm-common arm-linux-uclibc",\ - "avr32-linux": "endian-big bit-32 common-glibc avr32-common",\ - "avr32-linux-uclibc": "endian-big bit-32 common-uclibc avr32-common",\ + "arm-linux": "endian-little bit-32 common-linux common-glibc arm-common",\ + "arm-linux-gnueabi": "endian-little bit-32 common-linux common-glibc arm-common arm-linux",\ + "arm-linux-uclibc": "endian-little bit-32 common-linux common-uclibc arm-common",\ + "arm-linux-uclibcgnueabi": "endian-little bit-32 common-linux common-uclibc arm-common arm-linux-uclibc",\ + "avr32-linux-uclibc": "endian-big bit-32 common-linux common-uclibc avr32-common",\ "bfin-uclinux-uclibc": "endian-little bit-32 common-uclibc bfin-common",\ - "i386-linux": "endian-little bit-32 common-glibc ix86-common",\ - "i486-linux": "endian-little bit-32 common-glibc ix86-common",\ - "i586-linux": "endian-little bit-32 common-glibc ix86-common",\ - "i686-linux": "endian-little bit-32 common-glibc ix86-common",\ - "i386-linux-uclibc": "endian-little bit-32 common-uclibc ix86-common",\ - "i486-linux-uclibc": "endian-little bit-32 common-uclibc ix86-common",\ - "i586-linux-uclibc": "endian-little bit-32 common-uclibc ix86-common",\ - "i686-linux-uclibc": "endian-little bit-32 common-uclibc ix86-common",\ - "mipsel-linux": "endian-little bit-32 common-glibc",\ - "mipsel-linux-uclibc": "endian-little bit-32 common-uclibc",\ - "mips-linux": "endian-big bit-32 common-glibc",\ - "mips-linux-uclibc": "endian-big bit-32 common-uclibc",\ + "i386-linux": "endian-little bit-32 common-linux common-glibc ix86-common",\ + "i486-linux": "endian-little bit-32 common-linux common-glibc ix86-common",\ + "i586-linux": "endian-little bit-32 common-linux common-glibc ix86-common",\ + "i686-linux": "endian-little bit-32 common-linux common-glibc ix86-common",\ + "i386-linux-uclibc": "endian-little bit-32 common-linux common-uclibc ix86-common",\ + "i486-linux-uclibc": "endian-little bit-32 common-linux common-uclibc ix86-common",\ + "i586-linux-uclibc": "endian-little bit-32 common-linux common-uclibc ix86-common",\ + "i686-linux-uclibc": "endian-little bit-32 common-linux common-uclibc ix86-common",\ + "mipsel-linux": "endian-little bit-32 common-linux common-glibc",\ + "mipsel-linux-uclibc": "endian-little bit-32 common-linux common-uclibc",\ + "mips-linux": "endian-big bit-32 common-linux common-glibc",\ + "mips-linux-uclibc": "endian-big bit-32 common-linux common-uclibc",\ "powerpc-darwin": "endian-big bit-32 common-darwin",\ - "ppc-linux": "endian-big bit-32 common-glibc powerpc-common",\ - "powerpc-linux": "endian-big bit-32 common-glibc powerpc-common",\ - "powerpc-linux-uclibc": "endian-big bit-32 common-uclibc powerpc-common",\ - "sh3-linux": "endian-little bit-32 common-glibc sh-common",\ - "sh4-linux": "endian-little bit-32 common-glibc sh-common",\ - "sh4-linux-uclibc": "endian-little bit-32 common-uclibc sh-common",\ - "sparc-linux": "endian-big bit-32 common-glibc",\ - "x86_64-linux": "endian-little bit-64 common-glibc",\ - "x86_64-linux-uclibc": "endian-little bit-64 common-uclibc"} + "ppc-linux": "endian-big bit-32 common-linux common-glibc powerpc-common",\ + "powerpc-linux": "endian-big bit-32 common-linux common-glibc powerpc-common",\ + "powerpc-linux-uclibc": "endian-big bit-32 common-linux common-uclibc powerpc-common",\ + "sh3-linux": "endian-little bit-32 common-linux common-glibc sh-common",\ + "sh4-linux": "endian-little bit-32 common-linux common-glibc sh-common",\ + "sh4-linux-uclibc": "endian-little bit-32 common-linux common-uclibc sh-common",\ + "sparc-linux": "endian-big bit-32 common-linux common-glibc",\ + "x86_64-linux": "endian-little bit-64 common-linux common-glibc",\ + "x86_64-linux-uclibc": "endian-little bit-64 common-linux common-uclibc"} if target in targetinfo: info = targetinfo[target].split() info.append(target) diff --git a/classes/testlab.bbclass b/classes/testlab.bbclass index 5a88f3de62..ba0bc794e7 100644 --- a/classes/testlab.bbclass +++ b/classes/testlab.bbclass @@ -19,26 +19,26 @@ # * add test suite to run on the target device -# Needs 'dot', 'ipkg-cl' +# Needs 'dot', 'opkg-cl' do_testlab() { -if [ -e ${IMAGE_ROOTFS}/etc/ipkg ] ; then +if [ -e ${IMAGE_ROOTFS}/etc/opkg ] ; then TESTLAB_DIR="${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-testlab" mkdir -p ${TESTLAB_DIR}/ - ls -laR ${IMAGE_ROOTFS} >& ${TESTLAB_DIR}/files-in-image.txt + ls -laR ${IMAGE_ROOTFS} > ${TESTLAB_DIR}/files-in-image.txt echo > ${TESTLAB_DIR}/installed-packages.txt echo -e "digraph depends {\n node [shape=plaintext]" > ${TESTLAB_DIR}/depends.dot - for pkg in $(ipkg-cl -f ${IMAGE_ROOTFS}/etc/ipkg -o ${IMAGE_ROOTFS} list_installed | awk '{print $1}') ; do - ipkg-cl -f ${IMAGE_ROOTFS}/etc/ipkg -o ${IMAGE_ROOTFS} info $pkg | grep Filename | awk -F: '{print $2}' >> ${TESTLAB_DIR}/installed-packages.txt + for pkg in $(opkg-cl -f ${IMAGE_ROOTFS}/etc/opkg -o ${IMAGE_ROOTFS} list_installed | awk '{print $1}') ; do + opkg-cl -f ${IMAGE_ROOTFS}/etc/opkg -o ${IMAGE_ROOTFS} info $pkg | grep Filename | awk -F: '{print $2}' >> ${TESTLAB_DIR}/installed-packages.txt - for depends in $(ipkg-cl -f ${IMAGE_ROOTFS}/etc/ipkg -o ${IMAGE_ROOTFS} info $pkg | grep Depends) ; do + for depends in $(opkg-cl -f ${IMAGE_ROOTFS}/etc/opkg -o ${IMAGE_ROOTFS} info $pkg | grep Depends) ; do echo "$pkg OPP $depends;" | grep -v "(" | grep -v ")" | grep -v Depends | sed -e 's:,::g' -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' |sed 's:OPP:->:g' >> ${TESTLAB_DIR}/depends.dot done - for recommends in $(ipkg-cl -f ${IMAGE_ROOTFS}/etc/ipkg -o ${IMAGE_ROOTFS} info $pkg | grep Recom) ; do + for recommends in $(opkg-cl -f ${IMAGE_ROOTFS}/etc/opkg -o ${IMAGE_ROOTFS} info $pkg | grep Recom) ; do echo "$pkg OPP $recommends [style=dotted];" | grep -v "(" | grep -v ")" | grep -v Recom | sed -e 's:,::g' -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' |sed 's:OPP:->:g' >> ${TESTLAB_DIR}/depends.dot done done |