summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/cross.bbclass4
-rw-r--r--meta/classes/image.bbclass63
-rw-r--r--meta/classes/rootfs_deb.bbclass18
-rw-r--r--meta/classes/rootfs_ipk.bbclass22
4 files changed, 87 insertions, 20 deletions
diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
index 77afb65d0c..3588e2344a 100644
--- a/meta/classes/cross.bbclass
+++ b/meta/classes/cross.bbclass
@@ -2,12 +2,12 @@
2# no need for them to be a direct target of 'world' 2# no need for them to be a direct target of 'world'
3EXCLUDE_FROM_WORLD = "1" 3EXCLUDE_FROM_WORLD = "1"
4 4
5PACKAGES = ""
6
7# Save PACKAGE_ARCH before changing HOST_ARCH 5# Save PACKAGE_ARCH before changing HOST_ARCH
8OLD_PACKAGE_ARCH := ${PACKAGE_ARCH} 6OLD_PACKAGE_ARCH := ${PACKAGE_ARCH}
9PACKAGE_ARCH = ${OLD_PACKAGE_ARCH} 7PACKAGE_ARCH = ${OLD_PACKAGE_ARCH}
10 8
9PACKAGES = ""
10
11HOST_ARCH = "${BUILD_ARCH}" 11HOST_ARCH = "${BUILD_ARCH}"
12HOST_VENDOR = "${BUILD_VENDOR}" 12HOST_VENDOR = "${BUILD_VENDOR}"
13HOST_OS = "${BUILD_OS}" 13HOST_OS = "${BUILD_OS}"
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
36IMAGE_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#
44def 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
37IMAGE_POSTPROCESS_COMMAND ?= "" 57IMAGE_POSTPROCESS_COMMAND ?= ""
38MACHINE_POSTPROCESS_COMMAND ?= "" 58MACHINE_POSTPROCESS_COMMAND ?= ""
59ROOTFS_POSTPROCESS_COMMAND ?= ""
39 60
40# some default locales 61# some default locales
41IMAGE_LINGUAS ?= "en-gb" 62IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
42 63
43LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s, bb.data.getVar('IMAGE_LINGUAS', d, 1).split()))}" 64LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s, bb.data.getVar('IMAGE_LINGUAS', d, 1).split()))}"
44 65
45ROOTFS_POSTPROCESS_COMMAND ?= ""
46
47do_rootfs[nostamp] = "1" 66do_rootfs[nostamp] = "1"
48do_rootfs[dirs] = "${TOPDIR}" 67do_rootfs[dirs] = "${TOPDIR}"
49do_build[nostamp] = "1" 68do_build[nostamp] = "1"
@@ -53,15 +72,20 @@ do_build[nostamp] = "1"
53fakeroot do_rootfs () { 72fakeroot 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
112insert_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
88log_check() { 130log_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)
179set_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
136EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs make_zimage_symlink_relative 185EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs make_zimage_symlink_relative set_image_autologin
137 186
138addtask rootfs before do_build after do_install 187addtask rootfs before do_build after do_install
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index 6d405d2f51..1dc19e746f 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -56,17 +56,19 @@ fakeroot rootfs_deb_do_rootfs () {
56 cat ${IMAGE_ROOTFS}/var/dpkg/status | sed -n -e "/^Package: $2\$/{n; s/Status: install ok .*/$1/; p}" 56 cat ${IMAGE_ROOTFS}/var/dpkg/status | sed -n -e "/^Package: $2\$/{n; s/Status: install ok .*/$1/; p}"
57 } 57 }
58 58
59 if [ ! -z "${LINGUAS_INSTALL}" ]; then 59 if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
60 apt-get install glibc-localedata-i18n --force-yes --allow-unauthenticated 60 if [ ! -z "${LINGUAS_INSTALL}" ]; then
61 if [ $? -ne 0 ]; then 61 apt-get install glibc-localedata-i18n --force-yes --allow-unauthenticated
62 exit 1
63 fi
64 for i in ${LINGUAS_INSTALL}; do
65 apt-get install $i --force-yes --allow-unauthenticated
66 if [ $? -ne 0 ]; then 62 if [ $? -ne 0 ]; then
67 exit 1 63 exit 1
68 fi 64 fi
69 done 65 for i in ${LINGUAS_INSTALL}; do
66 apt-get install $i --force-yes --allow-unauthenticated
67 if [ $? -ne 0 ]; then
68 exit 1
69 fi
70 done
71 fi
70 fi 72 fi
71 73
72 if [ ! -z "${PACKAGE_INSTALL}" ]; then 74 if [ ! -z "${PACKAGE_INSTALL}" ]; then
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index c58b547742..3709f89743 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -10,15 +10,31 @@ do_rootfs[recrdeptask] += "do_package_write_ipk"
10 10
11IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}" 11IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}"
12 12
13fakeroot rootfs_ipk_do_rootfs () { 13rootfs_ipk_do_indexes () {
14 set -x 14 set -x
15 15
16 mkdir -p ${IMAGE_ROOTFS}/dev 16 ipkgarchs="${PACKAGE_ARCHS}"
17 17
18 if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then 18 if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then
19 touch ${DEPLOY_DIR_IPK}/Packages 19 touch ${DEPLOY_DIR_IPK}/Packages
20 ipkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK} 20 ipkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK}
21 fi 21 fi
22
23 for arch in $ipkgarchs; do
24 if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then
25 if [ -e ${DEPLOY_DIR_IPK}/$arch/ ] ; then
26 touch ${DEPLOY_DIR_IPK}/$arch/Packages
27 ipkg-make-index -r ${DEPLOY_DIR_IPK}/$arch/Packages -p ${DEPLOY_DIR_IPK}/$arch/Packages -l ${DEPLOY_DIR_IPK}/$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/$arch/
28 fi
29 fi
30 done
31}
32
33fakeroot rootfs_ipk_do_rootfs () {
34 set -x
35
36 rootfs_ipk_do_indexes
37
22 mkdir -p ${T} 38 mkdir -p ${T}
23 echo "src oe file:${DEPLOY_DIR_IPK}" > ${T}/ipkg.conf 39 echo "src oe file:${DEPLOY_DIR_IPK}" > ${T}/ipkg.conf
24 ipkgarchs="${PACKAGE_ARCHS}" 40 ipkgarchs="${PACKAGE_ARCHS}"