diff options
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r-- | meta/classes/image.bbclass | 63 |
1 files changed, 56 insertions, 7 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 517868ed3e..dbbdee3686 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -33,17 +33,36 @@ python () { | |||
33 | bb.data.setVarFlag('do_rootfs', 'depends', deps, d) | 33 | bb.data.setVarFlag('do_rootfs', 'depends', deps, d) |
34 | } | 34 | } |
35 | 35 | ||
36 | IMAGE_DEVICE_TABLE ?= "${@bb.which(bb.data.getVar('BBPATH', d, 1), 'files/device_table-minimal.txt')}" | 36 | # |
37 | # Get a list of files containing device tables to create. | ||
38 | # * IMAGE_DEVICE_TABLE is the old name to an absolute path to a device table file | ||
39 | # * IMAGE_DEVICE_TABLES is a new name for a file, or list of files, seached | ||
40 | # for in the BBPATH | ||
41 | # If neither are specified then the default name of files/device_table-minimal.txt | ||
42 | # is searched for in the BBPATH (same as the old version.) | ||
43 | # | ||
44 | def get_devtable_list(d): | ||
45 | import bb | ||
46 | devtable = bb.data.getVar('IMAGE_DEVICE_TABLE', d, 1) | ||
47 | if devtable != None: | ||
48 | return devtable | ||
49 | str = "" | ||
50 | devtables = bb.data.getVar('IMAGE_DEVICE_TABLES', d, 1) | ||
51 | if devtables == None: | ||
52 | devtables = 'files/device_table-minimal.txt' | ||
53 | for devtable in devtables.split(): | ||
54 | str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable) | ||
55 | return str | ||
56 | |||
37 | IMAGE_POSTPROCESS_COMMAND ?= "" | 57 | IMAGE_POSTPROCESS_COMMAND ?= "" |
38 | MACHINE_POSTPROCESS_COMMAND ?= "" | 58 | MACHINE_POSTPROCESS_COMMAND ?= "" |
59 | ROOTFS_POSTPROCESS_COMMAND ?= "" | ||
39 | 60 | ||
40 | # some default locales | 61 | # some default locales |
41 | IMAGE_LINGUAS ?= "en-gb" | 62 | IMAGE_LINGUAS ?= "de-de fr-fr en-gb" |
42 | 63 | ||
43 | LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s, bb.data.getVar('IMAGE_LINGUAS', d, 1).split()))}" | 64 | LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s, bb.data.getVar('IMAGE_LINGUAS', d, 1).split()))}" |
44 | 65 | ||
45 | ROOTFS_POSTPROCESS_COMMAND ?= "" | ||
46 | |||
47 | do_rootfs[nostamp] = "1" | 66 | do_rootfs[nostamp] = "1" |
48 | do_rootfs[dirs] = "${TOPDIR}" | 67 | do_rootfs[dirs] = "${TOPDIR}" |
49 | do_build[nostamp] = "1" | 68 | do_build[nostamp] = "1" |
@@ -53,15 +72,20 @@ do_build[nostamp] = "1" | |||
53 | fakeroot do_rootfs () { | 72 | fakeroot do_rootfs () { |
54 | set -x | 73 | set -x |
55 | rm -rf ${IMAGE_ROOTFS} | 74 | rm -rf ${IMAGE_ROOTFS} |
75 | mkdir -p ${IMAGE_ROOTFS} | ||
56 | 76 | ||
57 | if [ "${USE_DEVFS}" != "1" ]; then | 77 | if [ "${USE_DEVFS}" != "1" ]; then |
58 | mkdir -p ${IMAGE_ROOTFS}/dev | 78 | mkdir -p ${IMAGE_ROOTFS}/dev |
59 | makedevs -r ${IMAGE_ROOTFS} -D ${IMAGE_DEVICE_TABLE} | 79 | for devtable in ${@get_devtable_list(d)}; do |
80 | makedevs -r ${IMAGE_ROOTFS} -D $devtable | ||
81 | done | ||
60 | fi | 82 | fi |
61 | 83 | ||
62 | rootfs_${IMAGE_PKGTYPE}_do_rootfs | 84 | rootfs_${IMAGE_PKGTYPE}_do_rootfs |
63 | 85 | ||
64 | rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/lists/oe | 86 | insert_feed_uris |
87 | |||
88 | rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/lists/* | ||
65 | 89 | ||
66 | ${IMAGE_PREPROCESS_COMMAND} | 90 | ${IMAGE_PREPROCESS_COMMAND} |
67 | 91 | ||
@@ -85,6 +109,24 @@ fakeroot do_rootfs () { | |||
85 | ${MACHINE_POSTPROCESS_COMMAND} | 109 | ${MACHINE_POSTPROCESS_COMMAND} |
86 | } | 110 | } |
87 | 111 | ||
112 | insert_feed_uris () { | ||
113 | |||
114 | echo "Building feeds for [${DISTRO}].." | ||
115 | |||
116 | for line in ${FEED_URIS} | ||
117 | do | ||
118 | # strip leading and trailing spaces/tabs, then split into name and uri | ||
119 | line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`" | ||
120 | feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`" | ||
121 | feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`" | ||
122 | |||
123 | echo "Added $feed_name feed with URL $feed_uri" | ||
124 | |||
125 | # insert new feed-sources | ||
126 | echo "src/gz $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/ipkg/${feed_name}-feed.conf | ||
127 | done | ||
128 | } | ||
129 | |||
88 | log_check() { | 130 | log_check() { |
89 | set +x | 131 | set +x |
90 | for target in $* | 132 | for target in $* |
@@ -132,7 +174,14 @@ make_zimage_symlink_relative () { | |||
132 | fi | 174 | fi |
133 | } | 175 | } |
134 | 176 | ||
177 | # Make login manager(s) enable automatic login. | ||
178 | # Useful for devices where we do not want to log in at all (e.g. phones) | ||
179 | set_image_autologin () { | ||
180 | sed -i 's%^AUTOLOGIN=\"false"%AUTOLOGIN="true"%g' ${IMAGE_ROOTFS}/etc/sysconfig/gpelogin | ||
181 | } | ||
182 | |||
183 | |||
135 | # export the zap_root_password, create_etc_timestamp and remote_init_link | 184 | # export the zap_root_password, create_etc_timestamp and remote_init_link |
136 | EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs make_zimage_symlink_relative | 185 | EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs make_zimage_symlink_relative set_image_autologin |
137 | 186 | ||
138 | addtask rootfs before do_build after do_install | 187 | addtask rootfs before do_build after do_install |