2017-07-30 22:40:29 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
echo "~> Formatting EFI (/boot) directory to FAT-32"
|
|
|
|
mkfs.fat -F32 ${blockdevice}1
|
|
|
|
|
|
|
|
echo -n "~> Do you want to encrypt root? (Y/n) "
|
|
|
|
read answer
|
|
|
|
|
2017-08-07 16:02:57 +00:00
|
|
|
if [ "$answer" == "n" ] || [ "$answer" == "N" ]; then
|
2017-07-30 22:40:29 +00:00
|
|
|
echo "~> There are close to no reasons to not do this, but hey, you're an adult."
|
|
|
|
rootformat=${blockdevice}2
|
2017-09-13 13:24:52 +00:00
|
|
|
didCrypt=0
|
2017-07-30 22:40:29 +00:00
|
|
|
else
|
|
|
|
echo "~> Formatting root (/) for crypto"
|
|
|
|
cryptsetup -v luksFormat ${blockdevice}2
|
|
|
|
echo "~> Here's the header crypto:"
|
|
|
|
cryptsetup luksDump ${blockdevice}2
|
|
|
|
echo "~> Open the crypt container"
|
|
|
|
cryptsetup luksOpen ${blockdevice}2 cryptroot
|
|
|
|
rootformat=/dev/mapper/cryptroot
|
2017-09-13 13:24:52 +00:00
|
|
|
didCrypt=1
|
2017-07-30 22:40:29 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "~> Formatting $rootformat EXT4"
|
|
|
|
mkfs.ext4 $rootformat
|
2017-07-30 22:51:32 +00:00
|
|
|
|
|
|
|
echo "~> Mount partitions"
|
|
|
|
mount $rootformat /mnt
|
2017-07-30 23:16:53 +00:00
|
|
|
mkdir -p /mnt/boot
|
2017-07-30 22:51:32 +00:00
|
|
|
mount ${blockdevice}1 /mnt/boot
|
2017-09-02 13:07:59 +00:00
|
|
|
|
|
|
|
amf_return=0
|