Implemented close decrypted

This commit is contained in:
Kevin Veen-Birkenbach 2020-09-29 16:23:21 +02:00
parent 05a7499b9d
commit c26187ba30

View File

@ -461,13 +461,15 @@ if [ "$encrypt_system" == "y" ]
echo "cp -v $crypttab_path $crypttab_rescue_path &&"
echo "echo 'root '$encrypted_partition_path' none luks' >> $crypttab_path &&"
echo "echo \"Content of $crypttab_path:\$(cat \"$crypttab_path\")\" &&"
#boot.txt just works with raspberry pi 3 @todo Needs to be implemented for arch raspbery pi 4
echo "cp -v $boot_txt_path $boot_txt_rescue_path &&"
echo "sed -i 's/$boot_txt_delete_line//g' $boot_txt_path &&" #@todo doesn't work yet
echo "sed -i 's/$boot_txt_setenv_origin/$boot_txt_setenv_replace/g' $boot_txt_path &&" #@todo doesn't work yet
echo "sed -i 's/$boot_txt_delete_line//g' $boot_txt_path &&"
echo "sed -i 's/$boot_txt_setenv_origin/$boot_txt_setenv_replace/g' $boot_txt_path &&"
echo "echo \"Content of $boot_txt_path:\$(cat \"$boot_txt_path\")\" &&"
echo "cd /boot/ && ./mkscr &&"
echo "umount $root_mapper_path &&"
echo "exit || echo 'Error in chroot environment!' && exit 1"
echo "sudo cryptsetup -v luksClose root &&"
echo "exit || echo 'Error in chroot environment!' echo 'Trying to close decrypted root.'; sudo cryptsetup -v luksClose root"
) | chroot "$root_mount_path" /bin/bash || error
fi