* [PATCH v2] expand-on-first-boot: Resolve errors in helper script
@ 2022-05-25 12:26 Jan Kiszka
2022-06-02 11:27 ` Anton Mikanovich
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2022-05-25 12:26 UTC (permalink / raw)
To: isar-users; +Cc: Moessbauer, Felix (T CED SES-DE), Henning Schild
From: Jan Kiszka <jan.kiszka@siemens.com>
Missing quotes broke the -n test, and as we are at it, also resolve the
shellcheck warnings and consolidate over 'find' for retrieving
ROOT_DEV_SLAVE.
Fixes: 15214487e19e ("expand-on-first-boot: Add support for devicemapper")
Reported-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
.../expand-on-first-boot/files/expand-last-partition.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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 bb371e9f..f3e29a1c 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,8 +11,8 @@ set -e
ROOT_DEV="$(findmnt / -o source -n)"
ROOT_DEV_NAME=${ROOT_DEV##*/}
-ROOT_DEV_SLAVE=$(ls -d /sys/block/${ROOT_DEV_NAME}/slaves/* 2>/dev/null | head -1)
-if [ -n ${ROOT_DEV_SLAVE} ]; then
+ROOT_DEV_SLAVE=$(find /sys/block/"${ROOT_DEV_NAME}"/slaves -mindepth 1 -print -quit 2>/dev/null)
+if [ -n "${ROOT_DEV_SLAVE}" ]; then
ROOT_DEV=/dev/${ROOT_DEV_SLAVE##*/}
fi
--
2.35.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] expand-on-first-boot: Resolve errors in helper script
2022-05-25 12:26 [PATCH v2] expand-on-first-boot: Resolve errors in helper script Jan Kiszka
@ 2022-06-02 11:27 ` Anton Mikanovich
0 siblings, 0 replies; 2+ messages in thread
From: Anton Mikanovich @ 2022-06-02 11:27 UTC (permalink / raw)
To: Jan Kiszka, isar-users; +Cc: Moessbauer, Felix (T CED SES-DE), Henning Schild
25.05.2022 15:26, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Missing quotes broke the -n test, and as we are at it, also resolve the
> shellcheck warnings and consolidate over 'find' for retrieving
> ROOT_DEV_SLAVE.
>
> Fixes: 15214487e19e ("expand-on-first-boot: Add support for devicemapper")
> Reported-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Applied to next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-02 11:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 12:26 [PATCH v2] expand-on-first-boot: Resolve errors in helper script Jan Kiszka
2022-06-02 11:27 ` Anton Mikanovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox