# # Populate builds using prebuilt packages where possible to speed up builds # and allow staging to be reconstructed. # # To use it add that line to conf/local.conf: # # 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 ?= "/${OELAYOUT_ABI}/${DISTRO_PR}/" 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}" PSTAGE_NATIVEDEPENDS = "\ shasum-native \ stagemanager-native \ " BB_STAMP_WHITELIST = "${PSTAGE_NATIVEDEPENDS}" python () { import bb 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_setscene', 'depends', d) or "" deps += " stagemanager-native:do_populate_staging" bb.data.setVarFlag('do_setscene', 'depends', deps, d) policy = bb.data.getVar("BB_STAMP_POLICY", d, True) if policy == "whitelist" or policy == "full": deps = bb.data.getVarFlag('do_setscene', 'recrdeptask', d) or "" deps += " do_setscene" bb.data.setVarFlag('do_setscene', 'recrdeptask', deps, d) bb.data.setVar("PSTAGING_ACTIVE", "1", d) else: bb.data.setVar("PSTAGING_ACTIVE", "0", d) } DEPLOY_DIR_PSTAGE ?= "${DEPLOY_DIR}/pstage" PSTAGE_MACHCONFIG = "${DEPLOY_DIR_PSTAGE}/opkg.conf" PSTAGE_PKGMANAGER = "stage-manager-ipkg" PSTAGE_BUILD_CMD = "stage-manager-ipkg-build -o 0 -g 0" PSTAGE_INSTALL_CMD = "${PSTAGE_PKGMANAGER} -f ${PSTAGE_MACHCONFIG} -force-depends -o ${TMPDIR} install" PSTAGE_UPDATE_CMD = "${PSTAGE_PKGMANAGER} -f ${PSTAGE_MACHCONFIG} -o ${TMPDIR} update" PSTAGE_REMOVE_CMD = "${PSTAGE_PKGMANAGER} -f ${PSTAGE_MACHCONFIG} -force-depends -o ${TMPDIR} remove" PSTAGE_LIST_CMD = "${PSTAGE_PKGMANAGER} -f ${PSTAGE_MACHCONFIG} -o ${TMPDIR} list_installed" PSTAGE_TMPDIR_STAGE = "${WORKDIR}/staging-pkg" def pstage_manualclean(srcname, destvarname, d): import os, bb src = os.path.join(bb.data.getVar('PSTAGE_TMPDIR_STAGE', d, True), srcname) dest = bb.data.getVar(destvarname, d, True) for walkroot, dirs, files in os.walk(src): for file in files: filepath = os.path.join(walkroot, file).replace(src, dest) bb.note("rm %s" % filepath) os.system("rm %s" % filepath) def pstage_set_pkgmanager(d): import bb path = bb.data.getVar("PATH", d, 1) pkgmanager = bb.which(path, 'opkg-cl') if pkgmanager == "": pkgmanager = bb.which(path, 'ipkg-cl') if pkgmanager != "": bb.data.setVar("PSTAGE_PKGMANAGER", pkgmanager, d) def pstage_cleanpackage(pkgname, d): import os, bb path = bb.data.getVar("PATH", d, 1) pstage_set_pkgmanager(d) list_cmd = bb.data.getVar("PSTAGE_LIST_CMD", d, True) bb.note("Checking i
DESCRIPTION = "Restart Applet"
SECTION = "opie/applets"
LICENSE = "GPLv2"
# FIXME stopgap until split archives have license files included
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
APPNAME = "restartapplet"


S = "${WORKDIR}/${APPNAME}"

inherit opie

# FILES plugins/applets/librestartapplet.so*
do_install() {
}
else: srcname = bb.data.expand(pkgname + "_${PV}-" + pr + "_${DPKG_ARCH}.deb", d) srcfile = bb.data.expand("${DEPLOY_DIR_DEB}/" + arch + "/" + srcname, d) if os.path.exists(srcfile): destpath = debpath + "/" + arch + "/" bb.mkdirhier(destpath) bb.copyfile(srcfile, destpath + 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 -dpR %s.do_* %s/" % (stampfn, destdir)) pstage_set_pkgmanager(d) bb.build.exec_func("staging_helper", 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 do_package_stage_all () { : } do_package_stage_all[recrdeptask] = "do_package_stage" addtask package_stage_all after do_package_stage before do_build