From 131d677bb8d23622be4216884158946eaef9694b Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Thu, 1 Oct 2020 20:55:28 +0200 Subject: [PATCH] Renamed variable --- scripts/image/base.sh | 4 ++-- scripts/image/setup.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/image/base.sh b/scripts/image/base.sh index 168618e..fd5464a 100644 --- a/scripts/image/base.sh +++ b/scripts/image/base.sh @@ -47,8 +47,8 @@ make_working_folder(){ mount_partitions(){ if [ "$(blkid "$root_partition_path" -s TYPE -o value)" == "crypto_LUKS" ] then - encrypted_partition_uuid=$(blkid "$root_partition_path" -s UUID -o value) && - root_mapper_name="arch-root-$encrypted_partition_uuid" && + root_partition_uuid=$(blkid "$root_partition_path" -s UUID -o value) && + root_mapper_name="arch-root-$root_partition_uuid" && root_mapper_path="/dev/mapper/$root_mapper_name" && info "Decrypting of $root_partition_path is neccessary..." && sudo cryptsetup -v luksOpen "$root_partition_path" "$root_mapper_name" || diff --git a/scripts/image/setup.sh b/scripts/image/setup.sh index 13de2e4..bed03a9 100644 --- a/scripts/image/setup.sh +++ b/scripts/image/setup.sh @@ -416,7 +416,7 @@ if [ "$encrypt_system" == "y" ] boot_txt_rescue_path="$boot_txt_path$rescue_suffix" && boot_txt_delete_line=$(echo "part uuid \${devtype} \${devnum}:2 uuid" | sed -e 's/[]\/$*.^[]/\\&/g') && boot_txt_setenv_origin=$(echo "setenv bootargs console=ttyS1,115200 console=tty0 root=PARTUUID=\${uuid} rw rootwait smsc95xx.macaddr=\"\${usbethaddr}\"" | sed -e 's/[]\/$*.^[]/\\&/g') && - boot_txt_setenv_replace=$(echo "setenv bootargs console=ttyS1,115200 console=tty0 ip=::::$target_hostname:eth0:dhcp cryptdevice=UUID=$encrypted_partition_uuid:root root=$root_mapper_path rw rootwait smsc95xx.macaddr=\"\${usbethaddr}\""| sed -e 's/[\/&]/\\&/g') || error + boot_txt_setenv_replace=$(echo "setenv bootargs console=ttyS1,115200 console=tty0 ip=::::$target_hostname:eth0:dhcp cryptdevice=UUID=$root_partition_uuid:root root=$root_mapper_path rw rootwait smsc95xx.macaddr=\"\${usbethaddr}\""| sed -e 's/[\/&]/\\&/g') || error info "Setup encryption..." && ( echo "pacman --noconfirm -S --needed $(get_packages "server/luks") &&" @@ -429,10 +429,10 @@ if [ "$encrypt_system" == "y" ] #Concerning mkinitcpio warning @see https://gist.github.com/imrvelj/c65cd5ca7f5505a65e59204f5a3f7a6d echo "mkinitcpio -P &&" echo "cp -v $fstab_path $fstab_rescue_path &&" - echo "echo 'UUID=$encrypted_partition_uuid / ext4 defaults,noatime 0 1' >> $fstab_path &&" + echo "echo 'UUID=$root_partition_uuid / ext4 defaults,noatime 0 1' >> $fstab_path &&" echo "echo \"Content of $fstab_path:\$(cat \"$fstab_path\")\" &&" echo "cp -v $crypttab_path $crypttab_rescue_path &&" - echo "echo 'root UUID=$encrypted_partition_uuid none luks' >> $crypttab_path &&" + echo "echo 'root UUID=$root_partition_uuid 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 &&"