[13/17] meta-isar: deploy-image: Polish some dialogs

Message ID 861ba578d809bcd01d8dfd3b9ead57e733baafdd.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>

Add linewraps at defined points to the start dialog, strip spaces from
device size output, adjust formattings. Some other message boxes can be
shrunk in height.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../deploy-image/files/deploy-image-wic.sh               | 9 +++++----
 1 file changed, 5 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 673b2eb3..5ae62a55 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
@@ -22,7 +22,7 @@  if [ -z "$DISK_IMAGE" ] || [ ! -f "$installdata/$DISK_IMAGE" ]; then
     fi
 fi
 if [ ! -f "$installdata/$DISK_IMAGE" ]; then
-    dialog --msgbox "Could not find an image to install. Installation aborted." 7 60
+    dialog --msgbox "Could not find an image to install. Installation aborted." 6 60
     exit 1
 fi
 DISK_BMAP=$(find "$installdata" -type f -iname "${DISK_IMAGE%.wic*}.wic.bmap")
@@ -97,9 +97,9 @@  if [ "$(echo "$target_device_list" | wc -w)" -gt 1 ]; then
 else
     TARGET_DEVICE=/dev/$(echo "$target_device_list" | tr -d " ")
 fi
-TARGET_DEVICE_SIZE=$(lsblk --nodeps --noheadings -o SIZE "$TARGET_DEVICE")
+TARGET_DEVICE_SIZE=$(lsblk --nodeps --noheadings -o SIZE "$TARGET_DEVICE" | tr -d " ")
 if ! dialog --yes-label Ok --no-label Cancel \
-            --yesno "Start installing '$DISK_IMAGE' to '$TARGET_DEVICE'(Size: '$TARGET_DEVICE_SIZE' )." 7 60; then
+            --yesno "Start installing\n'$DISK_IMAGE'\nto $TARGET_DEVICE (capacity: $TARGET_DEVICE_SIZE)" 7 60; then
     exit 0
 fi
 
@@ -118,5 +118,6 @@  if ! bmaptool copy ${bmap_options} "$installdata/$DISK_IMAGE" "${TARGET_DEVICE}"
     exit 1
 fi
 
-dialog --title "Reboot" --msgbox "Installation is successful. System will be rebooted. Please remove the USB stick." 7 60
+dialog --title "Reboot" \
+       --msgbox "Installation is successful. System will be rebooted. Please remove the USB stick." 6 60
 exit 0