From: Uladzimir Bely <ubely@ilbers.de>
To: Quirin Gylstorff <Quirin.Gylstorff@siemens.com>,
isar-users@googlegroups.com
Subject: Re: [PATCH] expand-on-first-boot: search until no device mapper is used
Date: Fri, 26 Apr 2024 09:07:45 +0300 [thread overview]
Message-ID: <21fdb960556bc34f6d2e83098ba94b393bf7c403.camel@ilbers.de> (raw)
In-Reply-To: <20240417065534.1678488-1-Quirin.Gylstorff@siemens.com>
On Wed, 2024-04-17 at 08:55 +0200, 'Quirin Gylstorff' via isar-users
wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>
> Device mapper block devices can be stacked e.g.
> in case a hard disk is encrypted and uses lvm:
> sda
> +-sda1 259:3 0 2G 0 part
> +-sda1_crypt 253:0 0 2G 0 crypt
> +-debian--vg-root 253:1 0 1G 0 lvm
>
> So we should traverse the `slaves` until we reach the endpoint.
>
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
> .../expand-on-first-boot/files/expand-last-partition.sh | 3
> +++
> 1 file changed, 3 insertions(+)
>
> 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 84f1219f..0cb2ee21 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
> @@ -12,6 +12,9 @@ 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 || true)
> +while [ -d "${ROOT_DEV_SLAVE}/slaves" ]; do
> + ROOT_DEV_SLAVE=$(find "${ROOT_DEV_SLAVE}"/slaves -mindepth 1
> -print -quit 2>/dev/null || true)
> +done
> if [ -n "${ROOT_DEV_SLAVE}" ]; then
> ROOT_DEV=/dev/${ROOT_DEV_SLAVE##*/}
> fi
> --
> 2.43.0
>
Applied to next, thanks.
--
Best regards,
Uladzimir.
prev parent reply other threads:[~2024-04-26 6:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 6:55 Quirin Gylstorff
2024-04-26 6:07 ` Uladzimir Bely [this message]
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=21fdb960556bc34f6d2e83098ba94b393bf7c403.camel@ilbers.de \
--to=ubely@ilbers.de \
--cc=Quirin.Gylstorff@siemens.com \
--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