final tweak before merging to main... I think I am happy now with this
This commit is contained in:
@@ -53,14 +53,16 @@ else
|
||||
echo "Nvidia modules added in /etc/mkinitcpio.conf"
|
||||
fi
|
||||
|
||||
printf "\n%.0s" {1..2}
|
||||
printf "${INFO} Rebuilding ${YELLOW}Initramfs${RESET}...\n" 2>&1 | tee -a "$LOG"
|
||||
sudo mkinitcpio -P 2>&1 | tee -a "$LOG"
|
||||
|
||||
printf "\n%.0s" {1..3}
|
||||
printf "\n%.0s" {1..2}
|
||||
|
||||
# Additional Nvidia steps
|
||||
NVEA="/etc/modprobe.d/nvidia.conf"
|
||||
if [ -f "$NVEA" ]; then
|
||||
printf "${OK} Seems like ${YELLOW}nvidia-drm modeset=1${RESET} is already added in your system..moving on."
|
||||
printf "${OK} Seems like ${YELLOW}nvidia_drm modeset=1 fbdev=1${RESET} is already added in your system..moving on."
|
||||
printf "\n"
|
||||
else
|
||||
printf "\n"
|
||||
@@ -71,7 +73,7 @@ fi
|
||||
|
||||
# Additional for GRUB users
|
||||
if [ -f /etc/default/grub ]; then
|
||||
printf "${INFO} GRUB bootloader detected\n" 2>&1 | tee -a "$LOG"
|
||||
printf "${INFO} ${YELLOW}GRUB${RESET} bootloader detected\n" 2>&1 | tee -a "$LOG"
|
||||
|
||||
# Check if nvidia-drm.modeset=1 is present
|
||||
if ! sudo grep -q "nvidia-drm.modeset=1" /etc/default/grub; then
|
||||
@@ -88,15 +90,15 @@ if [ -f /etc/default/grub ]; then
|
||||
# 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
|
||||
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
||||
printf "GRUB configuration regenerated\n" 2>&1 | tee -a "$LOG"
|
||||
printf "${YELLOW}GRUB${RESET} configuration regenerated\n" 2>&1 | tee -a "$LOG"
|
||||
fi
|
||||
|
||||
printf "${OK} Additional steps for GRUB completed\n" 2>&1 | tee -a "$LOG"
|
||||
printf "${OK} Additional steps for ${YELLOW}GRUB${RESET} completed\n" 2>&1 | tee -a "$LOG"
|
||||
fi
|
||||
|
||||
# Additional for systemd-boot users
|
||||
if [ -f /boot/loader/loader.conf ]; then
|
||||
printf "${INFO} systemd-boot bootloader detected\n" 2>&1 | tee -a "$LOG"
|
||||
printf "${INFO} ${YELLOW}systemd-boot${RESET} 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)
|
||||
@@ -112,9 +114,9 @@ if [ -f /boot/loader/loader.conf ]; then
|
||||
sudo sed -i "/^options/c${sdopt} nvidia-drm.modeset=1 nvidia_drm.fbdev=1" "$imgconf" 2>&1 | tee -a "$LOG"
|
||||
done
|
||||
|
||||
printf "${OK} Additional steps for systemd-boot completed\n" 2>&1 | tee -a "$LOG"
|
||||
printf "${OK} Additional steps for ${YELLOW}systemd-boot${RESET} completed\n" 2>&1 | tee -a "$LOG"
|
||||
else
|
||||
printf "${NOTE} systemd-boot is already configured...\n" 2>&1 | tee -a "$LOG"
|
||||
printf "${NOTE} ${YELLOW}systemd-boot${RESET} is already configured...\n" 2>&1 | tee -a "$LOG"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -128,7 +130,7 @@ echo
|
||||
if [[ $blacklist_nouveau =~ ^[Yy]$ ]]; then
|
||||
NOUVEAU="/etc/modprobe.d/nouveau.conf"
|
||||
if [ -f "$NOUVEAU" ]; then
|
||||
printf "${OK} Seems like nouveau is already blacklisted..moving on.\n"
|
||||
printf "${OK} Seems like ${YELLOW}nouveau${RESET} is already blacklisted..moving on.\n"
|
||||
else
|
||||
echo "blacklist nouveau" | sudo tee -a "$NOUVEAU" 2>&1 | tee -a "$LOG"
|
||||
printf "${NOTE} has been added to $NOUVEAU.\n"
|
||||
|
||||
Reference in New Issue
Block a user