fix crypt script (matching and passwd chk)
This commit is contained in:
parent
d78d5fe4b3
commit
1c5c24cd96
1 changed files with 6 additions and 6 deletions
|
@ -10,10 +10,10 @@ PASSWORD_CONFIRM=""
|
|||
|
||||
EVENT "Setting up disk encryption with luks"
|
||||
|
||||
if [[ $DISK == sd* ]]; then
|
||||
if [[ $DISK == "/dev/sd"* ]]; then
|
||||
CRYPT_PARTITION="$DISK""2"
|
||||
EFI_PARTITION="$DISK""1"
|
||||
elif [[ $DISK == nvme** ]]; then
|
||||
elif [[ $DISK == "/dev/nvme"* ]]; then
|
||||
CRYPT_PARTITION="$DISK""p2"
|
||||
EFI_PARTITION="$DISK""p1"
|
||||
else
|
||||
|
@ -24,7 +24,7 @@ fi
|
|||
get_password() {
|
||||
read -s -p "LUKS password: " PASSWORD
|
||||
read -s -p "Confirm password: " PASSWORD_CONFIRM
|
||||
if [ "$PASSWORD" == "$CONFIRM_PASSWORD" ]; then
|
||||
if [ "$PASSWORD" == "$PASSWORD_CONFIRM" ]; then
|
||||
exit 0
|
||||
else
|
||||
ERROR "Passwords do not match"
|
||||
|
@ -39,7 +39,7 @@ EVENT "Setting up luks"
|
|||
cryptsetup luksFormat --type luks1 "$CRYPT_PARTITION" <<EOF
|
||||
YES
|
||||
$PASSWORD
|
||||
$CONFIRM_PASSWORD
|
||||
$PASSWORD_CONFIRM
|
||||
EOF
|
||||
|
||||
EVENT "Opening cryptroot"
|
||||
|
@ -58,5 +58,5 @@ mkfs.vfat "-F32" "$EFI_PARTITION"
|
|||
|
||||
EVENT "Successfully setup efi vfat and luks"
|
||||
|
||||
echo "CRYPT_PARTITION=\"$CRYPT_PARTITION\"" > ./guix-env
|
||||
echo "EFI_PARTITION=\"$EFI_PARTITION\"" > ./guix-env
|
||||
echo "CRYPT_PARTITION=\"$CRYPT_PARTITION\"" >> ./guix-env
|
||||
echo "EFI_PARTITION=\"$EFI_PARTITION\"" >> ./guix-env
|
||||
|
|
Loading…
Reference in a new issue