arch-maride-flavour/steps/30-formatting.step
2018-03-04 14:00:22 +01:00

31 lines
763 B
Bash
Executable File

#!/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
if [ "$cryptroot" == "yes" ]; then
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
else
echo "~> There are close to no reasons to not do this, but hey, you're an adult."
rootformat=${blockdevice}2
fi
echo "~> Formatting $rootformat EXT4"
mkfs.ext4 $rootformat
echo "~> Mount partitions"
mount $rootformat /mnt
mkdir -p /mnt/boot
mount ${blockdevice}1 /mnt/boot
amf_return=0