* [PATCH v2 0/1] expand-on-first-boot: Fix early exit in helper script
@ 2022-06-10 11:19 Uladzimir Bely
2022-06-10 11:19 ` [PATCH v2 1/1] expand-on-first-boot: Fix early exit with error " Uladzimir Bely
2022-06-17 17:08 ` [PATCH v2 0/1] expand-on-first-boot: Fix early exit " Anton Mikanovich
0 siblings, 2 replies; 3+ messages in thread
From: Uladzimir Bely @ 2022-06-10 11:19 UTC (permalink / raw)
To: isar-users
This fixes early exit from the script caused by possible 'find' error
that leads to unexpanded rootfs after boot.
Bug was reproduced at least with RPi images.
Changes since v1:
- Replaced '| head -1' to cleaner '|| true'
Uladzimir Bely (1):
expand-on-first-boot: Fix early exit with error in helper script
.../expand-on-first-boot/files/expand-last-partition.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/1] expand-on-first-boot: Fix early exit with error in helper script
2022-06-10 11:19 [PATCH v2 0/1] expand-on-first-boot: Fix early exit in helper script Uladzimir Bely
@ 2022-06-10 11:19 ` Uladzimir Bely
2022-06-17 17:08 ` [PATCH v2 0/1] expand-on-first-boot: Fix early exit " Anton Mikanovich
1 sibling, 0 replies; 3+ messages in thread
From: Uladzimir Bely @ 2022-06-10 11: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.
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 0/1] expand-on-first-boot: Fix early exit in helper script
2022-06-10 11:19 [PATCH v2 0/1] expand-on-first-boot: Fix early exit in helper script Uladzimir Bely
2022-06-10 11:19 ` [PATCH v2 1/1] expand-on-first-boot: Fix early exit with error " Uladzimir Bely
@ 2022-06-17 17:08 ` Anton Mikanovich
1 sibling, 0 replies; 3+ messages in thread
From: Anton Mikanovich @ 2022-06-17 17:08 UTC (permalink / raw)
To: Uladzimir Bely, isar-users
10.06.2022 14:19, Uladzimir Bely wrote:
> This fixes early exit from the script caused by possible 'find' error
> that leads to unexpanded rootfs after boot.
>
> Bug was reproduced at least with RPi images.
>
> Changes since v1:
> - Replaced '| head -1' to cleaner '|| true'
>
> Uladzimir Bely (1):
> expand-on-first-boot: Fix early exit with error in helper script
>
> .../expand-on-first-boot/files/expand-last-partition.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Applied to next, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-17 17:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10 11:19 [PATCH v2 0/1] expand-on-first-boot: Fix early exit in helper script Uladzimir Bely
2022-06-10 11:19 ` [PATCH v2 1/1] expand-on-first-boot: Fix early exit with error " Uladzimir Bely
2022-06-17 17:08 ` [PATCH v2 0/1] expand-on-first-boot: Fix early exit " Anton Mikanovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox