3
# Install linux-restricted-modules and binutils, start the script, and put its
4
# output to modalias_override/nvidia.
6
# This is a nasty kluge, but it seems to work. Better check the output when
7
# upgrading to a new release of the nvidia driver, though.
9
# Whenever a PCI ID is supported by both nvidia and nvidia_legacy, it is only
12
echo "# Listing generated by nvidia_supported. Do not edit manually."
17
# Find the first symbol of the .rodata section...
18
objdump --section=.rodata --syms "$filename" |
19
sed -n '/SYMBOL TABLE/,+2 {
20
s/^\([0-9a-f]\+\)\s\+l\s\+O\s\+\S\+\s\+\([0-9a-f]\+\)\s\+\(\S\+\).*/\1 \2 \3/p
22
while read start stop symname; do
23
# ...and grab the IDs from its hex dump.
24
objdump --section=.rodata --full-contents \
25
--start-address="0x$start" --stop-address="0x$stop" "$filename" |
26
sed -n 's/^ [0-9a-f]\+ \([0-9a-f]\{2\}\)\([0-9a-f]\{2\}\).*/\2\1/p' |
31
set -- "/lib/linux-restricted-modules/$(uname -r)/nvidia/nv-kernel.o" nvidia \
32
"/lib/linux-restricted-modules/$(uname -r)/nvidia_legacy/nv-kernel.o" nvidia_legacy
40
orig_ids="$(device_ids "$filename")"
43
for id in $orig_ids; do
46
# Already seen the ID.
50
seen_ids="${seen_ids}${id} "
57
printf "alias pci:v%08Xd%08Xsv*sd*bc03sc*i* %s\n" \
58
0x10de "0x$id" "$modname"