blob: 1edf49546e903fd6bafb12dbe81c0221990a3258 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
include ../Makefile.config
ARCH := $(patsubst i%86,i386,$(shell uname -m))
ARCH := $(patsubst sparc%,sparc,$(ARCH))
TABLES1 = pcitable usbtable
TABLES2 = isatable pcmciatable dmitable
TABLES3 = ScannerDB.gz
TABLES4 = scannerconfigs
TABLES = $(TABLES1) $(TABLES2)
TMP_TABLES1 = $(TABLES1:%=%.tmp)
TMP_TABLES2 = $(TABLES2:%=%.tmp)
TMP_TABLES = $(TABLES:%=%.tmp)
build: preferred-modules.alias
update-ids: new-usb-ids new-pci-ids new-oui-txt new-pnp-csv
clean:
rm -f *~ *.tmp ScannerDB.gz preferred-modules.alias fallback-modules.alias
check:
@../convert/merge2pcitable.pl pcitable pcitable.x86_64 pcitable.x86_64 > .pcitable
@diff -u pcitable.x86_64 .pcitable
@../convert/merge2pcitable.pl pcitable pcitable pcitable > .pcitable
@diff -u pcitable .pcitable
@../convert/merge2pcitable.pl pcitable usbtable usbtable > .usbtable
@LC_ALL=C.iso-8859-1 sed -e 's!\s"[^"]*"$$!!' < usbtable > .usbtable2
@diff -u .usbtable2 .usbtable
@cd ../convert; ./verify_Cards.pl
@rm -f .pcitable .usbtable*
fallback-modules.alias:
cp `ls -tr /lib/modules/*/modules.alias | tail -1` fallback-modules.alias
preferred-modules.alias: hardcoded-modules.alias fallback-modules.alias
@../convert/uniquify-modalias.pl > $@ 2>undecided.alias
@cat hardcoded-modules.alias >> $@
$(TMP_TABLES1): %.tmp: %
../convert/merge2pcitable.pl pcitable $< $<.$(ARCH) > $@
$(TMP_TABLES2): %.tmp: %
cp -f $< $@
$(TABLES3):
gzip -vc9 ScannerDB > ScannerDB.gz
new-usb-ids:
@curl --compressed -O http://www.linux-usb.org/usb.ids
new-pci-ids:
@curl --compressed -O https://pci-ids.ucw.cz/v2.2/pci.ids
new-oui-txt:
@curl --compressed -O https://standards-oui.ieee.org/oui/oui.txt
# Fix DOS EOL.
@sed -E -e 's/\r//g;s/\s+$$//g' -i oui.txt
new-pnp-csv:
@curl --compressed -o pnp.ids.csv https://uefi.org/uefi-pnp-export
# Remove header, replace csv separator "," with "|", and remove quotes.
@sed -e 1d -Ee :1 -e 's/^(([^",]|"[^"]*")*),/\1|/;t1' -e 's/\"//g' -i pnp.ids.csv
# Swap columns 1 and 2, and delete the 3rd (date). Sort by IDs and save to pnp.ids.
@awk -F'|' '{ x = $$1; $$1 = $$2; $$2 = x; print $$1"\t"$$2; }' pnp.ids.csv | sort > pnp.ids
# Delete the csv file.
@rm -f pnp.ids.csv
install: $(TMP_TABLES) $(TABLES3)
for i in $(TABLES); do \
mkdir -p $(dir)/$$i.d ; \
(echo "# This file was created:" `date '+%Y-%m-%d %H:%M:%S (%z)'` ; \
echo "# !! The latest version is available via git at" ; \
echo "# http://gitweb.mageia.org/software/ldetect-lst/" ; \
cat $$i.tmp \
) > $(dir)/$$i.d/90default.lst; done
gzip -9 $(dir)/{pcitable,usbtable,dmitable}.d/90default.lst
install -m 644 ScannerDB.gz scannerconfigs Cards+ MonitorsDB isdn.db $(dir)
# make MonitorDB looks fine for XFdrake (b/c of sync with RH):
perl -pi -e 's!^Generic CRT Display; Monitor !Generic; !; s!Generic LCD Display; LCD Panel !Generic; Flat Panel !' $(dir)/MonitorsDB
install -m 644 fallback-modules.alias $(dir)/fallback-modules.alias
install -D -m 644 preferred-modules.alias $(slibdir)/module-init-tools/ldetect-lst-modules.alias
install -D -m 644 oui.txt usb.ids pci.ids $(prefix)/share
mkdir -p $(prefix)/share/misc
install -D -m 644 pnp.ids $(prefix)/share/misc
|