summaryrefslogtreecommitdiff
path: root/classes/image.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2008-05-21 20:59:07 +0000
committerRichard Purdie <rpurdie@rpsys.net>2008-05-21 20:59:07 +0000
commit79c932022e1b9bbf3c75e38f8272ee243f227ae0 (patch)
treeb8c0ffef4c9b3097e22a978676c80eec2bd74bee /classes/image.bbclass
parent6dcedb8aaf489fdebb3049ae6c493c8b4451a1f3 (diff)
image.bbclass: Remove use of bbimage (from poky)
Diffstat (limited to 'classes/image.bbclass')
-rw-r--r--classes/image.bbclass32
1 files changed, 17 insertions, 15 deletions
diff --git a/classes/image.bbclass b/classes/image.bbclass
index af9d4a298c..6350a733e8 100644
--- a/classes/image.bbclass
+++ b/classes/image.bbclass
@@ -57,6 +57,22 @@ def get_devtable_list(d):
str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable)
return str
+def get_imagecmds(d):
+ import bb
+ cmds = "\n"
+ old_overrides = bb.data.getVar('OVERRIDES', d, 0)
+ for type in bb.data.getVar('IMAGE_FSTYPES', d, True).split():
+ localdata = bb.data.createCopy(d)
+ bb.data.setVar('OVERRIDES', '%s:%s' % (type, old_overrides), localdata)
+ bb.data.update_data(localdata)
+ cmd = "\t#Code for image type " + type + "\n"
+ cmd += "\t${IMAGE_CMD_" + type + "}\n"
+ cmd += "\tcd ${DEPLOY_DIR_IMAGE}/\n"
+ cmd += "\trm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}." + type + "\n"
+ cmd += "\tln -s ${IMAGE_NAME}.rootfs." + type + " ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}." + type + "\n\n"
+ cmds += bb.data.expand(cmd, localdata)
+ return cmds
+
IMAGE_POSTPROCESS_COMMAND ?= ""
MACHINE_POSTPROCESS_COMMAND ?= ""
ROOTFS_POSTPROCESS_COMMAND ?= ""
@@ -90,21 +106,7 @@ fakeroot do_rootfs () {
${IMAGE_PREPROCESS_COMMAND}
- export TOPDIR=${TOPDIR}
- export DISTRO=${USERDISTRO}
- export MACHINE=${MACHINE}
-
- for type in ${IMAGE_FSTYPES}; do
- if test -z "$FAKEROOTKEY"; then
- fakeroot -i ${TMPDIR}/fakedb.image ${PYTHON} `which bbimage` -t $type -e ${FILE}
- else
- ${PYTHON} `which bbimage` -n "${IMAGE_NAME}" -t "$type" -e "${FILE}"
- fi
-
- cd ${DEPLOY_DIR_IMAGE}/
- rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type
- ln -s ${IMAGE_NAME}.rootfs.$type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type
- done
+ ${@get_imagecmds(d)}
${IMAGE_POSTPROCESS_COMMAND}