From patchwork Tue Oct 8 10:22:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "alexander.heinisch" X-Patchwork-Id: 3856 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Tue, 08 Oct 2024 12:23:26 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-qt1-f188.google.com (mail-qt1-f188.google.com [209.85.160.188]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 498ANOXj023277 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 8 Oct 2024 12:23:25 +0200 Received: by mail-qt1-f188.google.com with SMTP id d75a77b69052e-45d94168de2sf113863001cf.2 for ; Tue, 08 Oct 2024 03:23:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1728382999; cv=pass; d=google.com; s=arc-20240605; b=RyjImrKOSbDOoGVEWoJoa4kaY+RxkevQ1BMliQ7CpZIUad1e30wf48NTzHtYbfxv71 G2b16/SCoMKhpKWbbwIlmCE1e7nucgn0N1sfykKekzOeGvjs6My2GGrSlzpB0UUOlhb8 IYxAcVCOMfLw12G+ciPnxNAxLYBAloNzq6z77mys/IJ94WWygH8+dDN7BI3ttYOKZu5O DeyownpWeUL07lBh6z0x8SPkmok2/+jWXEoKYNfQ0istEol841429IdhPK8GBXNdeZDk botqTD/4PPJr9reVkW+vB9m+wFx52VxgctHcywpoawoKKCs9VMu0ch6ZPb6Xsf8kvazg RwHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xbrLM3XmID/wf6D1GmWV3GiXDEEy7u5jCiH/AtGsC+c=; fh=y09aqYxvR1mJuI5wh/rBk3QUYEGUEgFeqJ+CNaElGV8=; b=ch0PMM4+uPWQWA97E97iFx9YoZJSC1PF8WoFSHjTCs6BrkTvNXDSs0DMvmlMFT7IgI nJPGJd8rgYI6QKzcCknAi+8PIvF9BRQ5eF0Tz68Ck+fr5a+acddX9F913NBimPXeyshr 8UqwX2VQNbpoDUjpUIibcGnnog81z3N5/V7mhIZS7D5t/pXh3RJpWscgRT8wY3Hf45XT /vOkgP567TynyJ8RLSoIDJo4kKXhn4MwrenSKFlLLcNbln8r4tExOql7dSPceKJZ1PV1 FaWSNF75lh6Q5C66ycx5enit/vwVpNxyIIMb01BnzcRPm4pjG2wsQrdIIV0L2zPWnpfF Utdw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b="oF/Xw1S6"; spf=pass (google.com: domain of fm-1326448-20241008102316e23d00a67da423706e-mikmcd@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-1326448-20241008102316e23d00a67da423706e-mIkMCD@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1728382999; x=1728987799; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=xbrLM3XmID/wf6D1GmWV3GiXDEEy7u5jCiH/AtGsC+c=; b=s7gs959XnJdokhq0d+kYhfFoYm9zioMzpGuzHHxBkYigK5sLhukOVWpdOjrqN1MZmq NuowGXw9s0AEH28TMu3bH+t/+rDj9R56N6nuj5yWJU6HBmWYQ4/lfbq9Jwa4WuvXmz9G qYlyHn0erB45mpZ09iQ8ZPaB48RX+7a+K84uOGBinnS1SgcYcGvkZ1+PYGW5VHH0KOMM WCPs0+UtPRsQYXgDkGlYziV2nIN7i/SphiFNLsKLCoB/whfZFWm1IKh+pUIu0TU3v6Rk /f5kYYhrf/Xc8+NexSsrOmqHmNRv3FwXkyPGoF8SlJReb3cphUbUyQeJ8RAeg3+as3Zg oq9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728382999; x=1728987799; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xbrLM3XmID/wf6D1GmWV3GiXDEEy7u5jCiH/AtGsC+c=; b=MVWdyT37FhrN22oMix8sbWu6zOhBVWccF0T6KS54o4ojzif2pQJPZfg0tbvZ93392F s/Utqtarh862ucj87ooOI4XkVo8AGrQ9u5mj20VszHQdo5GDlmM+xlNfERhCYGHFd7Gl 8HbT71qetjONjLso0uohddWb20Q6ZY7xhdfcBrzELvUzTpbegIZakztUH4jQ2+8yrpG6 vVSCS2VLX1iKgHT8/3K0FEmCY8MQU4BiuRxcB/9ZZsd78YSrcLFf3/3URgZ1Jy+PNWVA zzpAJ+XGMq5+Vvyw1MqW2zjXj++pmntFUfoNssD3yiHVoxEYjcoz9KM3Nywc2KxmGwSE 8t9w== X-Forwarded-Encrypted: i=2; AJvYcCUEiix26DC5upUzyA3uogMMD2oLdgwUk309gl1misg6WZYLdfJd6QOjbMSzwxsP51E/HztOJGI=@isar-build.org X-Gm-Message-State: AOJu0Yx1rQySaNaE6CELDfuNwO5sFlKTqV1robIdrnkQJB+lJsYlunyc NTvkyMwO6NUDNPqcp+xtuNHLE4GusHQ5APWrVSa5jpHxNLEeaadN X-Google-Smtp-Source: AGHT+IFCm4XqkHCmqKpPNNZjx8koiiduCCO3vTEjo16Y3NUTurUjxc6cvEKkRk6QhvISVBSZA0IMhQ== X-Received: by 2002:a05:622a:199c:b0:458:59e3:2b4c with SMTP id d75a77b69052e-45d9ba5b20fmr249329021cf.24.1728382998718; Tue, 08 Oct 2024 03:23:18 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ad4:5ae8:0:b0:6b5:da50:ac19 with SMTP id 6a1803df08f44-6cb902a9a61ls23942616d6.2.-pod-prod-07-us; Tue, 08 Oct 2024 03:23:18 -0700 (PDT) X-Received: by 2002:a05:6102:50a4:b0:4a3:aa99:5f07 with SMTP id ada2fe7eead31-4a4058f499dmr9349413137.23.1728382997981; Tue, 08 Oct 2024 03:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728382997; cv=none; d=google.com; s=arc-20240605; b=SPywGGRPGvD4N4M+vN/1dr0IEk3AalremGQLh/osgjqxtoR6NM1Jh4N+E/XkMLlJNN q9w+qm41Is/DB/ehV/ZFVLvz5hWqnFcPmMCT9XdPuUwd+85mB1KHedFcLlB8Psf6+fw0 uCWHycsjudUkkNSZ4mWjvRFU23WmYNIor2l/0KaFC8sM7uKjk2lU6jAMufRCBoUO9aCH sb2XbNkH3CnYob/qtyEoH0r4UFnUGP3xk1D6aE96WJiMX9SUkxDQaz3afdYrV3oSZNOt QlDVWhM8xXIxLdWw83RZajz38OZm1gxVMtBUBnrktRndGTw7t2jBtXtn2JI5+gENAiHu 8TkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=Ux8R2yxdx8q7M5EH9+TkDAwKA6zovq3Gci+iAA2AlUQ=; fh=lKRNNdAU0IICONvfa+KjpneoIxBGWimmAGb9Xm7u9s8=; b=HKAjJw/7nAHIQrVchkha/7YfcoEZzHWnth1XI4EAg+8udDJ0/RkPQsENelF0I0uzI+ 7ThpBZt+W4u2mfTW7ShrSc40WVGR5fR84veBa1q87XTrKuJ8L6RlxpeoqOOzuBEWUcsl u2en+tqIXCp+xmmQEWTWlq/kA4dQitDW3STCLGvP7O6SXYeWa/Tlv9Z66Ahrc9FM9XSV gOiNEnXH+Jr2s2jLsaxH9p+hKY1p/dbQVwQb46/PBZ8SkhMcEU1C5c02CW2eixHp9Sk5 JIvqM+nk89HSpNchdRt87evq3ixNirYuV8USohz/eDzMYoY5b6bszjWuAkohvWIy0p6N OjVQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b="oF/Xw1S6"; spf=pass (google.com: domain of fm-1326448-20241008102316e23d00a67da423706e-mikmcd@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-1326448-20241008102316e23d00a67da423706e-mIkMCD@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net. [185.136.65.226]) by gmr-mx.google.com with ESMTPS id ada2fe7eead31-4a412c92906si367807137.0.2024.10.08.03.23.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2024 03:23:17 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1326448-20241008102316e23d00a67da423706e-mikmcd@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) client-ip=185.136.65.226; Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 20241008102316e23d00a67da423706e for ; Tue, 08 Oct 2024 12:23:16 +0200 X-Patchwork-Original-From: "alexander.heinisch via isar-users" From: "alexander.heinisch" To: isar-users@googlegroups.com Cc: jan.kiszka@siemens.com, quirin.gylstorff@siemens.com, Alexander Heinisch Subject: [PATCH 2/2] meta-isar: Unified variable names in deploy-image script. Date: Tue, 8 Oct 2024 12:22:35 +0200 Message-ID: <20241008102235.34078-3-alexander.heinisch@siemens.com> In-Reply-To: <20241008102235.34078-1-alexander.heinisch@siemens.com> References: <20241008102235.34078-1-alexander.heinisch@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1326448:519-21489:flowmailer X-Original-Sender: alexander.heinisch@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b="oF/Xw1S6"; spf=pass (google.com: domain of fm-1326448-20241008102316e23d00a67da423706e-mikmcd@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-1326448-20241008102316e23d00a67da423706e-mIkMCD@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: alexander.heinisch@siemens.com Reply-To: alexander.heinisch@siemens.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Alexander Heinisch Unified shell variable names between deploy image config handling and actual deploy script. renamed AUTO_INSTALL to installer_unattended renamed DISK_IMAGE to installer_image_uri renamed TARGET_DEVICE to installer_target_dev renamed OVERWRITE to installer_target_overwrite Signed-off-by: Alexander Heinisch --- .../files/usr/bin/deploy-image-wic.sh | 42 ++++++++----------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-image-wic.sh b/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-image-wic.sh index 108a5975..e6ee426d 100755 --- a/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-image-wic.sh +++ b/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-image-wic.sh @@ -11,22 +11,16 @@ SCRIPT_DIR=$( dirname -- "$( readlink -f -- "$0"; )"; ) . ${SCRIPT_DIR}/../lib/deploy-image-wic/handle-config.sh -# Map config params -AUTO_INSTALL=${installer_unattended} -DISK_IMAGE=${installer_image_uri} -TARGET_DEVICE=${installer_target_dev} -OVERWRITE=${installer_target_overwrite} - -if ! $AUTO_INSTALL; then - DISK_IMAGE=$(find "$installdata" -type f -iname "*.wic*" -a -not -iname "*.wic.bmap" -exec basename {} \;) - if [ -z "$DISK_IMAGE" ] || [ ! -f "$installdata/$DISK_IMAGE" ]; then +if ! $installer_unattended; then + installer_image_uri=$(find "$installdata" -type f -iname "*.wic*" -a -not -iname "*.wic.bmap" -exec basename {} \;) + if [ -z "$installer_image_uri" ] || [ ! -f "$installdata/$installer_image_uri" ]; then pushd "$installdata" for f in $(find . -type f); do array+=("$f" "$f") done popd if [ ${#array[@]} -gt 0 ]; then - if ! DISK_IMAGE=$(dialog --no-tags \ + if ! installer_image_uri=$(dialog --no-tags \ --menu "Select image to be installed" 10 60 3 \ "${array[@]}" --output-fd 1); then exit 0 @@ -34,11 +28,11 @@ if ! $AUTO_INSTALL; then fi fi - if [ ! -f "$installdata/$DISK_IMAGE" ]; then + if [ ! -f "$installdata/$installer_image_uri" ]; then 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") + DISK_BMAP=$(find "$installdata" -type f -iname "${installer_image_uri%.wic*}.wic.bmap") # inspired by poky/meta/recipes-core/initrdscripts/files/install-efi.sh target_device_list="" @@ -108,37 +102,37 @@ if ! $AUTO_INSTALL; then fi array+=("/dev/$target" "/dev/$target ($target_size, $state)") done - if ! TARGET_DEVICE=$(dialog --no-tags \ + if ! installer_target_dev=$(dialog --no-tags \ --menu "Select device to install image to" 10 60 3 \ "${array[@]}" --output-fd 1); then exit 0 fi else - TARGET_DEVICE=/dev/$(echo "$target_device_list" | tr -d " ") + installer_target_dev=/dev/$(echo "$target_device_list" | tr -d " ") fi - TARGET_DEVICE_SIZE=$(lsblk --nodeps --noheadings -o SIZE "$TARGET_DEVICE" | tr -d " ") + TARGET_DEVICE_SIZE=$(lsblk --nodeps --noheadings -o SIZE "$installer_target_dev" | tr -d " ") if ! dialog --yes-label Ok --no-label Cancel \ - --yesno "Start installing\n'$DISK_IMAGE'\nto $TARGET_DEVICE (capacity: $TARGET_DEVICE_SIZE)" 7 60; then + --yesno "Start installing\n'$installer_image_uri'\nto $installer_target_dev (capacity: $TARGET_DEVICE_SIZE)" 7 60; then exit 0 fi # set absolute paths to be compatible with unattended mode - DISK_IMAGE="$installdata/$DISK_IMAGE" + installer_image_uri="$installdata/$installer_image_uri" if [ -z "$DISK_BMAP" ]; then DISK_BMAP="$installdata/$DISK_BMAP" fi fi -if ! cmp /dev/zero "$TARGET_DEVICE" -n 1M; then - if ! $AUTO_INSTALL && \ +if ! cmp /dev/zero "$installer_target_dev" -n 1M; then + if ! $installer_unattended && \ ! dialog --defaultno \ --yesno "WARNING: Target device is not empty! Continue anyway?" 5 60; then exit 0 else - if [ "$OVERWRITE" != "OVERWRITE" ]; then + if [ "$installer_target_overwrite" != "installer_target_overwrite" ]; then echo "Target device is not empty! -> Abort" - echo "If you want to override existing data set \"installer_target_overwrite=OVERWRITE\"" + echo "If you want to override existing data set \"installer_target_overwrite=installer_target_overwrite\"" fi fi fi @@ -148,15 +142,15 @@ if [ -z "$DISK_BMAP" ]; then bmap_options="--nobmap" fi -if ! $AUTO_INSTALL; then +if ! $installer_unattended; then clear fi -if ! bmaptool copy ${bmap_options} "$DISK_IMAGE" "${TARGET_DEVICE}"; then +if ! bmaptool copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then exit 1 fi -if ! $AUTO_INSTALL; then +if ! $installer_unattended; then dialog --title "Reboot" \ --msgbox "Installation was successful. System will be rebooted. Please remove the USB stick." 6 60 else