Change FEED_URI handling to store feeds in /etc/ipkg/*-feed.conf. Allow distribution...
[vuplus_openembedded] / classes / image_ipk.oeclass
1 inherit rootfs_ipk
2
3 USE_DEVFS ?= "0"
4
5 DEPENDS += "makedevs-native"
6
7 def get_image_deps(d):
8         import oe
9         str = ""
10         for type in (oe.data.getVar('IMAGE_FSTYPES', d, 1) or "").split():
11                 deps = oe.data.getVar('IMAGE_DEPENDS_%s' % type, d) or ""
12                 if deps:
13                         str += " %s" % deps
14         return str
15
16 DEPENDS += "${@get_image_deps(d)}"
17
18 IMAGE_DEVICE_TABLE = "${@oe.which(oe.data.getVar('OEPATH', d, 1), 'files/device_table-minimal.txt')}"
19 IMAGE_POSTPROCESS_COMMAND ?= ""
20
21 # Must call real_do_rootfs() from inside here, rather than as a separate
22 # task, so that we have a single fakeroot context for the whole process.
23 fakeroot do_rootfs () {
24         set -x
25         rm -rf ${IMAGE_ROOTFS}
26
27         if [ "${USE_DEVFS}" != "1" ]; then
28                 mkdir -p ${IMAGE_ROOTFS}/dev
29                 makedevs -r ${IMAGE_ROOTFS} -D ${IMAGE_DEVICE_TABLE}
30         fi
31
32         real_do_rootfs
33
34         insert_feed_uris        
35
36         ${IMAGE_PREPROCESS_COMMAND}
37                 
38         export TOPDIR=${TOPDIR}
39
40         for type in ${IMAGE_FSTYPES}; do
41                 if test -z "$FAKEROOTKEY"; then
42                         fakeroot -i ${TMPDIR}/fakedb.image oeimage -t $type -e ${FILE}
43                 else
44                         oeimage -n "${IMAGE_NAME}" -t "$type" -e "${FILE}"
45                 fi
46         done
47
48         ${IMAGE_POSTPROCESS_COMMAND}
49 }
50
51 insert_feed_uris () {
52         
53         echo "Building feeds for [${DISTRO}].."
54         
55         case "${DISTRO}" in
56                 openzaurus*)    FEED_URIS_="$FEED_URIS_openzaurus";;
57                 familiar*)      FEED_URIS_="$FEED_URIS_familiar";;
58         esac
59         
60         ! test -z "$FEED_URIS_" && FEED_URIS="$FEED_URIS_"
61         
62         for line in ${FEED_URIS}
63         do
64                 # strip leading and trailing spaces/tabs, then split into name and uri
65                 line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`"
66                 feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`"
67                 feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`"                                        
68                 
69                 echo "Added $feed_name feed with URL $feed_uri"
70                 
71                 # insert new feed-sources
72                 echo "src $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/ipkg/${feed_name}-feed.conf
73         done                    
74 }