|
@ -22,12 +22,13 @@ mkfs.fat -F32 "$device"1 |
|
|
|
|
|
|
|
|
# Create the swap partition |
|
|
# Create the swap partition |
|
|
echo "[INFO]: Enter password for swap encryption" |
|
|
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 |
|
|
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" |
|
|
echo "[INFO]: Keyfile saved to /root/.keys/swap-keyfile" |
|
|
cryptsetup open --key-file="/root/.keys/swap-keyfile" "$device"2 swap |
|
|
cryptsetup open --key-file="/root/.keys/swap-keyfile" "$device"2 swap |
|
|
mkswap /dev/mapper/swap |
|
|
mkswap /dev/mapper/swap |
|
@ -35,11 +36,13 @@ swapon /dev/mapper/swap |
|
|
|
|
|
|
|
|
# Create the root partition |
|
|
# Create the root partition |
|
|
echo "[INFO]: Enter password for root encryption" |
|
|
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 |
|
|
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" |
|
|
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" |
|
|
echo "[INFO]: Keyfile saved to /root/.keys/root-keyfile" |
|
|
cryptsetup open --key-file="/root/.keys/root-keyfile" "$device"3 root |
|
|
cryptsetup open --key-file="/root/.keys/root-keyfile" "$device"3 root |
|
|
mkfs.ext4 /dev/mapper/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 |
|
|
genfstab -U /mnt/sys >> /mnt/sys/etc/fstab |
|
|
|
|
|
|
|
|
# Run on chrooted arch install |
|
|
# Run on chrooted arch install |
|
|
cp -r ./chroot /mnt/sys/install |
|
|
|
|
|
|
|
|
mkdir /mnt/sys/install |
|
|
cp -r /root/.keys /mnt/sys/root |
|
|
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 |
|
|
echo -n "$device" > /mnt/sys/install/device |
|
|
arch-chroot /mnt/sys /install/install.sh |
|
|
|
|
|
|
|
|
arch-chroot /mnt/sys /install/chroot.sh |