Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.8 KiB

4 years ago
4 years ago
  1. #!/bin/bash
  2. ln -sf /usr/share/zoneinfo/Europe/Istanbul /etc/localtime
  3. hwclock --systohc
  4. echo -e "en_US.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8" > /etc/locale.gen
  5. locale-gen
  6. echo "LANG=en_US.UTF-8" > /etc/locale.conf
  7. echo "KEYMAP=trq" > /etc/vconsole.conf
  8. echo "tatooine" > /etc/hostname
  9. git clone https://aur.archlinux.org/yay.git /tmp/yay
  10. (cd /tmp/yay; makepkg -si)
  11. systemctl enable fstrim.timer
  12. echo -e "127.0.0.1 localhost\n::1 localhost\n127.0.0.1 tatooine.localdomain tatooine" > /etc/hosts
  13. cat << EOF > /etc/mkinitcpio.conf
  14. MODULES=(vfat)
  15. BINARIES=()
  16. FILES=()
  17. HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt filesystems fsck)
  18. EOF
  19. cat << EOF > /etc/initcpio/hooks/openswap
  20. run_hook ()
  21. {
  22. x=0;
  23. while [ ! -b /dev/mapper/root ] && [ \$x -le 10 ]; do
  24. x=$((x+1))
  25. sleep .2
  26. done
  27. mkdir crypto_key_device
  28. mount /dev/mapper/root crypto_key_device
  29. cryptsetup open --key-file crypto_key_device/root/.keys/swap-keyfile $(cat /install/device)2 swap
  30. umount crypto_key_device
  31. }
  32. EOF
  33. cat << EOF > /etc/initcpio/install/openswap
  34. build ()
  35. {
  36. add_runscript
  37. }
  38. help ()
  39. {
  40. cat<<HELPEOF
  41. This opens the swap encrypted partition $(cat /install/device)1 in /dev/mapper/swap
  42. HELPEOF
  43. }
  44. EOF
  45. line=1
  46. for i in $(blkid); do
  47. echo "$line: $i"
  48. ((line=line+1))
  49. done
  50. echo "Please select the device you will save the LUKS key to:"
  51. read keydev
  52. uuid=$(blkid | sed -n 's/.*UUID=\"\([^\"]*\)\".*/\1/p' | sed -n "$line"p)
  53. cat << EOF > /boot/refind_linux.conf
  54. "Boot with encryption" "root=/dev/mapper/root resume=/dev/mapper/swap cryptdevice=UUID=$(blkid -s UUID -o value $(cat /install/device)3):root:allow-discards cryptkey=UUID=$uuid:vfat:key.yeet rw loglevel=3 quiet"
  55. EOF
  56. cat /install/nonAUR.txt | xargs pacman -S --needed --noconfirm
  57. yay -S $(cat /install/AUR.txt)
  58. refind-install
  59. mkinitcpio -P