From 8d87c49a916ea4345b4c94d2bedc1982a7838d6f Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Sun, 4 Oct 2020 12:41:37 +0200 Subject: [PATCH] Implemented uuid seeding for boot partition --- scripts/image/base.sh | 1 + scripts/image/setup.sh | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/image/base.sh b/scripts/image/base.sh index 1257892..84b3fd4 100644 --- a/scripts/image/base.sh +++ b/scripts/image/base.sh @@ -47,6 +47,7 @@ make_working_folder(){ set_root_variables(){ info "Setting root variables..." && root_partition_uuid=$(blkid "$root_partition_path" -s UUID -o value) && + boot_partition_uuid=$(blkid "$boot_partition_uuid" -s UUID -o value) && root_mapper_name="arch-root-$root_partition_uuid" && root_mapper_path="/dev/mapper/$root_mapper_name" || error } diff --git a/scripts/image/setup.sh b/scripts/image/setup.sh index 7691344..d053723 100644 --- a/scripts/image/setup.sh +++ b/scripts/image/setup.sh @@ -231,11 +231,15 @@ if mount | grep -q "$boot_partition_path" fi fi +fstab_path="$root_mount_path""etc/fstab" && +info "Seeding UUID to $fstab_path to avoid path conflicts..." && +sed -i "s/mmcblk0p1/UUID=$boot_partition_uuid/g" "$fstab_path" && +info "Content of $fstab_path:$(cat "$fstab_path")" || error + info "Define target paths..." && target_home_path="$root_mount_path""home/" && target_username=$(ls "$target_home_path") && target_user_home_folder_path="$target_home_path$target_username/" && - target_user_ssh_folder_path="$target_user_home_folder_path"".ssh/" && target_authorized_keys="$target_user_ssh_folder_path""authorized_keys" && question "Should the ssh-key be copied to the image?(y/N)" && read -r copy_ssh_key || error @@ -364,7 +368,6 @@ if [ "$encrypt_system" == "y" ] info "Generating mkinitcpio..." && echo "mkinitcpio -vP || exit 1" | chroot "$root_mount_path" /bin/bash && - fstab_path="$root_mount_path""etc/fstab" && fstab_insert_line="UUID=$root_partition_uuid / ext4 defaults,noatime 0 1" && info "Configuring $fstab_path..." || error if grep -q "$fstab_insert_line" "$fstab_path"