Add mesa drivers

This commit is contained in:
Ward Nakchbandi (Cosmic Fusion) 2023-08-14 15:41:42 +03:00 committed by GitHub
parent 5a6f2a9853
commit dd6258eafa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 5 deletions

View File

@ -3,6 +3,9 @@
### Get traditional ubuntu-driver list ### Get traditional ubuntu-driver list
DRIVERS="$(ubuntu-drivers list | grep -vi -server)" DRIVERS="$(ubuntu-drivers list | grep -vi -server)"
### Put mesa driver flaours in the list
DRIVERS="$DRIVERS mesa-hybrid mesa-stable mesa-git"
### Check if the amdgpu module is loaded ### Check if the amdgpu module is loaded
### advanced micro devices graphics cards with "radeon" module only do not support the additional drivers ### advanced micro devices graphics cards with "radeon" module only do not support the additional drivers
if inxi -G | grep driver | grep amdgpu &> /dev/null if inxi -G | grep driver | grep amdgpu &> /dev/null

View File

@ -2,7 +2,12 @@
if [[ $1 == "version" ]] if [[ $1 == "version" ]]
then then
if [[ $2 == "pika-rocm-meta" ]]
then
echo "Version: $(apt-cache show rocm-core | grep Version: | cut -d":" -f2 | head -n1)"
else
echo "Version: $(apt-cache show $2 | grep Version: | cut -d":" -f2 | head -n1)" echo "Version: $(apt-cache show $2 | grep Version: | cut -d":" -f2 | head -n1)"
fi
else else
if [[ $1 == "description" ]] if [[ $1 == "description" ]]
then then
@ -21,12 +26,17 @@ else
if echo "$2" | grep -i -E 'nvidia' &> /dev/null if echo "$2" | grep -i -E 'nvidia' &> /dev/null
then then
DEVICE="$(lspci | grep -i -E 'vga|display|3d' | cut -d":" -f3 | grep -i nvidia)" DEVICE="$(lspci | grep -i -E 'vga|display|3d' | cut -d":" -f3 | grep -i nvidia)"
else
if echo "$2" | grep -i -E 'mesa' &> /dev/null
then
DEVICE="$(lspci | grep -i -E 'vga|display|3d' | cut -d":" -f3)"
else else
DEVICE="$(ubuntu-drivers devices | sed ':a;N;$!ba;s/\nmodel/ /g' | grep vendor | grep -i $2 | sed 's/vendor/Device:/')" DEVICE="$(ubuntu-drivers devices | sed ':a;N;$!ba;s/\nmodel/ /g' | grep vendor | grep -i $2 | sed 's/vendor/Device:/')"
fi fi
fi fi
fi fi
fi fi
fi
if [[ ! -z $DEVICE ]] if [[ ! -z $DEVICE ]]
then then
echo "Device: $DEVICE" echo "Device: $DEVICE"

View File

@ -37,12 +37,22 @@ fi
if dpkg -s "$1" if dpkg -s "$1"
then then
if echo $pkg | grep -i mesa
then
zenity --error --text "the following driver "$1" can not be removed only swapped"
else
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY bash -c "apt remove $pkg -y && sudo apt autoremove -y" pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY bash -c "apt remove $pkg -y && sudo apt autoremove -y"
fi
else else
if echo $pkg | grep -i nvidia if echo $pkg | grep -i nvidia
then then
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY bash -c "apt update -y && apt purge nvidia-driver-* -y && apt install $pkg -y && sudo apt autoremove -y" pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY bash -c "apt update -y && apt purge nvidia-driver-* -y && apt install $pkg -y && sudo apt autoremove -y"
else
if echo $pkg | grep -i mesa-hybrid
then
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY bash -c "apt update -y && apt install mesa-stable -y && apt install mesa-hybrid -y && sudo apt autoremove -y"
else else
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY bash -c "apt update -y && apt install $pkg -y && sudo apt autoremove -y" pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY bash -c "apt update -y && apt install $pkg -y && sudo apt autoremove -y"
fi fi
fi
fi fi

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
pika-drivers (0.4.2-99pika2.lunar) lunar; urgency=medium pika-drivers (0.4.3-99pika1.lunar) lunar; urgency=medium
* initial release * initial release