summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/image.bbclass31
1 files changed, 17 insertions, 14 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 45cfe91f5b..f44b305eaa 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -57,6 +57,22 @@ def get_devtable_list(d):
57 str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable) 57 str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable)
58 return str 58 return str
59 59
60def get_imagecmds(d):
61 import bb
62 cmds = "\n"
63 old_overrides = bb.data.getVar('OVERRIDES', d, 0)
64 for type in bb.data.getVar('IMAGE_FSTYPES', d, True).split():
65 localdata = bb.data.createCopy(d)
66 bb.data.setVar('OVERRIDES', '%s:%s' % (type, old_overrides), localdata)
67 bb.data.update_data(localdata)
68 cmd = "\t#Code for image type " + type + "\n"
69 cmd += "\t${IMAGE_CMD_" + type + "}\n"
70 cmd += "\tcd ${DEPLOY_DIR_IMAGE}/\n"
71 cmd += "\trm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}." + type + "\n"
72 cmd += "\tln -s ${IMAGE_NAME}.rootfs." + type + " ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}." + type + "\n\n"
73 cmds += bb.data.expand(cmd, localdata)
74 return cmds
75
60IMAGE_POSTPROCESS_COMMAND ?= "" 76IMAGE_POSTPROCESS_COMMAND ?= ""
61MACHINE_POSTPROCESS_COMMAND ?= "" 77MACHINE_POSTPROCESS_COMMAND ?= ""
62ROOTFS_POSTPROCESS_COMMAND ?= "" 78ROOTFS_POSTPROCESS_COMMAND ?= ""
@@ -89,21 +105,8 @@ fakeroot do_rootfs () {
89 insert_feed_uris 105 insert_feed_uris
90 106
91 ${IMAGE_PREPROCESS_COMMAND} 107 ${IMAGE_PREPROCESS_COMMAND}
92
93 export TOPDIR=${TOPDIR}
94 export MACHINE=${MACHINE}
95 108
96 for type in ${IMAGE_FSTYPES}; do 109 ${@get_imagecmds(d)}
97 if test -z "$FAKEROOTKEY"; then
98 fakeroot -i ${TMPDIR}/fakedb.image ${PYTHON} `which bbimage` -t $type -e ${FILE}
99 else
100 ${PYTHON} `which bbimage` -n "${IMAGE_NAME}" -t "$type" -e "${FILE}"
101 fi
102
103 cd ${DEPLOY_DIR_IMAGE}/
104 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type
105 ln -s ${IMAGE_NAME}.rootfs.$type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type
106 done
107 110
108 # Run ldconfig on the image to create a valid cache 111 # Run ldconfig on the image to create a valid cache
109 # (new format for cross arch compatibility) 112 # (new format for cross arch compatibility)