classes/image_ipk: Add support for multiple device tables. The original code
authorJamie Lenehan <lenehan@twibble.org>
Thu, 6 Jul 2006 14:37:51 +0000 (14:37 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Thu, 6 Jul 2006 14:37:51 +0000 (14:37 +0000)
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

classes/image_ipk.bbclass

index c2f1c8d..d3923f0 100644 (file)
@@ -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