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