Add luks support
This commit is contained in:
parent
cae60cf459
commit
efaef97f66
1 changed files with 7 additions and 4 deletions
11
archfi
11
archfi
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue