Code review comment for lp:~adeuring/launchpad/hwdb-submissions-with-udev-data

Revision history for this message
Abel Deuring (adeuring) wrote :

This branch changes the RelaxNG schema hardware-1_0.rng to allow
HWDB submissions without HAL data.

As discussed in bug 399319, both checkbox (the HWDB client) and
Launchpad's hardware database rely up to now on HAL data as the
main source for device data.

HAL will be retired in Karmic++, so we have to switch to other
data sources. These new sources are udev, the attribute files
found in sysfs and some DMI (Desktop management Interface) data.

The XML data submitted by checkbox is validated against a RelaxNG
schema file; this branch extends the schema so that submissions
with the new data will pass the validation.

The changes:

1. The node <hal> is no longer unconcitionally required; instead
the nodes <udev>, <dmi> and <sysfs-attributes> may appear.

2. The submitted data may contain test results, where the tests
can/should refer to existing devices. Each HAL device node
has a unique integer attribute "id"; the test results may have a
node <target id="123">, where "id" should reference HAL node
with the same "id" value.

The new udev data is the plain text output from running "udevadm
info --export-db", which does not contain unique integer IDs for
devices. Instead, devices are identified by their sysfs path.
This path will be used to identify devices in tests; hence the
schema file now allows arbitrary strings for <target id="...">.

3. HAL provided the kernel version; this is replaced by the new
node <kernel-release>.

This branch also adds a sample file containing the new data,
l/c/l/scripts/tests/hardwaretest-udev.xml. This is a modified
variant of l/c/l/scripts/tests/hardwaretest.xml; running diff
for these two files may give a better idea what this change is
about than simply looking at the new file.

If you want to check if the sample file is indeed valid, run

xmllint --noout --relaxng hardware-1_0.rng tests/hardwaretest-udev.xml

And

xmllint --noout --relaxng hardware-1_0.rng tests/hardwaretest.xml

shows that "old" data still validates.

Real tests of the schema changes will follow in another branch.

« Back to merge proposal