public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "alexander.heinisch via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: jan.kiszka@siemens.com,
	Alexander Heinisch <alexander.heinisch@siemens.com>
Subject: [PATCH] meta-isar: Added support for nfs based rootfs in deploy-image-wic (isar-image-installer).
Date: Wed, 28 Aug 2024 13:46:15 +0200	[thread overview]
Message-ID: <20240828114615.123711-1-alexander.heinisch@siemens.com> (raw)

From: Alexander Heinisch <alexander.heinisch@siemens.com>

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 <alexander.heinisch@siemens.com>
---
 .../deploy-image/files/deploy-image-wic.sh             | 10 ++++++++--
 1 file changed, 8 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..95188fe3 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,14 @@ 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_type=$(findmnt / -o fstype -n)
+    if [ ${current_root_dev_type} = "nfs" ]; then
+        current_root_dev="nfs"
+    else
+        current_root_dev=$(readlink -f "$(findmnt / -o source -n)")
+        current_root_dev=${current_root_dev#\/dev/}
+    fi
+
     case $current_root_dev in
         mmcblk*)
             ;;
-- 
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/20240828114615.123711-1-alexander.heinisch%40siemens.com.

             reply	other threads:[~2024-08-28 11:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 11:46 alexander.heinisch via isar-users [this message]
2024-09-04  8:23 ` Uladzimir Bely
  -- strict thread matches above, loose matches on Subject: below --
2024-08-28 11:19 alexander.heinisch via isar-users

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240828114615.123711-1-alexander.heinisch@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=alexander.heinisch@siemens.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox