diff --git a/arch-setup/arch-setup.sh b/arch-setup/arch-setup.sh index 83edde63..55aad1f1 100755 --- a/arch-setup/arch-setup.sh +++ b/arch-setup/arch-setup.sh @@ -22,12 +22,13 @@ mkfs.fat -F32 "$device"1 # Create the swap partition echo "[INFO]: Enter password for swap encryption" -cryptsetup luksFormat "$device"2 +read swap_pass + +echo $swap_pass | cryptsetup -q luksFormat "$device"2 mkdir /root/.keys -sudo dd if=/dev/urandom of=/root/.keys/swap-keyfile bs=1024 count=4 -sudo chmod 600 /root/.keys/swap-keyfile -echo "[INFO]: Re-Enter password for swap encryption" -sudo cryptsetup luksAddKey "$device"2 /root/.keys/swap-keyfile +dd if=/dev/urandom of=/root/.keys/swap-keyfile bs=1024 count=4 +chmod 600 /root/.keys/swap-keyfile +echo $swap_pass | cryptsetup luksAddKey "$device"2 /root/.keys/swap-keyfile echo "[INFO]: Keyfile saved to /root/.keys/swap-keyfile" cryptsetup open --key-file="/root/.keys/swap-keyfile" "$device"2 swap mkswap /dev/mapper/swap @@ -35,11 +36,13 @@ swapon /dev/mapper/swap # Create the root partition echo "[INFO]: Enter password for root encryption" -cryptsetup luksFormat "$device"3 +read root_pass + +echo $root_pass | cryptsetup -q luksFormat "$device"3 dd bs=512 count=4 if=/dev/random of=/root/.keys/root-keyfile iflag=fullblock -sudo chmod 600 /root/.keys/root-keyfile +chmod 600 /root/.keys/root-keyfile echo "[INFO]: Re-Enter password for root encryption" -sudo cryptsetup luksAddKey "$device"3 /root/.keys/root-keyfile +echo $root_pass | cryptsetup luksAddKey "$device"3 /root/.keys/root-keyfile echo "[INFO]: Keyfile saved to /root/.keys/root-keyfile" cryptsetup open --key-file="/root/.keys/root-keyfile" "$device"3 root mkfs.ext4 /dev/mapper/root @@ -52,7 +55,11 @@ pacstrap /mnt/sys base linux linux-firmware base-devel git vim genfstab -U /mnt/sys >> /mnt/sys/etc/fstab # Run on chrooted arch install -cp -r ./chroot /mnt/sys/install +mkdir /mnt/sys/install cp -r /root/.keys /mnt/sys/root +curl https://raw.githubusercontent.com/theFr1nge/dotfiles/main/arch-setup/AUR.txt > /mnt/sys/install/AUR.txt +curl https://raw.githubusercontent.com/theFr1nge/dotfiles/main/arch-setup/nonAUR.txt > /mnt/sys/install/nonAUR.txt +curl https://raw.githubusercontent.com/theFr1nge/dotfiles/main/arch-setup/chroot.sh > /mnt/sys/install/chroot.sh +chmod +x /mnt/sys/chroot.sh echo -n "$device" > /mnt/sys/install/device -arch-chroot /mnt/sys /install/install.sh +arch-chroot /mnt/sys /install/chroot.sh diff --git a/arch-setup/chroot.sh b/arch-setup/chroot.sh index 4cf4d153..ee0dd40f 100755 --- a/arch-setup/chroot.sh +++ b/arch-setup/chroot.sh @@ -5,6 +5,9 @@ hwclock --systohc echo -e "en_US.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8" > /etc/locale.gen locale-gen echo "LANG=en_US.UTF-8" > /etc/locale.conf +curl https://blackarch.org/strap.sh > /tmp/strap.sh +chmod +x /tmp/strap.sh +/tmp/strap.sh echo "tatooine" > /etc/hostname systemctl enable fstrim.timer @@ -81,3 +84,8 @@ git clone --recurse-submodules https://github.com/theFr1nge/dotfiles.git ~/.dotf (cd ~/.dotfiles; ./install.sh) +exit + +vim /etc/fstab + +echo "SETUP COMPLETE"