Advertisement
Techmo

arch-install-s1

Mar 27th, 2022
1,247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.25 KB | None | 0 0
  1. #!/bin/bash
  2. LANG="en"
  3. REGION="US"
  4. S2_SCRIPT_URL=""
  5.  
  6. read -p "\nEnter the disk to use for the installation (eg. /dev/sda):" INSTALL_DISK
  7. printf "fdisk will now be launched. On a disk with a GPT partition table, do the following:\n - Create a 512MB partition of the type EFI BOOT (code '1')\n - Create a partition for the linux filesystem."
  8. read -p "\nPress enter to continue: " NOOP
  9. fdisk $INSTALL_DISK
  10. read -p "\nEnter the path to the new EFI partition (eg. /dev/sda1): " EFI_PART
  11. read -p "\nEnter the path to the new LINUX partition (eg. /dev/sda2): " SYS_PART
  12.  
  13. echo "Formatting partitions"
  14. set -x
  15. mkfs.fat -F32 $EFI_PART
  16. mkfs.xfs $SYS_PART
  17. set +x
  18.  
  19. echo "Finding fastest pacman mirrors"
  20. set -x
  21. pacman -Syy
  22. pacman -S --noconfirm reflector rsync wget
  23. cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
  24. reflector -c "$REGION" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist
  25. set +x
  26.  
  27. echo "Installing base system"
  28. set -x
  29. mount $SYS_PART /mnt
  30. pacstrap /mnt base linux linux-firmware nano vim
  31. genfstab -U /mnt >> /mnt/etc/fstab
  32. mkdir /mnt/boot/efi
  33. mount $EFI_PART /mnt/boot/efi
  34. set +x
  35.  
  36. echo "Downloading stage 2 install script"
  37. set -x
  38. wget $S2_SCRIPT_URL -O /mnt/arch-install-s2.sh
  39. set +x
  40.  
  41. echo "Chroot to new base system"
  42. arch-chroot /mnt
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement