From e995fb504f39a8771156de404313169775f3b7a4 Mon Sep 17 00:00:00 2001 From: maride Date: Mon, 31 Jul 2017 00:40:29 +0200 Subject: [PATCH] Add formatting/crypto step --- steps/30-formatting.step | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 steps/30-formatting.step diff --git a/steps/30-formatting.step b/steps/30-formatting.step new file mode 100644 index 0000000..652988b --- /dev/null +++ b/steps/30-formatting.step @@ -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