From mboxrd@z Thu Jan 1 00:00:00 1970 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 498ANOfX023273 (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-4582182b6afsf120178111cf.0 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=KzZp+JFiPnctourm+n5uyq3HEgekdB9EmxhpgV/a+RtPu04wrrLUw87okeq9f2ZeLC /50dV0eKnIQpzVqlXKJY+e9smEwgSGkl8sB0LCE60p48VMvDfFRUBg/oZr92JUQ24QsH lB1O5vkUD2CM+L6X6yQB57O4EPmg9y8c62hAAe+MeYJU8GJ6MAki1yZpwXQFaUUx0zuZ PxD644TVxzAeGn3DaYUWYi/F3oVd7iwsrSO8Zi77q6w7rRQ6kvdLkZmOcJXu87HCP00o vAz1tRQpD6dSO0DawVSavaYCcekqO4rNARzmOTZcAShgD5DhS9LC1Q6ERD4nnfcrdU3Q nPGA== 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=sReR4vLoLtY+q5eT+FB8rUtJ8TMd7zK28Pt60tIMbko=; b=jeK1Iqiq9Lry0Yk/820dSPI6aKqJiN2a5jzRjQgycMkFqEO+vNXj39S8vaA4/npg81 q1m6RvXoRJgju4d5QDEJKvf4dYzeXTUGstH8CjOmqVvjZ6E98njLaii79GN3k5//8+ZQ knooa51jFpIrfiCmovsBfkQoWOHQBD+x8MGdEGwsONy965sviuANbvd3v+M5TrKurisi dQyHyOESDLLE8V4nc8lX3V8DOnaEFhrjRcktCPOg2jowzj+OiPCDxC9MAe59p073PlMV Y9xzvYgPHUmG6bjUbRFxAxR26DCvZNU8GtTdW7PseLLLX52yCbePnLVrQEksbFeLdVjq oUoA==; darn=ilbers.de 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=ilbers.de; 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=airEx4tUSgUlt/1QV1h1dqyRxRgXGV1YAE2Vvnwn64SWl2jAeXS8eJa5k5OaVRJj/o 3fVwf+5V48VFNMumFsBt7mEU47BkTRjk370Xn6g5zTsrC6vNNb6pvluXkBNprOBV0Aab r+c2od6NH+LatAuZPBTguSC2iDRCrdUvDepQSx6xEDsvIbxFhzilc4dq930UI6/JLa4G 61c1ws9BknKQa/nFgRewvRoanZQ4VYYREY+N7Yr7RI8Uh9rHs7f6YGj21OGlHcD3soh7 SR5zYNykK663OMuDgeBRd7iS/840p7DuoI7vJs7ornYO6nVsObF3eVZLaq+uG1CfnpXr rUdA== 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=Z5q1e3q8qPxQ+70ZgKY9Q34FLbR9VRQwNxwUWin4+3T6ipQ7irdlyt4asitC1riGFh VcsIib7LocQXQcDHEigojSP2SL6rPieKb7bBNJTlpaA5t2RIszT9NcGON8TZD13IDvFQ 3UQ/WVyWux0Jvo9gc/JKK9EABpNtklNym7kYWaVOX/53bPjRljjLtslAWQ1xPcOxGP2r GF6Rr2/VZ+ewayF/N6RASuB5xZQu/TtfA0qNutRioEYSIodhTbE3AMlnvaQvp6Q70vbG r4+lT8Yn2lE2yzyHjdVYL2t/utcya+4sWaMqnjc+meVjz1MqqrDDpc3/1obc92i4jNY0 +8+Q== X-Forwarded-Encrypted: i=2; AJvYcCUFr+P7ZwwjvtvRnoM5Gt4crNDiLmYNWRMsorbrtP2Mpwl5VK4ghu8vUFa1nESHArMILWsp@ilbers.de X-Gm-Message-State: AOJu0YyNu6BHxx6uX1zZaND5xD/vGgGuO0sYdiHJ3uDBimCnZclP+TL/ u0bjpqD9xGuBkzjUJD4sOjSZIe/GkkUHpcL409LHD4DaXmp9Vyni 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 From: "alexander.heinisch via isar-users" 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 Content-Type: text/plain; charset="UTF-8" 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-TUID: e68KrAxpne4x 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 -- 2.43.0 -- You received this message because you are subscribed to the Google Groups "isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20241008102235.34078-3-alexander.heinisch%40siemens.com.