diff options
| author | Richard Purdie <richard@openedhand.com> | 2005-08-31 10:45:47 +0000 |
|---|---|---|
| committer | Richard Purdie <richard@openedhand.com> | 2005-08-31 10:45:47 +0000 |
| commit | 4b46c1f6e891b1ddd5968536440b888661fade3e (patch) | |
| tree | e0ba2c1f56f61b868bf746da5c4feabb25b800b2 /openembedded/classes/image_ipk.bbclass | |
| download | poky-4b46c1f6e891b1ddd5968536440b888661fade3e.tar.gz | |
Initial population
git-svn-id: https://svn.o-hand.com/repos/poky@1 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/classes/image_ipk.bbclass')
| -rw-r--r-- | openembedded/classes/image_ipk.bbclass | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/openembedded/classes/image_ipk.bbclass b/openembedded/classes/image_ipk.bbclass new file mode 100644 index 0000000000..5fdd340673 --- /dev/null +++ b/openembedded/classes/image_ipk.bbclass | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | inherit rootfs_ipk | ||
| 2 | |||
| 3 | # Images are generally built explicitly, do not need to be part of world. | ||
| 4 | EXCLUDE_FROM_WORLD = "1" | ||
| 5 | |||
| 6 | USE_DEVFS ?= "0" | ||
| 7 | |||
| 8 | DEPENDS += "makedevs-native" | ||
| 9 | |||
| 10 | def get_image_deps(d): | ||
| 11 | import bb | ||
| 12 | str = "" | ||
| 13 | for type in (bb.data.getVar('IMAGE_FSTYPES', d, 1) or "").split(): | ||
| 14 | deps = bb.data.getVar('IMAGE_DEPENDS_%s' % type, d) or "" | ||
| 15 | if deps: | ||
| 16 | str += " %s" % deps | ||
| 17 | return str | ||
| 18 | |||
| 19 | DEPENDS += "${@get_image_deps(d)}" | ||
| 20 | |||
| 21 | IMAGE_DEVICE_TABLE ?= "${@bb.which(bb.data.getVar('BBPATH', d, 1), 'files/device_table-minimal.txt')}" | ||
| 22 | IMAGE_POSTPROCESS_COMMAND ?= "" | ||
| 23 | |||
| 24 | # Must call real_do_rootfs() from inside here, rather than as a separate | ||
| 25 | # task, so that we have a single fakeroot context for the whole process. | ||
| 26 | fakeroot do_rootfs () { | ||
| 27 | set -x | ||
| 28 | rm -rf ${IMAGE_ROOTFS} | ||
| 29 | |||
| 30 | if [ "${USE_DEVFS}" != "1" ]; then | ||
| 31 | mkdir -p ${IMAGE_ROOTFS}/dev | ||
| 32 | makedevs -r ${IMAGE_ROOTFS} -D ${IMAGE_DEVICE_TABLE} | ||
| 33 | fi | ||
| 34 | |||
| 35 | real_do_rootfs | ||
| 36 | |||
| 37 | insert_feed_uris | ||
| 38 | |||
| 39 | rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/lists/oe | ||
| 40 | |||
| 41 | ${IMAGE_PREPROCESS_COMMAND} | ||
| 42 | |||
| 43 | export TOPDIR=${TOPDIR} | ||
| 44 | |||
| 45 | for type in ${IMAGE_FSTYPES}; do | ||
| 46 | if test -z "$FAKEROOTKEY"; then | ||
| 47 | fakeroot -i ${TMPDIR}/fakedb.image bbimage -t $type -e ${FILE} | ||
| 48 | else | ||
| 49 | bbimage -n "${IMAGE_NAME}" -t "$type" -e "${FILE}" | ||
| 50 | fi | ||
| 51 | done | ||
| 52 | |||
| 53 | ${IMAGE_POSTPROCESS_COMMAND} | ||
| 54 | } | ||
| 55 | |||
| 56 | insert_feed_uris () { | ||
| 57 | |||
| 58 | echo "Building feeds for [${DISTRO}].." | ||
| 59 | |||
| 60 | for line in ${FEED_URIS} | ||
| 61 | do | ||
| 62 | # strip leading and trailing spaces/tabs, then split into name and uri | ||
| 63 | line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`" | ||
| 64 | feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`" | ||
| 65 | feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`" | ||
| 66 | |||
| 67 | echo "Added $feed_name feed with URL $feed_uri" | ||
| 68 | |||
| 69 | # insert new feed-sources | ||
| 70 | echo "src/gz $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/ipkg/${feed_name}-feed.conf | ||
| 71 | done | ||
| 72 | } | ||
