Fix non-crypto install

This commit is contained in:
maride 2017-09-13 15:24:52 +02:00
parent 257067a67f
commit 5635e9efac
2 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,7 @@ read answer
if [ "$answer" == "n" ] || [ "$answer" == "N" ]; then if [ "$answer" == "n" ] || [ "$answer" == "N" ]; then
echo "~> There are close to no reasons to not do this, but hey, you're an adult." echo "~> There are close to no reasons to not do this, but hey, you're an adult."
rootformat=${blockdevice}2 rootformat=${blockdevice}2
didCrypt=0
else else
echo "~> Formatting root (/) for crypto" echo "~> Formatting root (/) for crypto"
cryptsetup -v luksFormat ${blockdevice}2 cryptsetup -v luksFormat ${blockdevice}2
@ -17,6 +18,7 @@ else
echo "~> Open the crypt container" echo "~> Open the crypt container"
cryptsetup luksOpen ${blockdevice}2 cryptroot cryptsetup luksOpen ${blockdevice}2 cryptroot
rootformat=/dev/mapper/cryptroot rootformat=/dev/mapper/cryptroot
didCrypt=1
fi fi
echo "~> Formatting $rootformat EXT4" echo "~> Formatting $rootformat EXT4"

View File

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