pika-drivers/data/generate_driver_definitions.sh

29 lines
894 B
Bash
Raw Normal View History

2023-06-29 21:48:30 +02:00
#! /bin/bash
### Get traditional ubuntu-driver list
2023-06-29 21:48:30 +02:00
UBUNTU_DRIVERS="$(ubuntu-drivers list | grep -vi -server)"
2023-06-29 21:52:19 +02:00
### Check if the amdgpu module is loaded
### advanced micro devices graphics cards with "radeon" module only do not support the additional drivers
2023-06-29 21:52:19 +02:00
if inxi -G | grep " loaded" | grep "amdgpu" &> /dev/null
then
AMDGPU_DRIVERS="$(echo -e "pika-rocm-meta\nvulkan-amdgpu-pro\namf-amdgpu-pro\namdvlk\nopencl-legacy-amdgpu-pro-icd\namdgpu-pro-oglp")"
2023-06-29 21:52:19 +02:00
fi
### Check for xbox equipment
if lsusb | grep -i xbox &> /dev/null
then
XONE_DRIVERS="$(echo -e "xone-dkms")"
fi
### Merge all drivers together
DRIVERS="$(printf "$UBUNTU_DRIVERS\n$AMDGPU_DRIVERS\n$XONE_DRIVERS")"
### If no drivers were found set them to random hash to trigger no drivers needed dialog in gui app
2023-06-29 21:48:30 +02:00
if [[ -z $DRIVERS ]]
then
DRIVERS=emScuM8rsa6kuhMePtR5bT8s4z9s
fi
### Print result
2023-06-29 21:48:30 +02:00
echo $DRIVERS | tr " " "\n"