Move crypt question to main script

This commit is contained in:
maride
2018-03-04 14:00:22 +01:00
parent 408f2aa873
commit d872a99180
3 changed files with 12 additions and 7 deletions

View File

@@ -6,11 +6,7 @@ mkfs.fat -F32 ${blockdevice}1
echo -n "~> Do you want to encrypt root? (Y/n) "
read answer
if [ "$answer" == "n" ] || [ "$answer" == "N" ]; then
echo "~> There are close to no reasons to not do this, but hey, you're an adult."
rootformat=${blockdevice}2
didCrypt=0
else
if [ "$cryptroot" == "yes" ]; then
echo "~> Formatting root (/) for crypto"
cryptsetup -v luksFormat ${blockdevice}2
echo "~> Here's the header crypto:"
@@ -18,7 +14,9 @@ else
echo "~> Open the crypt container"
cryptsetup luksOpen ${blockdevice}2 cryptroot
rootformat=/dev/mapper/cryptroot
didCrypt=1
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"

View File

@@ -26,7 +26,7 @@ else
arch-chroot /mnt grub-install --target=i386-pc /dev/*da
fi
if [ "$didCrypt" -eq 1 ]; then
if [ "$cryptroot" -eq 1 ]; then
echo "GRUB_CMDLINE_LINUX='cryptdevice=UUID=`blkid -o value ${blockdevice}2 | head -n 1`:cryptroot'" > /mnt/etc/default/grub
fi