patch to reduce the size of discover-data-udeb
Hi Jeff
I was working on discover2 during d-i debcamp last week. I'm sending you
my changes to integrate them into the discover2 packages. I hope you
will find some time to work on them again soon.
These are the changes:
Makefile:
- only include needed devicetypes (instead of excluding uneeded ones)
- do not install old hwlist in udeb
- compress udeb hwlists
debian/control
- add build dependency on python-xml
debian/rules
- do not include docs in udeb
reduce-xml:
- remove entries with kernel module "unknown" or "ignore"
If you have better python-xml skills, you will probably
find a better way to adress this node in the xml-tree.
There's also a M$-Excel File in the source tar file
(merged_vendor_list.xls). AFAIK debian policy does not allow proprietary
data formats in source files.
Greetings
gaudenz
diff -ru discover-data-2.2003.02.05/Makefile discover-data-2.2003.02.05.new/Makefile
--- discover-data-2.2003.02.05/Makefile 2003-06-19 21:57:39.000000000 +0200
+++ discover-data-2.2003.02.05.new/Makefile 2003-09-30 20:17:07.000000000 +0200
@@ -47,11 +47,11 @@
shortxmllists: $(hwlists_DATA)
./reduce-xml --class-spec=linux:2.4 \
- --exclude-bus=audio,miscellaneous,display,video \
+ --include-bus=modem,broadband,network,humaninput,removabledisk,bridge,fixeddisk,optical \
-i pci-vendor.xml -i pci-busclass.xml -i pci-device.xml \
-o pci-device-short.xml
./reduce-xml --class-spec=linux:2.4 \
- --exclude-bus=audio,miscellaneous,display,video \
+ --include-bus=modem,broadband,network,humaninput,removabledisk,bridge,fixeddisk,optical \
-i usb-vendor.xml -i usb-busclass.xml -i usb-device.xml \
-o usb-device-short.xml
@@ -63,9 +63,6 @@
install-udeb: shorthwlists shortxmllists
install -m 755 -d $(DESTDIR)$(hwlistsdir)
- for list in $(old_hwlists_DATA); do \
- install -m 644 $$list-short $(DESTDIR)$(hwlistsdir)/$$list; \
- done
# Install the full Discover 2.x data set into the udeb.
install -m 644 $(hwlists_DATA) $(DESTDIR)$(hwlistsdir)
@@ -76,6 +73,9 @@
install -m 644 usb-device-short.xml \
$(DESTDIR)$(hwlistsdir)/usb-device.xml
+# Compress hardware lists
+ gzip -9 $(DESTDIR)$(hwlistsdir)/*.xml
+
uninstall:
for i in $(old_hwlists_DATA) $(hwlists_DATA); do rm $(DESTDIR)$(hwlistsdir)/$$i; done
for i in $(discover_data_EXEC); do rm $(DESTDIR)$(execdir)/$$i; done
diff -ru discover-data-2.2003.02.05/debian/control discover-data-2.2003.02.05.new/debian/control
--- discover-data-2.2003.02.05/debian/control 2003-02-05 18:52:37.000000000 +0100
+++ discover-data-2.2003.02.05.new/debian/control 2003-09-27 11:23:36.000000000 +0200
@@ -3,7 +3,7 @@
Priority: optional
Maintainer: Progeny Debian Packaging Team <debian-packages@progeny.com>
Uploaders: Branden Robinson <branden@progeny.com>
-Build-Depends-Indep: debhelper (>= 4.0)
+Build-Depends-Indep: debhelper (>= 4.0), python2.3-xml
Standards-Version: 3.5.7
Package: discover-data
diff -ru discover-data-2.2003.02.05/debian/rules discover-data-2.2003.02.05.new/debian/rules
--- discover-data-2.2003.02.05/debian/rules 2003-02-05 18:56:12.000000000 +0100
+++ discover-data-2.2003.02.05.new/debian/rules 2003-10-01 10:49:39.000000000 +0200
@@ -37,8 +37,8 @@
binary-indep: build install discover-data-udeb
dh_testdir
dh_testroot
- dh_installdocs
- dh_installchangelogs ChangeLog
+ dh_installdocs -Ndiscover-data-udeb
+ dh_installchangelogs ChangeLog -Ndiscover-data-udeb
dh_compress -Ndiscover-data-udeb
dh_fixperms -Ndiscover-data-udeb
dh_installdeb -Ndiscover-data-udeb
diff -ru discover-data-2.2003.02.05/reduce-xml discover-data-2.2003.02.05.new/reduce-xml
--- discover-data-2.2003.02.05/reduce-xml 2003-06-05 08:17:33.000000000 +0200
+++ discover-data-2.2003.02.05.new/reduce-xml 2003-09-30 20:13:45.000000000 +0200
@@ -210,11 +210,15 @@
for data_node in device_node.childNodes:
if data_node.nodeType != xml.dom.Node.ELEMENT_NODE:
continue
+
do_data_node = False
for spec in config["classspec"]:
if find_spec(spec, data_node):
- do_data_node = True
- break
+
+ module_name = data_node.firstChild.nextSibling.firstChild.nextSibling.firstChild.nodeValue
+ if (module_name != "ignore") and (module_name != "unknown"):
+ do_data_node = True
+ break
if do_data_node:
if new_device_node is None:
Reply to: