| 1 | # == MY ARCH SETUP INSTALLER == # |
| 2 | #part1 |
| 3 | printf '\033c' |
| 4 | sed -i "s/^#ParallelDownloads = 5$/ParallelDownloads = 15/" /etc/pacman.conf |
| 5 | pacman --noconfirm -Sy archlinux-keyring |
| 6 | loadkeys us |
| 7 | timedatectl set-ntp true |
| 8 | lsblk |
| 9 | printf "\e[0;34mEnter the drive: \e[0m" |
| 10 | read drive |
| 11 | cfdisk $drive |
| 12 | printf "\e[0;34mEnter the EFI partition: \e[0m" |
| 13 | read efipartition |
| 14 | mkfs.fat -F32 $efipartition |
| 15 | read -p "Did you also create swap partition? [y/n]" answer |
| 16 | if [[ $answer = y ]] ; then |
| 17 | printf "\e[0;34mEnter swap partition: \e[0m" |
| 18 | read swappartition |
| 19 | mkswap $swappartition |
| 20 | swapon $swappartition |
| 21 | fi |
| 22 | printf "\e[0;34mEnter the linux filesystem partition: \e[0m" |
| 23 | read partition |
| 24 | mkfs.ext4 $partition |
| 25 | echo "mounting $partition to /mnt" |
| 26 | mount $partition /mnt |
| 27 | pacstrap /mnt base base-devel linux linux-firmware |
| 28 | genfstab -U /mnt >> /mnt/etc/fstab |
| 29 | sed '1,/^#part2/d' arch_install.sh > /mnt/arch_install2.sh |
| 30 | chmod +x /mnt/arch_install2.sh |
| 31 | arch-chroot /mnt ./arch_install2.sh |
| 32 | exit |
| 33 | |
| 34 | #part2 |
| 35 | printf '\033c' |
| 36 | ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime |
| 37 | hwclock --systohc |
| 38 | echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen |
| 39 | locale-gen |
| 40 | echo "LANG=en_US.UTF-8" > /etc/locale.conf |
| 41 | echo "KEYMAP=us" > /etc/vconsole.conf |
| 42 | printf "\e[0;34mHostname: \e[0m" |
| 43 | read hostname |
| 44 | echo $hostname > /etc/hostname |
| 45 | echo "127.0.0.1 localhost" >> /etc/hosts |
| 46 | echo "::1 localhost" >> /etc/hosts |
| 47 | echo "127.0.1.1 $hostname.localdomain $hostname" >> /etc/hosts |
| 48 | mkinitcpio -P |
| 49 | passwd |
| 50 | pacman --noconfirm -S grub efibootmgr os-prober |
| 51 | printf "\e[0;34mEnter EFI partition: \e[0m" |
| 52 | read efipartition |
| 53 | mkdir /boot/efi |
| 54 | mount $efipartition /boot/efi |
| 55 | grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=archlinux --recheck |
| 56 | read -rp "Do you want to set GRUB_TIMEOUT=0? (y/N): " confirm |
| 57 | if [[ "$confirm" =~ ^[Yy]$ ]]; then |
| 58 | sed -i 's/quiet/pci=noaer/g' /etc/default/grub |
| 59 | sed -i 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=0/g' /etc/default/grub |
| 60 | fi |
| 61 | grub-mkconfig -o /boot/grub/grub.cfg |
| 62 | |
| 63 | pacman -S --noconfirm networkmanager git |
| 64 | |
| 65 | systemctl enable NetworkManager.service |
| 66 | echo "%wheel ALL=(ALL:ALL) ALL" >> /etc/sudoers |
| 67 | printf "\e[0;34mEnter Username: \e[0m" |
| 68 | read username |
| 69 | useradd -m -G wheel $username |
| 70 | passwd $username |
| 71 | echo "Installation Finish Reboot now" |