commit 1201e563073c5a0d8566e24f7567399b5e189fa9
parent 988fb58b82702e4067571cb7b66f976dc0a84dad
Author: awy <awy@awy.one>
Date: Thu, 7 Nov 2024 17:14:17 +0300
tidy
Diffstat:
2 files changed, 15 insertions(+), 22 deletions(-)
diff --git a/install.sh b/install.sh
@@ -36,14 +36,12 @@ binKernel(){
mkdir /mnt/boot/efi
mount /dev/"$boot_drive" /mnt/boot/efi
pacman -Sy --confirm
- if [ "$choosenKernel" = 1 ]; then
- basestrap /mnt base dinit seatd-dinit linux linux-headers
- elif [ "$choosenKernel" = 2 ]; then
- basestrap /mnt base dinit seatd-dinit linux-zen linux-zen-headers
- else
- printf "Wrong kernelflag value.\n"
- exit 1
- fi
+ case $choosenKernel in
+ 1) basestrap /mnt base dinit seatd-dinit linux linux-headers
+ ;;
+ 2) basestrap /mnt base dinit seatd-dinit linux-zen linux-zen-headers
+ *) printf ${red}"Invalid kernel${normal}" && exit 1 ;;
+ esac
}
customKernel(){
@@ -80,7 +78,6 @@ getUserData(){
root_drive="$disk_drive${partitions##* }"
boot_drive="$disk_drive${partitions%% *}"
while true; do
- clear
title
printf ${normal}"Your CPU Vendor detected as ${green}$cpuVendorID${normal}, is that right? Y/N:\n"
read -r answer
@@ -101,8 +98,7 @@ getUserData
diskpart
case $choosenKernel in
- 1) binKernel ;;
- 2) binKernel ;;
+ 1 | 2) binKernel ;;
3) customKernel ;;
*) printf ${red}"Invalid kernel${normal}" && exit 1 ;;
esac
diff --git a/post_chroot.sh b/post_chroot.sh
@@ -28,14 +28,11 @@ binKernel(){
GRUB_MODIFIED_LINE='GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet options root=PARTUUID='$PARTUUID_ROOT' rw nvidia-drm.modeset=1 modeset=1 fbdev=1 intel_iommu=on"'
sed -i "s/GRUB_CMDLINE_LINUX_DEF\(.*\)/$GRUB_MODIFIED_LINE/g" /etc/default/grub
sed -i -e 's/MODULES=()/MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)/g' /etc/mkinitcpio.conf
- if [ "$choosenKernel" -eq 1 ]; then
- pacman -S linux-headers --noconfirm
- elif [ "$choosenKernel" -eq 2 ]; then
- pacman -S linux-zen-headers --noconfirm
- else
- printf "Wrong kernelflag value.\n"
- exit 1
- fi
+ case $choosenKernel in
+ 1) pacman -S linux-headers --noconfirm ;;
+ 2) pacman -S linux-zen-headers --noconfirm ;;
+ *) printf ${red}"Invalid kernel${normal}" && exit 1 ;;
+ esac
}
customKernel(){
@@ -94,9 +91,9 @@ echo "root:$rootpass" | chpasswd
echo "$username:$userpass" | chpasswd
cat <<EOL >> /etc/hosts
-127.0.0.1 localhost
-::1 localhost
-127.0.1.1 $hostname.localdomain $hostname
+127.0.0.1 localhost
+::1 localhost
+127.0.1.1 $hostname.localdomain $hostname
EOL
# enable arch repos