mirror of
https://github.com/kevinveenbirkenbach/linux-image-manager.git
synced 2024-11-22 15:11:04 +01:00
Implemented uuid seeding for boot partition
This commit is contained in:
parent
a1fe7356b4
commit
8d87c49a91
@ -47,6 +47,7 @@ make_working_folder(){
|
|||||||
set_root_variables(){
|
set_root_variables(){
|
||||||
info "Setting root variables..." &&
|
info "Setting root variables..." &&
|
||||||
root_partition_uuid=$(blkid "$root_partition_path" -s UUID -o value) &&
|
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_name="arch-root-$root_partition_uuid" &&
|
||||||
root_mapper_path="/dev/mapper/$root_mapper_name" || error
|
root_mapper_path="/dev/mapper/$root_mapper_name" || error
|
||||||
}
|
}
|
||||||
|
@ -231,11 +231,15 @@ if mount | grep -q "$boot_partition_path"
|
|||||||
fi
|
fi
|
||||||
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..." &&
|
info "Define target paths..." &&
|
||||||
target_home_path="$root_mount_path""home/" &&
|
target_home_path="$root_mount_path""home/" &&
|
||||||
target_username=$(ls "$target_home_path") &&
|
target_username=$(ls "$target_home_path") &&
|
||||||
target_user_home_folder_path="$target_home_path$target_username/" &&
|
target_user_home_folder_path="$target_home_path$target_username/" &&
|
||||||
|
|
||||||
target_user_ssh_folder_path="$target_user_home_folder_path"".ssh/" &&
|
target_user_ssh_folder_path="$target_user_home_folder_path"".ssh/" &&
|
||||||
target_authorized_keys="$target_user_ssh_folder_path""authorized_keys" &&
|
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
|
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..." &&
|
info "Generating mkinitcpio..." &&
|
||||||
echo "mkinitcpio -vP || exit 1" | chroot "$root_mount_path" /bin/bash &&
|
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" &&
|
fstab_insert_line="UUID=$root_partition_uuid / ext4 defaults,noatime 0 1" &&
|
||||||
info "Configuring $fstab_path..." || error
|
info "Configuring $fstab_path..." || error
|
||||||
if grep -q "$fstab_insert_line" "$fstab_path"
|
if grep -q "$fstab_insert_line" "$fstab_path"
|
||||||
|
Loading…
Reference in New Issue
Block a user