Add formatting/crypto step
This commit is contained in:
parent
92a1b8a8d7
commit
e995fb504f
23
steps/30-formatting.step
Normal file
23
steps/30-formatting.step
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/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 [ "$answer" == "n" ]; then
|
||||||
|
echo "~> There are close to no reasons to not do this, but hey, you're an adult."
|
||||||
|
rootformat=${blockdevice}2
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "~> Formatting $rootformat EXT4"
|
||||||
|
mkfs.ext4 $rootformat
|
Loading…
Reference in New Issue
Block a user