cryptchroot.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # This a lazy and DANGEROUS way to install Arch.
  3. # I do not recommend this to other people, ONLY
  4. # do this if you exactly understand EVERY SINGLE
  5. # LINE of this bash script. You'll thank me later.
  6. TZuser=$(cat tzfinal.tmp)
  7. DRIVE=$(cat drive)
  8. passwd
  9. ln -sf /usr/share/zoneinfo/$TZuser /etc/localtime
  10. hwclock --systohc
  11. echo "LANG=en_GB.UTF-8" >> /etc/locale.conf
  12. echo "en_GB.UTF-8 UTF-8" >> /etc/locale.gen
  13. locale-gen
  14. pacman --noconfirm --needed -S networkmanager
  15. systemctl enable NetworkManager
  16. pacman --noconfirm --needed -S grub &&
  17. grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB &&
  18. grub-mkconfig -o /boot/grub/grub.cfg
  19. sed -i 's/^MODULES=()/MODULES=(btrfs)/' /etc/mkinitcpio.conf
  20. sed -i 's/^HOOKS=(base udev autodetect modconf block/HOOKS=(base udev autodetect modconf block encrypt/' /etc/mkinitcpio.conf
  21. mkinitcpio -p linux
  22. UUID="$(blkid | grep "${DRIVE}3" | awk '{print $2}' | tr -d '"')"
  23. echo "UUID: $UUID"
  24. sed -i "s/quiet/cryptdevice=${UUID}:cryptroot root=\/dev\/mapper\/cryptroot/" /etc/default/grub
  25. grub-mkconfig -o /boot/grub/grub.cfg