From patchwork Wed Aug 28 11:19:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Heinisch, Alexander" X-Patchwork-Id: 3774 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 28 Aug 2024 13:21:17 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-qk1-f183.google.com (mail-qk1-f183.google.com [209.85.222.183]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 47SBLFw5028408 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 28 Aug 2024 13:21:16 +0200 Received: by mail-qk1-f183.google.com with SMTP id af79cd13be357-7a1db42803esf944087285a.2 for ; Wed, 28 Aug 2024 04:21:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1724844070; cv=pass; d=google.com; s=arc-20240605; b=C9htjYeA0tpWaOJFOZEvU3ejPgO6VRWkS5zCr42vkQJt2CbyrR0EqvEyCPEXYcEidk IUSZZZmo2aUxHCC3T42I76qp7D7Ii/q+sa4vQua493cn3/HnKMxGKOT1Suc4XVZPLkO0 KQrA0uOQiOJt2phoyfPgJQdQH/6YXrkFFnkZoM73/cxI4hqK10+ROvni/2lJyTvheynu TvDEtVmLMdRiQCkx2nrswMHO/JC1kXzsNt28+62LAMOl7V/V/I9ED+79BRdsP6H1qr3H 1gSjOQDuaTs43Sn8/af6MvtHXKcGrW/HLVJANyNHTKn6HhUv2RXNDBc3eROypL6n2E2L 1gRg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=0aZKa+MIVFfZYPHK00OEtc92B8wXpQtoi8rTl7xK7QE=; fh=ykwp1j3qTU2qcII2fcBWDOfMIwJhktgvI3N+QtEjk3o=; b=UtO+E6ePznEsQLv7ZaDnR5BNkjGnImIqXFpJAMBgH1gFnzAALeOqtXU9VPKRNxO/4Z HjdXzj+e1h4AP6Rq5qEaoDBryGXisjXEwNOlgP572TV8sUqWBBrWyJwp0NVxqqLxs3jP WazRvpaYUuz7fF+tnNRbokpPMuEZh0HP30OBbHi++dxWVS5o9TKvVNYIqaCssw3r+3We 4bTPp6MbXjD7ZUDZtnGJ97cYgWALU1uA+BQI2eacS//JlyUtD68BXEozKQPv8vEsM05g vReIHbTMM3WnfyVyJ7VUMc/nIUdxbPoRXenkgTn3o3VY0bI1CweqDupLvZwxwlbwO80Q yJ2A==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=K77BxwnZ; spf=pass (google.com: domain of fm-1326448-20240828112107e24b9e38df874212b6-tjpazo@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1326448-20240828112107e24b9e38df874212b6-TJpAZO@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=1724844070; x=1725448870; 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:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=0aZKa+MIVFfZYPHK00OEtc92B8wXpQtoi8rTl7xK7QE=; b=f/BWyRrFOsyuO3A1eBnBua8nmMgpV9lcHWKNENcCUi0VtIyHWFKCJEsq+SpRdu0OlL Mq/Cie/wPU8bjhK+oBz7SCKSshtbe+YxcvslSKRqVqFWKlWx/aUCyc1pTp5cVIuShhUc zbezsvDYMCnO9pYdSD1CwFpyzf2/QHZCcqW6y8xyX7huR9qKdHmJ1AElrqwCYYKuA4nk O7PCG4GM8r/nFyQ2e+MxIKpGNUqtVJfg+0PLqadnQmAc46KxEfK27Qwy2WRlq+FeO6MC Lj+8XwwwAlKZnkZjE+t0dKJsPI2sTHvhx35RyJYlBa6Tm1r2Wt5rvES0hR9o3TzzfnIg SnEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724844070; x=1725448870; 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:message-id:date:subject:cc:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0aZKa+MIVFfZYPHK00OEtc92B8wXpQtoi8rTl7xK7QE=; b=SdfLKel2FNRv6BcSRoe1LKwItiAyhJOXMuNWhF3NLdjWmFgvX/4xWFijTEyWo2inb1 a1vvJrLFlSi2TOZrcJdrWBgUOh+OliU5WaMaOHI27gCpIH8t7w1ghXaqdiUrpnmT4CAm mQBYdpBVyKOLiJCK0E3RKrDqSnfKGuRlMbc/3pj5ZOERPejL5f3c95Z5S5ahSzqb7EXA dOb+Oudw+mtdBDrP/eaLsS2m4aJSR1XS7ZQuqOyAr/HOOO33Ec/6/pFLkXA6GeIego5g FbFP9IWDNsBxEfTpp+BSF9AjLTJvppLwOXMWosYTQ4fuXM1DMqDwh+dKPCNAcPzUamWW ZL5A== X-Forwarded-Encrypted: i=2; AJvYcCVzgNhNuIjjwpfhfXggcBwrKBxUnfVA0+gSaEnub8q+4t/LfBdcUF/EqzVcrSfqRgRWNFhiz7c=@isar-build.org X-Gm-Message-State: AOJu0YwT+X10QaKGVUDxwUAiqVq7DT7pYuTNL0ezqL+C6RuMLWhTdb++ JfP57YelFtporxiOtb2/33QZ2MrYtRcVwq0sbiBvllcWKSi2mWhd X-Google-Smtp-Source: AGHT+IGfTzN8grRZF7O9esIeUuiLOcywSeoW1noEy2MDSv4CcNjoEgzZSans9yxKtC2uHu1kiU7EfQ== X-Received: by 2002:a05:6214:2b97:b0:6bf:96aa:9891 with SMTP id 6a1803df08f44-6c33633785amr15401956d6.37.1724844070165; Wed, 28 Aug 2024 04:21:10 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6214:e4a:b0:6b5:a3b:a77 with SMTP id 6a1803df08f44-6c16130d824ls90140196d6.0.-pod-prod-09-us; Wed, 28 Aug 2024 04:21:09 -0700 (PDT) X-Received: by 2002:a05:6122:3b15:b0:4fc:edb4:3386 with SMTP id 71dfb90a1353d-4fef0f1837bmr1614845e0c.6.1724844069200; Wed, 28 Aug 2024 04:21:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724844069; cv=none; d=google.com; s=arc-20160816; b=s4V2yraF4znz6suxIiSBXybrdlRYvqaRtB6Gh+MDqynPwK/bdVatcJUJBXb6CIyuC6 WBgbuz4lJ8cVBIvsww5suqz/dXcGrxlhVB4rdedRQOLCrc5EnPvRfVbi7/OgDJVAnFZE SRtHxQZyNU5eNo60HIwdwfpbUZ64sBkED3iNWMxYjIlPUbgj/BiI5VqtID0DRWp+MP9Z vnBqcvjrNANFlau/d7e8dPDB7KSWTOtURKyNoX6UkuqqIxzC5aBHX/F7I8q3TJboWiw1 Hw3iHA8do6DIrAaWuxkXkWffKTvWGSb7SATagEjAARTR5W/JXK4Li0votIO3hhXMwb86 7/vQ== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=YTyreQGZe2KdUrt8t2uBzC+cnFSId9SDtL5b4BDsaok=; fh=PpWIame8u++O2AKYmz4eO2eLtEDNXbj/8l0CiINKMR8=; b=miAO58Avo7MGJXE9b/zrzEz6lpS+hwtEnP8b+acFHuUO9hPcNmLRrzwzM3Vf+wPzCE 9FJnYmkmpr8SlkxL6Zft0ny/D6dtneYLcy8ZaDkPSwxutlL1g3dXeX3/2mmxK9mI4Njj e3MO5Ld3vUVIj3jkee6ECo39r+iV/Sp2yoP5dJuFho6lZWNoJc1Z+gLVc9BjEB+Vk2Fq 7qxjyCCs+t2hRlBipVbTOPVlIlyEHgxHxkYx81Ih7VjgqCqVN7gbia1g2GnmkoORIs94 OsS28AEAAhhL1325LNu/eibZka96ehxZhjnAMdouzRvwrS6/mKF7L/liCdys3HLBcLYO oNMA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=K77BxwnZ; spf=pass (google.com: domain of fm-1326448-20240828112107e24b9e38df874212b6-tjpazo@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1326448-20240828112107e24b9e38df874212b6-TJpAZO@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net. [185.136.64.228]) by gmr-mx.google.com with ESMTPS id 71dfb90a1353d-4fd08369aa2si245133e0c.3.2024.08.28.04.21.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Aug 2024 04:21:08 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1326448-20240828112107e24b9e38df874212b6-tjpazo@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) client-ip=185.136.64.228; Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20240828112107e24b9e38df874212b6 for ; Wed, 28 Aug 2024 13:21:07 +0200 X-Patchwork-Original-From: "alexander.heinisch via isar-users" From: "Heinisch, Alexander" To: isar-users@googlegroups.com Cc: jan.kiszka@siemens.com, Alexander Heinisch Subject: [PATCH] meta-isar: Added support for nfs based rootfs in deploy-image-wic (isar-image-installer). Date: Wed, 28 Aug 2024 13:19:46 +0200 Message-ID: <20240828111946.112454-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=fm1 header.b=K77BxwnZ; spf=pass (google.com: domain of fm-1326448-20240828112107e24b9e38df874212b6-tjpazo@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1326448-20240828112107e24b9e38df874212b6-TJpAZO@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_MSPIKE_H2,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 When AUTO_INSTALL is not used, the script tries to resolve possible target devices to install the wic image to. To not overwrite the device hosting the current root we are using, it tries to detect the current root. Which works fine when a local device is used but does not work in the case of nfs. (most probably it won't work for cifs as well) With this patch we are detecting nfs based mounts of / before the local device tailored handling is applied and bypass the breaking parts (in this particular case readlink). Thus, in case of an nfs the current root device will be "nfs". Signed-off-by: Alexander Heinisch --- .../deploy-image/files/deploy-image-wic.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 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 8b25b1d2..f8ce1d27 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 @@ -47,8 +47,15 @@ DISK_BMAP=$(find "$installdata" -type f -iname "${DISK_IMAGE%.wic*}.wic.bmap") if ! $AUTO_INSTALL; then target_device_list="" - current_root_dev=$(readlink -f "$(findmnt / -o source -n)") - current_root_dev=${current_root_dev#\/dev/} + current_root_dev=$(findmnt / -o source -n) + current_root_dev_type=$(findmnt / -o fstype -n) + if [ ${current_root_dev_type} = "nfs" ]; then + current_root_dev="nfs" + else + current_root_dev=$(readlink -f "${current_root_dev}") + current_root_dev=${current_root_dev#\/dev/} + fi + case $current_root_dev in mmcblk*) ;;