public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] expand-on-first-boot: Fix early exit in helper script
@ 2022-06-10  3:19 Uladzimir Bely
  2022-06-10  5:14 ` Jan Kiszka
  0 siblings, 1 reply; 5+ messages in thread
From: Uladzimir Bely @ 2022-06-10  3:19 UTC (permalink / raw)
  To: isar-users

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.

Passing 'find' output to 'head -1' masks possible error from 'find'
without breaking the logic and continues 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..934a014f 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 | head -1)
 if [ -n "${ROOT_DEV_SLAVE}" ]; then
 	ROOT_DEV=/dev/${ROOT_DEV_SLAVE##*/}
 fi
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-10 10:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10  3:19 [PATCH] expand-on-first-boot: Fix early exit in helper script Uladzimir Bely
2022-06-10  5:14 ` Jan Kiszka
2022-06-10  7:13   ` Uladzimir Bely
2022-06-10  9:32     ` Henning Schild
2022-06-10 10:03       ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox