Add luks support

This commit is contained in:
MatMoul 2015-08-22 21:55:01 +02:00
parent cae60cf459
commit efaef97f66

11
archfi
View file

@ -553,13 +553,16 @@ formatdevice(){
cryptsetup luksOpen $2 $1 cryptsetup luksOpen $2 $1
pressanykey pressanykey
formatdevice $1 /dev/mapper/$1 noluks formatdevice $1 /dev/mapper/$1 noluks
rootdev=/dev/mapper/$1
if [ "$1" = "root" ]; then if [ "$1" = "root" ]; then
rootdev=/dev/mapper/$1
luksroot=1 luksroot=1
luksrootuuid=$(cryptsetup luksUUID $2) luksrootuuid=$(cryptsetup luksUUID $2)
else else
case $1 in
home) homedev=/dev/mapper/$1 ;;
esac
luksdrive=1 luksdrive=1
crypttab="$1 UUID=$(cryptsetup luksUUID $2) none" crypttab="\n$1 UUID=$(cryptsetup luksUUID $2) none"
fi fi
echo "" echo ""
echo "luks device created !" # string echo "luks device created !" # string
@ -900,7 +903,7 @@ archgenfstab(){
archgencryptotab(){ archgencryptotab(){
clear clear
echo "$crypttab" > /mnt/etc/crypttab echo -e "$crypttab" >> /mnt/etc/crypttab
} }
archgenmkinitcpio(){ archgenmkinitcpio(){
@ -946,7 +949,7 @@ archinstallgrub(){
fi fi
if [ "$luksroot" = "1" ]; then if [ "$luksroot" = "1" ]; then
if (whiptail --backtitle "$apptitle" --title "${txtinstall//%1/grub}" --yesno "luks root detected ! Add to grub.cfg" 0 0) then if (whiptail --backtitle "$apptitle" --title "${txtinstall//%1/grub}" --yesno "luks root detected ! Add to grub.cfg" 0 0) then # string
clear clear
sed -i /GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX=\"cryptdevice=/dev/disk/by-uuid/$luksrootuuid:root\" /mnt/etc/default/grub sed -i /GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX=\"cryptdevice=/dev/disk/by-uuid/$luksrootuuid:root\" /mnt/etc/default/grub
fi fi