From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7387032429685374976 X-Received: by 2002:a2e:a802:0:b0:2ec:56ce:d50e with SMTP id 38308e7fff4ca-2ee5e337926mr81163421fa.3.1719927517435; Tue, 02 Jul 2024 06:38:37 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:b4b0:0:b0:2ec:4d9a:63bc with SMTP id 38308e7fff4ca-2ee52fc61afls21158501fa.1.-pod-prod-09-eu; Tue, 02 Jul 2024 06:38:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IExJ0i4p4FIPO242MbCrzgrYq2R602Vw9x1hdkHu1yLkOMByXU73xF+Lr5osB5M/qCXiqeN X-Received: by 2002:a05:651c:1a1e:b0:2ec:53ad:457 with SMTP id 38308e7fff4ca-2ee5e6bc2b6mr69448771fa.36.1719927513944; Tue, 02 Jul 2024 06:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719927513; cv=none; d=google.com; s=arc-20160816; b=m3PyB/P7P07jtfek0hARPYCit0FTuj6qBXwU3o6FeXfT5n8kzVf28MQMhaZyE3hj10 YaqUxWwt2Lan1rpuymJWMfCDnlfGSd/UI3EFoaEjk8GDpP5mTcMB6lt1RdMsRz3huUPA prvnY03ZiCm0LOvUVA3zXXwQvFyrTZmLsTdxLTPbc9EfKs82bWCpjbN7WzqScsawvhd0 wv7CGfvFW57Q4pSAdqnvYvOYqv1Irnajc7aNeZgGu23kQPw9TTWqP3AFmYh46a/bMnnp +4pG1PJoO14fSYKcPZDpj0f2nNxGtWaJtHQCjNv46dxHDaAtP5bzaygzWLO2SpwqHOkU DhwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=wRN3nktX6j5+m8UyB2Yzk5bA6kV8kMUrwqcel2ydmbo=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=oh8dwapqk74/OHBIaI0x3LJsdmrQwQHj57WmM2oJjRYAOfeXCgHGOmi79g5pUyYMyc wdGXpsLG468mfLrbMNzYGvAp2xCKD792EvXlqojL3jgJ+FsUQ8B7/tYUc3D0kmT7Rgij eVI/94X/bagSU7BN3GKgJP7MgZHSnEzDkYmqKWvUz3bMTG5fXD5lKtBZ/nG0ao6Cx09r iCl0jrowpHO1UD8yxFB+yKNN3j9s3r3S4Ma+jqQh1o8RpW3xA6Ch6GyFtU5KXzP0Br5u Goqv6YBN9jX3rfAUf8cYSW7bzsI9FoSEzIrLBFpdy26AoxXYhzSZ17xUBLVFqQWMr2xh 5w0A==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b="lykTAV/o"; spf=pass (google.com: domain of fm-294854-202407021338333535d6891860004e67-eafmkz@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-294854-202407021338333535d6891860004e67-eafMkz@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net. [185.136.64.225]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-425788015e4si5278485e9.1.2024.07.02.06.38.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jul 2024 06:38:33 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-294854-202407021338333535d6891860004e67-eafmkz@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) client-ip=185.136.64.225; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b="lykTAV/o"; spf=pass (google.com: domain of fm-294854-202407021338333535d6891860004e67-eafmkz@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-294854-202407021338333535d6891860004e67-eafMkz@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 202407021338333535d6891860004e67 for ; Tue, 02 Jul 2024 15:38:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=wRN3nktX6j5+m8UyB2Yzk5bA6kV8kMUrwqcel2ydmbo=; b=lykTAV/o8cMcBTFNtD4GkNjS1L+t08CVaE0pu1C1CO0G5yxBQTn1/9rnA2yJS1aSxrJGnG euYfEw3eH0vqcPdzmze+4zdLYCJ1DvCoya/56GZ/mHxOZp5s+IyT5Q29aA6h39aQcKa/gMEe dBWc+jDL4vOoelKYHGEvGRZb1uXpw=; From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH 11/17] meta-isar: deploy-image: Fix and enhance image selection dialog Date: Tue, 2 Jul 2024 15:38:25 +0200 Message-ID: <162026333e672018b2286d379fd9e88ea7792ce4.1719927511.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer X-TUID: zx3nkXPWlc2a From: Jan Kiszka The dialog was broken because an array of tag/value tuples had to be provided, not just a list of files. Use the chance an also fall back to the dialog if the search for DISK_IMAGE does deliver a result but not a clear one. But only open the dialog if there are entries. Signed-off-by: Jan Kiszka --- .../deploy-image/files/deploy-image-wic.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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 81a006ce..35029728 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 @@ -7,16 +7,18 @@ installdata=${INSTALL_DATA:-/install} DISK_IMAGE=$(find "$installdata" -type f -iname "*.wic*" -a -not -iname "*.wic.bmap" -exec basename {} \;) -if [ -z "$DISK_IMAGE" ]; then +if [ -z "$DISK_IMAGE" ] || [ ! -f "$installdata/$DISK_IMAGE" ]; then pushd "$installdata" - shopt -s nullglob - array=(*) - shopt -u nullglob + for f in $(find . -type f); do + array+=("$f" "$f") + done popd - if ! DISK_IMAGE=$(dialog --no-tags \ - --menu "Select image to be installed" 10 60 3 \ - "${array[@]}" --output-fd 1) - exit 0 + if [ ${#array[@]} -gt 0 ]; then + if ! DISK_IMAGE=$(dialog --no-tags \ + --menu "Select image to be installed" 10 60 3 \ + "${array[@]}" --output-fd 1); then + exit 0 + fi fi fi if [ ! -f "$installdata/$DISK_IMAGE" ]; then -- 2.43.0