For one of my devices I need to add a few entries to /dev for the
serial console. Currently there's a IMAGE_DEVICE_TABLE which gets set
to the files/device_table-minimal.txt found in the BBPATH.

I could create a new device table by copying the minimum and add the
entry I need, or I could modify the default. But it seems that it'd
be better to just accept multiple device tables and then I can list
both the minimal and the additional device tables. I can see several
other situations in which this would be useful.

The attached patch implements this.

Does anyone have any issues with this?


This allows me to just do:

 IMAGE_DEVICE_TABLES = "files/device_table-minimal.txt 
files/device_table-sci.txt"

where files/device_table-sci.txt contains:

 # Include nodes for the SCI/SCIF serial ports on sh* boards
 /dev/ttySC      c       640     0       5       204     8       0       1      
 3

to get the SCI/SCIF serial ports added for my sh based devices.

I used a different variable IMAGE_DEVICE_TABLES which is only used if
the old IMAGE_DEVICE_TABLE is not definied. I also made it
automatically search in the BBPATH for the files since it's unlikley
you'd do anything else.


# 
# old_revision [96fed78607f0529e7177d55147568944ff559a90]
# 
# patch "classes/image_ipk.bbclass"
#  from [5e8b8b72db00683bd7b06c9a1a96b7a2b4fcaee0]
#    to [935b5d13f5a8fe86f87938476769f3696639e0e7]
# 
============================================================
--- classes/image_ipk.bbclass   5e8b8b72db00683bd7b06c9a1a96b7a2b4fcaee0
+++ classes/image_ipk.bbclass   935b5d13f5a8fe86f87938476769f3696639e0e7
@@ -22,7 +22,27 @@
 
 DEPENDS += "[EMAIL PROTECTED](d)}"
 
-IMAGE_DEVICE_TABLE ?= "[EMAIL PROTECTED](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 of files/device_table-minimal.txt
+# the BBPATH is used (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 @@
 
        if [ "${USE_DEVFS}" != "1" ]; then
                mkdir -p ${IMAGE_ROOTFS}/dev
-               makedevs -r ${IMAGE_ROOTFS} -D ${IMAGE_DEVICE_TABLE}
+               for devtable in [EMAIL PROTECTED](d)}; do
+                       makedevs -r ${IMAGE_ROOTFS} -D $devtable
+               done
        fi
 
        real_do_rootfs

-- 
 Jamie Lenehan <[EMAIL PROTECTED]>
_______________________________________________
Oe mailing list
[email protected]
https://www.handhelds.org/mailman/listinfo/oe

Reply via email to