From 8d3d5321871251c48ab68788498a9e77f635884b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 9 Feb 2023 15:44:57 +0100 Subject: [nvidia-common] Fix parsing PCIIDs from html file We missed some cards where the subsystem vendor:devid was listed after the main devid. --- core/modules/nvidia-common/module.build | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'core/modules/nvidia-common') 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='^]*>([0-9A-F]{4})(\s+[0-9A-F]{4}\s+[0-9A-F]{4})?<' mode=0 while read -r line; do if [[ "$line" =~ ']*>([^<]+)<.*$/\1/') - elif [[ "$mode" = 2 ]] && [[ "$line" =~ ^'']*'>'[0-9A-F]{4}'<' ]]; then + #name=$(echo "$line" | sed -r 's/^.*]*>([^<]+)<.*$/\1/') + elif [[ "$mode" = 2 ]] && [[ "$line" =~ $regex ]]; then mode=0 - dev=$(echo "$line" | sed -r 's/^.*]*>([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 -- cgit v1.2.3-55-g7522