public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH v2 1/1] expand-on-first-boot: Fix early exit with error in helper script
Date: Fri, 10 Jun 2022 13:19:59 +0200	[thread overview]
Message-ID: <20220610111959.3069-2-ubely@ilbers.de> (raw)
In-Reply-To: <20220610111959.3069-1-ubely@ilbers.de>

Changes in 342a751e introduced a regression when error from 'find'
makes helper script early exit (with -1 error code) just after an
attempt to assign ROOT_DEV_SLAVE variable. So, the last partition
remained not resized.

Masking possible error from 'find' doesn't break the logic and allows
to continue the script execution.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 .../expand-on-first-boot/files/expand-last-partition.sh         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
index f3e29a1c..c0edde73 100755
--- a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
+++ b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
@@ -11,7 +11,7 @@ set -e
 
 ROOT_DEV="$(findmnt / -o source -n)"
 ROOT_DEV_NAME=${ROOT_DEV##*/}
-ROOT_DEV_SLAVE=$(find /sys/block/"${ROOT_DEV_NAME}"/slaves -mindepth 1 -print -quit 2>/dev/null)
+ROOT_DEV_SLAVE=$(find /sys/block/"${ROOT_DEV_NAME}"/slaves -mindepth 1 -print -quit 2>/dev/null || true)
 if [ -n "${ROOT_DEV_SLAVE}" ]; then
 	ROOT_DEV=/dev/${ROOT_DEV_SLAVE##*/}
 fi
-- 
2.20.1


  reply	other threads:[~2022-06-10 11:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10 11:19 [PATCH v2 0/1] expand-on-first-boot: Fix early exit " Uladzimir Bely
2022-06-10 11:19 ` Uladzimir Bely [this message]
2022-06-17 17:08 ` Anton Mikanovich

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=20220610111959.3069-2-ubely@ilbers.de \
    --to=ubely@ilbers.de \
    --cc=isar-users@googlegroups.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