From 0998b342e918d8e551aa8337a34964dbd625c1b5 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 22 Aug 2015 22:30:25 +0200 Subject: [PATCH] Add luks support --- archfi | 22 ++++++++++++++++------ lng/French | 5 +++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/archfi b/archfi index 8130323..35a99b0 100644 --- a/archfi +++ b/archfi @@ -546,10 +546,10 @@ formatdevice(){ xfs) mkfs.xfs -f $2;; jfs) mkfs.jfs -f $2;; luks) - echo "Create luks device :" # string + echo "$txtcreateluksdevice" cryptsetup luksFormat $2 echo "" - echo "Open luks device :" # string + echo "$txtopenluksdevice" cryptsetup luksOpen $2 $1 pressanykey formatdevice $1 /dev/mapper/$1 noluks @@ -565,7 +565,7 @@ formatdevice(){ crypttab="\n$1 UUID=$(cryptsetup luksUUID $2) none" fi echo "" - echo "luks device created !" # string + echo "$txtluksdevicecreated" ;; esac echo "" @@ -676,6 +676,7 @@ archmenu(){ options+=("${txtgenerate//%1/mkinitcpio.conf}" "(encrypt hooks)") fi options+=("${txtedit//%1/fstab}" "($txtoptional)") + options+=("${txtedit//%1/cryptotab}" "($txtoptional)") options+=("${txtedit//%1/mkinitcpio.conf}" "($txtoptional)") options+=("${txtedit//%1/mirrorlist}" "($txtoptional)") options+=("${txtinstall//%1/grub}" "pacstrap grub (os-prober), grub-mkconfig") @@ -736,6 +737,10 @@ archmenu(){ nano /mnt/etc/fstab nextitem="${txtedit//%1/fstab}" ;; + "${txtedit//%1/cryptotab}") + nano /mnt/etc/cryptotab + nextitem="${txtedit//%1/cryptotab}" + ;; "${txtedit//%1/mkinitcpio.conf}") archeditmkinitcpio nextitem="${txtedit//%1/mkinitcpio.conf}" @@ -902,11 +907,13 @@ archgenfstab(){ } archgencryptotab(){ + #learn archgenfstab clear echo -e "$crypttab" >> /mnt/etc/crypttab } archgenmkinitcpio(){ + #learn archgenfstab clear sed -i "s/block filesystems/block encrypt filesystems/g" /mnt/etc/mkinitcpio.conf archchroot genmkinitcpio @@ -949,14 +956,12 @@ archinstallgrub(){ fi if [ "$luksroot" = "1" ]; then - if (whiptail --backtitle "$apptitle" --title "${txtinstall//%1/grub}" --yesno "luks root detected ! Add to grub.cfg" 0 0) then # string + if (whiptail --backtitle "$apptitle" --title "${txtinstall//%1/grub}" --yesno "$txtgrubluksdetected" 0 0) then clear sed -i /GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX=\"cryptdevice=/dev/disk/by-uuid/$luksrootuuid:root\" /mnt/etc/default/grub fi fi - - clear archchroot installgrub } @@ -1148,6 +1153,9 @@ loadstrings(){ txtselectpartformat="Select partition format for %1 :" txtformatingpart="Formatting partition %1 as" + txtcreateluksdevice="Create luks device :" + txtopenluksdevice="Open luks device :" + txtluksdevicecreated="luks device created !" txtinstallmenu="Install Menu" @@ -1172,6 +1180,8 @@ loadstrings(){ txtedit="Edit %1" txtinstall="Install %1" txtenable="Enable %1" + + txtgrubluksdetected="Encrypted root partion !\n\nAdd cryptdevice= to GRUB_CMDLINE_LINUX in /etc/default/grub ?" txtpressanykey="Press any key to continue." diff --git a/lng/French b/lng/French index 3bb87e6..9b70a65 100644 --- a/lng/French +++ b/lng/French @@ -40,6 +40,9 @@ txtformatdeviceconfirm="Attention, toutes les données sur les partitions sélec txtselectpartformat="Sélectionnez le format de la parition %1 :" txtformatingpart="Formatting partition %1 as" +txtcreateluksdevice="Creatation de la partition luks :" +txtopenluksdevice="Ouverture de la partition luks :" +txtluksdevicecreated="La partition luks à été crée !" txtinstallmenu="Menu Installation" @@ -65,6 +68,8 @@ txtedit="Editer %1" txtinstall="Installer %1" txtenable="Activer %1" +txtgrubluksdetected="Partition root cryptée !\n\nAjouter cryptdevice= to GRUB_CMDLINE_LINUX dans /etc/default/grub ?" + txtpressanykey="Appuyez sur une touche pour continuer."