forked from pool/nvidia-open-driver-G06-signed
- Add a second flavor for building the kernel module versions used by CUDA. The kmp targetting CUDA contains '-cuda' in its name to track its versions separately from the graphics kmp. - Provide the meta package nv-prefer-signed-open-driver to make sure the latest available SUSE-build open driver is installed - independent of the latest available open driver version in he CUDA repository. Rationale: The package cuda-runtime provides the link between CUDA and the kernel driver version through a Requires: cuda-drivers >= %version This implies that a CUDA version will run withany kernel driver version equal or higher than a base version. nvidia-compute-G06 provides the glue layer between CUDA and a specific version of he kernel driver both by providing a set of base libraries and by requiring a specific kernel version. 'cuda-drivers' (provided by nvidia-compute-utils-G06) requires an unversioned nvidia-compute-G06. With this, the resolver will install the latest available and applicable nvidia-compute-G06. nv-prefer-signed-open-driver then represents the latest available open driver version and restricts the nvidia-compute-G06 version to it. * addresses boo#1223454 OBS-URL: https://build.opensuse.org/request/show/1185229 OBS-URL: https://build.opensuse.org/package/show/X11:Drivers:Video:Redesign/nvidia-open-driver-G06-signed?expand=0&rev=101
46 lines
1.2 KiB
Bash
46 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
PCI_ID_FILE=$1
|
|
shift
|
|
|
|
tmp=$(mktemp)
|
|
trap 'rm -f "$tmp"' EXIT
|
|
|
|
/usr/lib/rpm/find-supplements.ksyms "$@" >"$tmp"
|
|
# the system script currently only generates modalias(...) lines, but allow
|
|
# other dependencies just in case
|
|
grep -v '^modalias(' "$tmp"
|
|
|
|
# determine the kernel flavor
|
|
krel=$(sed -rn 's/modalias\(([^:]*):.*/\1/p; T; q' "$tmp")
|
|
if test -z "$krel"; then
|
|
exit
|
|
fi
|
|
|
|
# Tumbleweed
|
|
# pci_ids-390.144_k5.14.0_1.legacy --> pci_ids-390.144.legacy
|
|
# pci_ids-390.144_k5.14.0_1.new --> pci_ids-390.144.new
|
|
# pci_ids-390.144_k5.14.0_1 --> pci_ids-390.144
|
|
# Leap/SLES
|
|
# pci_ids-390.144.legacy (no changes)
|
|
# pci_ids-390.144.new (no changes)
|
|
# pci_ids-390.144 (no changes)
|
|
|
|
legacy=0
|
|
new=0
|
|
echo $PCI_ID_FILE | grep -q legacy && legacy=1
|
|
echo $PCI_ID_FILE | grep -q new && new=1
|
|
|
|
PCI_ID_FILE=$(echo $PCI_ID_FILE | sed -e 's/_k.*//g' -e 's/.legacy//g' -e 's/.new//g')
|
|
|
|
if [ $legacy -eq 1 ]; then
|
|
PCI_ID_FILE=$PCI_ID_FILE.legacy
|
|
elif [ $new -eq 1 ]; then
|
|
PCI_ID_FILE=$PCI_ID_FILE.new
|
|
fi
|
|
|
|
# and create our own list of modalias supplements
|
|
for id in $(cat ${PCI_ID_FILE} | cut -d " " -f 1|sed 's/0x//g'); do
|
|
echo "modalias(${krel}:pci:v000010DEd0000${id}sv*sd*bc03sc0[02]i00*)"
|
|
done
|