summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlake Romero <blake@developercraft.com>2026-04-01 03:56:35 +0100
committerBlake Romero <blake@developercraft.com>2026-04-01 03:56:35 +0100
commit6a1450bcaad5444a44eb07d78ff20bb59d32fa89 (patch)
tree7143e4f9b283a835412daf3926962fd63afd1fb1
parentc9f9b1ddee58e81ca593f5013b2359b733057b1c (diff)
Add seperate password for encryption
-rwxr-xr-xinstall.sh23
1 files changed, 18 insertions, 5 deletions
diff --git a/install.sh b/install.sh
index 1465412..31aa31f 100755
--- a/install.sh
+++ b/install.sh
@@ -102,14 +102,27 @@ printf ',%s,U,*\n,+,L\n' "${boot_size}" | sfdisk -qf -X gpt ${drive}
# Encryption setup
if [[ $encrypt == true ]]; then
+
+ # Read crypt password
+ echo "Enter a password for encryption"
+ while true; do
+ read -sr -p "Password (crypt): " cryptpassword
+ printf "\n"
+ read -sr -p "Confirm encryption password: " cryptpassword2
+ printf "\n"
+ [[ "${cryptpassword}" == "${cryptpassword2}" ]] && break
+ echo "Incorrect password!";
+ read -rp "Press ENTER to try again...";
+ done
+
# Create encrypted drive
- echo "${password}" | cryptsetup --hash sha512 \
- --pbkdf pbkdf2 \
- --label LUKS \
- luksFormat "${root}"
+ echo "${cryptpassword}" | cryptsetup --hash sha512 \
+ --pbkdf pbkdf2 \
+ --label LUKS \
+ luksFormat "${root}"
# Open encrypted drive
- echo "${password}" | cryptsetup luksOpen ${root} cryptroot
+ echo "${cryptpassword}" | cryptsetup luksOpen ${root} cryptroot
# Change root to mapper
root="/dev/mapper/cryptroot"