mirror of
https://github.com/theupriser/steamify-cachyos-live-iso.git
synced 2026-10-02 15:10:26 +02:00
🧹 remove nvidia drivers during offline install, if no nvidia was detected
This commit is contained in:
1 file changed
+16
-2
@@ -9,11 +9,11 @@ _clean_files() {
|
|||||||
/usr/local/bin/prepare-live-desktop.sh
|
/usr/local/bin/prepare-live-desktop.sh
|
||||||
/usr/local/bin/removeun-online
|
/usr/local/bin/removeun-online
|
||||||
)
|
)
|
||||||
|
|
||||||
local xx
|
local xx
|
||||||
for xx in "${_files_to_remove[@]}"; do rm -f "$xx" || true; done
|
for xx in "${_files_to_remove[@]}"; do rm -f "$xx" || true; done
|
||||||
}
|
}
|
||||||
|
|
||||||
# taken from Erik Dubois script
|
|
||||||
_clean_packages() {
|
_clean_packages() {
|
||||||
local _packages_to_remove=(
|
local _packages_to_remove=(
|
||||||
gparted
|
gparted
|
||||||
@@ -37,11 +37,25 @@ _clean_packages() {
|
|||||||
memtest86+
|
memtest86+
|
||||||
mkinitcpio-archiso
|
mkinitcpio-archiso
|
||||||
)
|
)
|
||||||
|
|
||||||
|
local _nvidia_packages_to_remove=(nvidia-dkms nvidia-utils)
|
||||||
|
|
||||||
|
local _check_nvidia_card="$(mhwd --is_nvidia_card | grep -q 'NVIDIA card found!'; echo $?)"
|
||||||
|
if [[ "${_check_nvidia_card}" -ne 0 ]]; then
|
||||||
|
echo "No NVIDIA card detected. Removing nvidia drivers"
|
||||||
|
|
||||||
local xx
|
local xx
|
||||||
# @ does one by one to avoid errors in the entire process
|
# @ does one by one to avoid errors in the entire process
|
||||||
# * can be used to treat all packages in one command
|
for xx in "${_nvidia_packages_to_remove[@]}"; do pacman -Rc "$xx" --noconfirm; done
|
||||||
|
fi
|
||||||
|
|
||||||
|
local xx
|
||||||
|
# @ does one by one to avoid errors in the entire process
|
||||||
|
# taken from Erik Dubois script
|
||||||
for xx in "${_packages_to_remove[@]}"; do pacman -Rsc "$xx" --noconfirm; done
|
for xx in "${_packages_to_remove[@]}"; do pacman -Rsc "$xx" --noconfirm; done
|
||||||
}
|
}
|
||||||
|
|
||||||
_clean_packages
|
_clean_packages
|
||||||
_clean_files
|
_clean_files
|
||||||
|
|
||||||
|
# vim:set ft=bash sw=2 sts=2 et:
|
||||||
Reference in new issue
Block a user