arch.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. pacman -Sy --noconfirm dialog || { printf "Error at script start:\n\nAre you sure you're running this as the root user?\n\t(Tip: run 'whoami' to check)\n\nAre you sure you have an internet connection?\n\t(Tip: run 'ip a' to check)\n"; exit; }
  3. clear
  4. lsblk -d | sed 's/0 disk/0 disk\\n/;s/POINT/POINT\\n/'
  5. read -rp "Press any key to continue"
  6. dialog --no-cancel --inputbox "Enter the drive you want do install Arch Linux for the VIDEOPC on." 10 60 2>drive
  7. DRIVE=$(cat drive)
  8. PVALUE=$(echo "${DRIVE}" | grep "^nvme" | sed 's/.*[0-9]/p/')
  9. cat <<EOF | fdisk -W always /dev/"${DRIVE}"
  10. o
  11. n
  12. p
  13. a
  14. w
  15. EOF
  16. partprobe
  17. yes | mkfs.ext4 /dev/"${DRIVE}${PVALUE}"1
  18. mount /dev/"${DRIVE}${PVALUE}"1 /mnt
  19. pacman -Sy --noconfirm archlinux-keyring
  20. pacstrap /mnt base linux linux-firmware networkmanager rsync grub
  21. genfstab -U /mnt >> /mnt/etc/fstab
  22. mv drive /mnt
  23. echo "Europe/Zurich" > /mnt/tzfinal.tmp
  24. echo "videopc" > /mnt/etc/hostname
  25. cp chroot.sh /mnt
  26. arch-chroot /mnt bash chroot.sh
  27. rm /mnt/chroot.sh
  28. cp videopc-bootstrap.sh /mnt
  29. arch-chroot /mnt bash videopc-bootstrap.sh
  30. rm /mnt/videopc-bootstrap.sh