From: Jan Kiszka <jan.kiszka@siemens.com>
To: Tobias Schmidl <tobiasschmidl@siemens.com>,
<isar-users@googlegroups.com>
Cc: Joe MacDonald <joe.macdonald@siemens.com>
Subject: Re: [PATCH] expand-on-first-boot: Switch from resize2fs to systemd-growfs
Date: Wed, 25 May 2022 14:47:28 +0200 [thread overview]
Message-ID: <e14b46d8-8972-78eb-280d-3fab0705fe8e@siemens.com> (raw)
In-Reply-To: <20220525123246.779227-1-tobiasschmidl@siemens.com>
On 25.05.22 14:32, Tobias Schmidl wrote:
> We want to be more versatile in our approach of resizing the root
> partition. Therefore we switch from resize2fs to systemd-growfs (on
> systems with systemd-growfs).
Just for the sake of completeness: Since which Debian version is this
the case? I assume buster is fine, right? But stretch was not.
>
> This allows for ext4, btrfs, xfs, and dm-crypt partitions to be resized.
>
> Signed-off-by: Tobias Schmidl <tobiasschmidl@siemens.com>
> ---
> .../files/expand-last-partition.sh | 15 +++++++++++++--
> 1 file changed, 13 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 bb371e9..f0dc66d 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
> @@ -3,7 +3,7 @@
> # Resize last partition to full medium size
> #
> # This software is a part of ISAR.
> -# Copyright (c) Siemens AG, 2018
> +# Copyright (c) Siemens AG, 2018-2022
> #
> # SPDX-License-Identifier: MIT
>
> @@ -45,4 +45,15 @@ partx -u "${LAST_PART}"
> # when using systemd mount units.
> export EXT2FS_NO_MTAB_OK=1
>
> -resize2fs "${LAST_PART}"
> +# If we are on a systemd system, we call systemd-growfs, otherwise resize2fs
> +if [ -x /lib/systemd/systemd-growfs ]; then
> + MOUNT_POINT=$(findmnt "${LAST_PART}" -o target -n)
> + if [ -z "$MOUNT_POINT" ]; then
> + echo "Cannot find mount point for ${LAST_PART}"
> + exit 1
> + fi
> + mount "${MOUNT_POINT}" || true
> + /lib/systemd/systemd-growfs "${MOUNT_POINT}"
> +else
> + resize2fs "${LAST_PART}"
> +fi
I wonder if / how long we should keep the two paths...
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
next prev parent reply other threads:[~2022-05-25 12:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-25 12:32 Tobias Schmidl
2022-05-25 12:47 ` Jan Kiszka [this message]
2022-05-25 12:57 ` Bezdeka, Florian
2022-05-25 13:03 ` Bezdeka, Florian
2022-05-25 13:04 ` Schmidl, Tobias
2022-05-25 13:08 ` Jan Kiszka
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=e14b46d8-8972-78eb-280d-3fab0705fe8e@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=joe.macdonald@siemens.com \
--cc=tobiasschmidl@siemens.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