summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie Lenehan <lenehan@twibble.org>2006-07-06 14:37:51 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-07-06 14:37:51 +0000
commit9bfbf27d78e0edd5f639c2eaee98f5e506ce7cc6 (patch)
treeb105e397233bfd881e8217fc92bfff5b6d960534
parent5e2403ec7fcd6f8e0a84732b9885229b046b3015 (diff)
classes/image_ipk: Add support for multiple device tables. The original code
support a single value as IMAGE_DEVICE_TABLE which needed to be an absolute value. If that is definied it'll be used as is and this change will have no effect. If is is not definied it'll check for IMAGE_DEVICE_TABLES which can be a list of device images tables which are searched for relative to the BBPATH and it'll apply each one in turn. If neither of these are definied it'll use the default of files/device_table-minimal.txt
-rw-r--r--classes/image_ipk.bbclass26
1 files changed, 24 insertions, 2 deletions
diff --git a/classes/image_ipk.bbclass b/classes/image_ipk.bbclass
index c2f1c8d682..d3923f06a2 100644
--- a/classes/image_ipk.bbclass
+++ b/classes/image_ipk.bbclass
@@ -22,7 +22,27 @@ def get_image_deps(d):
DEPENDS += "${@get_image_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 ?= ""
# Must call real_do_rootfs() from inside here, rather than as a separate
@@ -33,7 +53,9 @@ fakeroot do_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
real_do_rootfs