From 871646bc64176292136d96172c96c4249f32df96 Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Fri, 15 May 2020 13:37:14 +0200 Subject: [PATCH] Refactored to set_partition_paths function --- scripts/image/base.sh | 6 ++++++ scripts/image/chroot.sh | 3 +-- scripts/image/setup.sh | 3 +-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/image/base.sh b/scripts/image/base.sh index f579da9..32561f7 100644 --- a/scripts/image/base.sh +++ b/scripts/image/base.sh @@ -18,6 +18,12 @@ echo_partition_name(){ fi } +set_partition_paths(){ + info "Setting partition paths..." + root_partition_path=$(echo_partition_name "2") + boot_partition_path=$(echo_partition_name "1") +} + # Routine to echo the full sd-card-path set_device_path(){ info "Available devices:" diff --git a/scripts/image/chroot.sh b/scripts/image/chroot.sh index 9f3a149..9d9202f 100644 --- a/scripts/image/chroot.sh +++ b/scripts/image/chroot.sh @@ -14,8 +14,7 @@ error root_mount_path="/mnt/raspbian" boot_mount_path="/mnt/raspbian/boot" -root_partition_path=$(echo_partition_name "2") -boot_partition_path=$(echo_partition_name "1") +set_partition_paths info "Mount partitions..." mount -o rw "$boot_partition_path" "$boot_mount_path" || diff --git a/scripts/image/setup.sh b/scripts/image/setup.sh index ab4af0c..d4da1d4 100644 --- a/scripts/image/setup.sh +++ b/scripts/image/setup.sh @@ -157,8 +157,7 @@ root_mount_path="$working_folder""root/" mkdir -v "$boot_mount_path" mkdir -v "$root_mount_path" -boot_partition_path=$(echo_partition_name "1") -root_partition_path=$(echo_partition_name "2") +set_partition_paths mount_partitions(){ info "Mount boot and root partition..."