[07/17] meta-isar: deploy-image: Make TARGET_DEVICE a complete path

Message ID 5325fbed9d19e6680cc4ce49eb1608c29730065c.1719927511.git.jan.kiszka@siemens.com
State Accepted, archived
Headers show
Series Reworks, fixes and unattended mode for image installer | expand

Commit Message

Jan Kiszka July 2, 2024, 1:38 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

Avoids having to prepend /dev/ at every user.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../deploy-image/files/deploy-image-wic.sh                | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh b/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh
index f73a48a9..5c362bcf 100644
--- a/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh
+++ b/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh
@@ -78,16 +78,16 @@  if [ "$(echo "$target_device_list" | wc -w)" -gt 1 ]; then
     array=()
     for target in $target_device_list; do
         target_size=$(lsblk --nodeps --noheadings -o SIZE /dev/"$target")
-        array+=("$target" "/dev/$target $target_size")
+        array+=("/dev/$target" "/dev/$target $target_size")
     done
     TARGET_DEVICE=$(dialog --clear \
                 --no-tags --menu "Select device to install $DISK_IMAGE" 10 60 3 \
                 "${array[@]}" --output-fd 1)
 
 else
-    TARGET_DEVICE=$(echo "$target_device_list" | tr -d " ")
+    TARGET_DEVICE=/dev/$(echo "$target_device_list" | tr -d " ")
 fi
-TARGET_DEVICE_SIZE=$(lsblk --nodeps --noheadings -o SIZE /dev/"$TARGET_DEVICE")
+TARGET_DEVICE_SIZE=$(lsblk --nodeps --noheadings -o SIZE "$TARGET_DEVICE")
 dialog --msgbox "Start installing '$DISK_IMAGE' to '$TARGET_DEVICE'(Size: '$TARGET_DEVICE_SIZE' )." 7 60
 
 bmap_options=""
@@ -95,7 +95,7 @@  if [ -z "$DISK_BMAP" ]; then
     bmap_options="--nobmap"
 fi
 clear
-if ! bmaptool copy ${bmap_options} "$installdata/$DISK_IMAGE" "/dev/${TARGET_DEVICE}"; then
+if ! bmaptool copy ${bmap_options} "$installdata/$DISK_IMAGE" "${TARGET_DEVICE}"; then
     exit 1
 fi