[oe] image.bbclass IMAGE_DEVICE_TABLES issues

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Wed Jun 16 12:27:10 UTC 2010


Hi,

I am having an issue or two with image.bbclass and especially the
devtable section.

It concers the following part:

# Get a list of files containing tables of devices to be created.
# * 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, searched
#   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
    devtables = bb.data.getVar('IMAGE_DEVICE_TABLES', d, 1)
    if devtables == None:
        devtables = 'files/device_table-minimal.txt'
    return " ".join([ bb.which(bb.data.getVar('BBPATH', d, 1), devtable)
                      for devtable in devtables.split() ])

The issues I have are the following:
1. if the file is not there an empty list is returned and used without
any error being given.
In case of the default name that is probably ok, but if there is an
explicit IMAGE_DEVICE_TABLE or IMAGE_DEVICE_TABLES given and the file
is not there I would qualify the situation as an error.
Guess it would be very convenient to have an error message in that case.
2. According to the comment for IMAGE_DEVICE_TABLES (and for the
default name) the file is searched for in BBPATH. For me BBPATH points
to an overlay dir with below it recipes/myimage/myimage.bb
The code does join the names but (at least with my limited python
knowledge) does not look into subdirs. This is experimentally
verified.
I feel it is more appropriate to have the device table near the bb
file (e.g. in recipes/myimage/mydevicetable.txt)
currently I have to either specify a path in IMAGE_DEVICE_TABLES
(which I don't like because it makes the recipe dependent of the
actual place in the tree, so it is not robust to moving it), or have
the device table on the level of recipes (which I do not like either
as it is not near the recipe).
My suggestion would be to look in the dir of the recipe or in ${WORKDIR}

What do people think about this?
I'm not really a python wiz, so if someone can contribute a patch that
would be greatly appreciated.

Frans




More information about the Openembedded-devel mailing list