@@ -1,5 +1,8 @@
|
|||||||
## Changelogs
|
## Changelogs
|
||||||
|
|
||||||
|
## 29 Jan 2025
|
||||||
|
- enhanced nvidia.sh to add additional systemd-bootloader entries for nvidia
|
||||||
|
|
||||||
## 16 Jan 2025
|
## 16 Jan 2025
|
||||||
- updated nvidia.sh to install non-git libva-nvidia-driver
|
- updated nvidia.sh to install non-git libva-nvidia-driver
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ install_package_pacman() {
|
|||||||
else
|
else
|
||||||
# Package not installed
|
# Package not installed
|
||||||
echo -e "${NOTE} Installing $1 ..."
|
echo -e "${NOTE} Installing $1 ..."
|
||||||
sudo pacman -S --noconfirm "$1" 2>&1 | tee -a "$LOG"
|
sudo pacman -S --noconfirm --needed "$1" 2>&1 | tee -a "$LOG"
|
||||||
# Making sure package is installed
|
# Making sure package is installed
|
||||||
if pacman -Q "$1" &>/dev/null ; then
|
if pacman -Q "$1" &>/dev/null ; then
|
||||||
echo -e "\e[1A\e[K${OK} Package ${YELLOW}$1${RESET} has been successfully installed!"
|
echo -e "\e[1A\e[K${OK} Package ${YELLOW}$1${RESET} has been successfully installed!"
|
||||||
@@ -51,7 +51,7 @@ install_package() {
|
|||||||
else
|
else
|
||||||
# Package not installed
|
# Package not installed
|
||||||
echo -e "${NOTE} Installing $1 ..."
|
echo -e "${NOTE} Installing $1 ..."
|
||||||
$ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG"
|
$ISAUR -S --noconfirm --needed "$1" 2>&1 | tee -a "$LOG"
|
||||||
# Making sure package is installed
|
# Making sure package is installed
|
||||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||||
echo -e "\e[1A\e[K${OK} Package ${YELLOW}$1${RESET} has been successfully installed!"
|
echo -e "\e[1A\e[K${OK} Package ${YELLOW}$1${RESET} has been successfully installed!"
|
||||||
|
|||||||
@@ -70,29 +70,55 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Additional for GRUB users
|
# Additional for GRUB users
|
||||||
# Check if /etc/default/grub exists
|
|
||||||
if [ -f /etc/default/grub ]; then
|
if [ -f /etc/default/grub ]; then
|
||||||
|
printf "GRUB bootloader detected\n" 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
# Check if nvidia-drm.modeset=1 is present
|
# Check if nvidia-drm.modeset=1 is present
|
||||||
if ! sudo grep -q "nvidia-drm.modeset=1" /etc/default/grub; then
|
if ! sudo grep -q "nvidia-drm.modeset=1" /etc/default/grub; then
|
||||||
sudo sed -i -e 's/\(GRUB_CMDLINE_LINUX_DEFAULT=".*\)"/\1 nvidia-drm.modeset=1"/' /etc/default/grub
|
sudo sed -i -e 's/\(GRUB_CMDLINE_LINUX_DEFAULT=".*\)"/\1 nvidia-drm.modeset=1"/' /etc/default/grub
|
||||||
echo "nvidia-drm.modeset=1 added to /etc/default/grub" 2>&1 | tee -a "$LOG"
|
printf "nvidia-drm.modeset=1 added to /etc/default/grub\n" 2>&1 | tee -a "$LOG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if nvidia_drm.fbdev=1 is present
|
# Check if nvidia_drm.fbdev=1 is present
|
||||||
if ! sudo grep -q "nvidia_drm.fbdev=1" /etc/default/grub; then
|
if ! sudo grep -q "nvidia_drm.fbdev=1" /etc/default/grub; then
|
||||||
sudo sed -i -e 's/\(GRUB_CMDLINE_LINUX_DEFAULT=".*\)"/\1 nvidia_drm.fbdev=1"/' /etc/default/grub
|
sudo sed -i -e 's/\(GRUB_CMDLINE_LINUX_DEFAULT=".*\)"/\1 nvidia_drm.fbdev=1"/' /etc/default/grub
|
||||||
echo "nvidia_drm.fbdev=1 added to /etc/default/grub" 2>&1 | tee -a "$LOG"
|
printf "nvidia_drm.fbdev=1 added to /etc/default/grub\n" 2>&1 | tee -a "$LOG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Regenerate GRUB configuration
|
# Regenerate GRUB configuration
|
||||||
if sudo grep -q "nvidia-drm.modeset=1" /etc/default/grub || sudo grep -q "nvidia_drm.fbdev=1" /etc/default/grub; then
|
if sudo grep -q "nvidia-drm.modeset=1" /etc/default/grub || sudo grep -q "nvidia_drm.fbdev=1" /etc/default/grub; then
|
||||||
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
|
printf "GRUB configuration regenerated\n" 2>&1 | tee -a "$LOG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
printf "Additional steps for GRUB completed\n" 2>&1 | tee -a "$LOG"
|
||||||
echo "/etc/default/grub does not exist"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Additional for systemd-boot users
|
||||||
|
if [ -f /boot/loader/loader.conf ]; then
|
||||||
|
printf "systemd-boot bootloader detected\n" 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
backup_count=$(find /boot/loader/entries/ -type f -name "*.conf.bak" | wc -l)
|
||||||
|
conf_count=$(find /boot/loader/entries/ -type f -name "*.conf" | wc -l)
|
||||||
|
|
||||||
|
if [ "$backup_count" -ne "$conf_count" ]; then
|
||||||
|
find /boot/loader/entries/ -type f -name "*.conf" | while read imgconf; do
|
||||||
|
# Backup conf
|
||||||
|
sudo cp "$imgconf" "$imgconf.bak"
|
||||||
|
printf "Backup created for systemd-boot loader: %s\n" "$imgconf" 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
# Clean up options and update with NVIDIA settings
|
||||||
|
sdopt=$(grep -w "^options" "$imgconf" | sed 's/\b nvidia-drm.modeset=[^ ]*\b//g' | sed 's/\b nvidia_drm.fbdev=[^ ]*\b//g')
|
||||||
|
sudo sed -i "/^options/c${sdopt} nvidia-drm.modeset=1 nvidia_drm.fbdev=1" "$imgconf" 2>&1 | tee -a "$LOG"
|
||||||
|
done
|
||||||
|
|
||||||
|
printf "Additional steps for systemd-boot completed\n" 2>&1 | tee -a "$LOG"
|
||||||
|
else
|
||||||
|
printf "systemd-boot is already configured...\n" 2>&1 | tee -a "$LOG"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Blacklist nouveau
|
# Blacklist nouveau
|
||||||
if [[ -z $blacklist_nouveau ]]; then
|
if [[ -z $blacklist_nouveau ]]; then
|
||||||
read -n1 -rep "${CAT} Would you like to blacklist nouveau? (y/n)" blacklist_nouveau
|
read -n1 -rep "${CAT} Would you like to blacklist nouveau? (y/n)" blacklist_nouveau
|
||||||
|
|||||||
Reference in New Issue
Block a user