diff options
author | Simon Rettberg | 2023-02-09 15:44:57 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-02-09 15:44:57 +0100 |
commit | 8d3d5321871251c48ab68788498a9e77f635884b (patch) | |
tree | 87e4684a63d36946023a1bf0a7818b0b64ff3efc /core/modules/nvidia-common | |
parent | [lightdm-greeter-bwlp] Preload Xorg too (diff) | |
download | mltk-8d3d5321871251c48ab68788498a9e77f635884b.tar.gz mltk-8d3d5321871251c48ab68788498a9e77f635884b.tar.xz mltk-8d3d5321871251c48ab68788498a9e77f635884b.zip |
[nvidia-common] Fix parsing PCIIDs from html file
We missed some cards where the subsystem vendor:devid was listed after
the main devid.
Diffstat (limited to 'core/modules/nvidia-common')
-rw-r--r-- | core/modules/nvidia-common/module.build | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/modules/nvidia-common/module.build b/core/modules/nvidia-common/module.build index 2dbb6a36..0ae2ee64 100644 --- a/core/modules/nvidia-common/module.build +++ b/core/modules/nvidia-common/module.build @@ -105,6 +105,7 @@ build() { else local mode line name dev version pinfo "Creating drm.cfg" + local regex='^<td[^>]*>([0-9A-F]{4})(\s+[0-9A-F]{4}\s+[0-9A-F]{4})?<' mode=0 while read -r line; do if [[ "$line" =~ '<a name="legacy_' ]]; then @@ -113,10 +114,11 @@ build() { mode=1 elif [[ "$mode" = 1 ]] && [[ "$line" =~ ^'<td' ]]; then mode=2 - name=$(echo "$line" | sed -r 's/^.*<td[^>]*>([^<]+)<.*$/\1/') - elif [[ "$mode" = 2 ]] && [[ "$line" =~ ^'<td'[^'>']*'>'[0-9A-F]{4}'<' ]]; then + #name=$(echo "$line" | sed -r 's/^.*<td[^>]*>([^<]+)<.*$/\1/') + elif [[ "$mode" = 2 ]] && [[ "$line" =~ $regex ]]; then mode=0 - dev=$(echo "$line" | sed -r 's/^.*<td[^>]*>([0-9A-Fa-f]{4})<.*$/\1/' | tr 'A-Z' 'a-z') + dev="${BASH_REMATCH[1]}" + dev="${dev~~}" if [ -n "${pciids[$dev]}" ]; then pdebug "$dev already handled" else |