summaryrefslogtreecommitdiff
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 @@
# no need for them to be a direct target of 'world'
EXCLUDE_FROM_WORLD = "1"
-PACKAGES = ""
-
# Save PACKAGE_ARCH before changing HOST_ARCH
OLD_PACKAGE_ARCH := ${PACKAGE_ARCH}
PACKAGE_ARCH = ${OLD_PACKAGE_ARCH}
+PACKAGES = ""
+
HOST_ARCH = "${BUILD_ARCH}"
HOST_VENDOR = "${BUILD_VENDOR}"
HOST_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 () {
bb.data.setVarFlag('do_rootfs', 'depends', deps, d)
}
-IMAGE_DEVICE_TABLE ?= "${@bb.which(bb.data.getVar('BBPATH', d, 1), 'files/device_table-minimal.txt')}"
+#
+# Get a list of files containing device tables to create.
+# * IMAGE_DEVICE_TABLE is the old name to an absolute path to a device table file
+# * IMAGE_DEVICE_TABLES is a new name for a file, or list of files, seached
+# for in the BBPATH
+# If neither are specified then the default name of files/device_table-minimal.txt
+# is searched for in the BBPATH (same as the old version.)
+#
+def get_devtable_list(d):
+ import bb
+ devtable = bb.data.getVar('IMAGE_DEVICE_TABLE', d, 1)
+ if devtable != None:
+ return devtable
+ str = ""
+ devtables = bb.data.getVar('IMAGE_DEVICE_TABLES', d, 1)
+ if devtables == None:
+ devtables = 'files/device_table-minimal.txt'
+ for devtable in devtables.split():
+ str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable)
+ return str
+
IMAGE_POSTPROCESS_COMMAND ?= ""
MACHINE_POSTPROCESS_COMMAND ?= ""
+ROOTFS_POSTPROCESS_COMMAND ?= ""
# some default locales
-IMAGE_LINGUAS ?= "en-gb"
+IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s, bb.data.getVar('IMAGE_LINGUAS', d, 1).split()))}"
-ROOTFS_POSTPROCESS_COMMAND ?= ""
-
do_rootfs[nostamp] = "1"
do_rootfs[dirs] = "${TOPDIR}"
do_build[nostamp] = "1"
@@ -53,15 +72,20 @@ do_build[nostamp] = "1"
fakeroot do_rootfs () {
set -x
rm -rf ${IMAGE_ROOTFS}
+ mkdir -p ${IMAGE_ROOTFS}
if [ "${USE_DEVFS}" != "1" ]; then
mkdir -p ${IMAGE_ROOTFS}/dev
- makedevs -r ${IMAGE_ROOTFS} -D ${IMAGE_DEVICE_TABLE}
+ for devtable in ${@get_devtable_list(d)}; do
+ makedevs -r ${IMAGE_ROOTFS} -D $devtable
+ done
fi
rootfs_${IMAGE_PKGTYPE}_do_rootfs
- rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/lists/oe
+ insert_feed_uris
+
+ rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/lists/*
${IMAGE_PREPROCESS_COMMAND}
@@ -85,6 +109,24 @@ fakeroot do_rootfs () {
${MACHINE_POSTPROCESS_COMMAND}
}
+insert_feed_uris () {
+
+ echo "Building feeds for [${DISTRO}].."
+
+ for line in ${FEED_URIS}
+ do
+ # strip leading and trailing spaces/tabs, then split into name and uri
+ line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`"
+ feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`"
+ feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`"
+
+ echo "Added $feed_name feed with URL $feed_uri"
+
+ # insert new feed-sources
+ echo "src/gz $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/ipkg/${feed_name}-feed.conf
+ done
+}
+
log_check() {
set +x
for target in $*
@@ -132,7 +174,14 @@ make_zimage_symlink_relative () {
fi
}
+# Make login manager(s) enable automatic login.
+# Useful for devices where we do not want to log in at all (e.g. phones)
+set_image_autologin () {
+ sed -i 's%^AUTOLOGIN=\"false"%AUTOLOGIN="true"%g' ${IMAGE_ROOTFS}/etc/sysconfig/gpelogin
+}
+
+
# export the zap_root_password, create_etc_timestamp and remote_init_link
-EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs make_zimage_symlink_relative
+EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs make_zimage_symlink_relative set_image_autologin
addtask 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 () {
cat ${IMAGE_ROOTFS}/var/dpkg/status | sed -n -e "/^Package: $2\$/{n; s/Status: install ok .*/$1/; p}"
}
- if [ ! -z "${LINGUAS_INSTALL}" ]; then
- apt-get install glibc-localedata-i18n --force-yes --allow-unauthenticated
- if [ $? -ne 0 ]; then
- exit 1
- fi
- for i in ${LINGUAS_INSTALL}; do
- apt-get install $i --force-yes --allow-unauthenticated
+ if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
+ if [ ! -z "${LINGUAS_INSTALL}" ]; then
+ apt-get install glibc-localedata-i18n --force-yes --allow-unauthenticated
if [ $? -ne 0 ]; then
exit 1
fi
- done
+ for i in ${LINGUAS_INSTALL}; do
+ apt-get install $i --force-yes --allow-unauthenticated
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+ done
+ fi
fi
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"
IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}"
-fakeroot rootfs_ipk_do_rootfs () {
+rootfs_ipk_do_indexes () {
set -x
-
- mkdir -p ${IMAGE_ROOTFS}/dev
+
+ ipkgarchs="${PACKAGE_ARCHS}"
if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then
touch ${DEPLOY_DIR_IPK}/Packages
ipkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK}
fi
+
+ for arch in $ipkgarchs; do
+ if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then
+ if [ -e ${DEPLOY_DIR_IPK}/$arch/ ] ; then
+ touch ${DEPLOY_DIR_IPK}/$arch/Packages
+ 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/
+ fi
+ fi
+ done
+}
+
+fakeroot rootfs_ipk_do_rootfs () {
+ set -x
+
+ rootfs_ipk_do_indexes
+
mkdir -p ${T}
echo "src oe file:${DEPLOY_DIR_IPK}" > ${T}/ipkg.conf
ipkgarchs="${PACKAGE_ARCHS}"