From: Gylstorff Quirin <quirin.gylstorff@siemens.com>
To: henning.schild@siemens.com, isar-users@googlegroups.com
Cc: Tobias Schaffner <tobias.schaffner@siemens.com>,
felix.moessbauer@siemens.com, jan.kiszka@siemens.com
Subject: Re: [PATCH] expand-on-first-boot: switch back away from systemd-growfs
Date: Wed, 14 Dec 2022 12:18:41 +0100 [thread overview]
Message-ID: <9adcbf0e-33c7-8b36-1095-eae5b6a3f485@siemens.com> (raw)
In-Reply-To: <20221209162237.13420-1-henning.schild@siemens.com>
On 12/9/22 17:22, henning.schild@siemens.com wrote:
> From: Henning Schild <henning.schild@siemens.com>
>
> systemd-growfs in some versions has runtime deps on symlinks created
> by udev and we have a race there that shows especially on smaller/slower
> devices.
> We had patches dealing with that but they ended up looking rather
> complex.
> The gain of systemd-growfs is potentially a bunch more filesystems. But
> we can add them as well in sort of a switch-case. We never used it the
> way it is intended because it did not really fit, so better not use it.
>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
> ...oot_1.2.bb => expand-on-first-boot_1.3.bb} | 0
> .../files/expand-last-partition.sh | 26 ++++---------------
> 2 files changed, 5 insertions(+), 21 deletions(-)
> rename meta/recipes-support/expand-on-first-boot/{expand-on-first-boot_1.2.bb => expand-on-first-boot_1.3.bb} (100%)
>
> diff --git a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.2.bb b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.3.bb
> similarity index 100%
> rename from meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.2.bb
> rename to meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.3.bb
> 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 57055ccdcbd8..93eddda2a3b7 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
> @@ -57,29 +57,13 @@ sfdisk -d "${BOOT_DEV}" 2>/dev/null | \
> # Inform the kernel about the partitioning change
> partx -u "${LAST_PART}"
>
> -# this is for debian stretch or systemd < 236
> -if [ ! -x /lib/systemd/systemd-growfs ]; then
> - # Do not fail resize2fs if no mtab entry is found, e.g.,
> - # when using systemd mount units.
> - export EXT2FS_NO_MTAB_OK=1
> -
> - resize2fs "${LAST_PART}"
> - exit 0
> -fi
> -
> if grep -q x-systemd.growfs /etc/fstab; then
> - echo "Found x-systemd.growfs option in /etc/fstab, won't call it explicitly." >&2
> + echo "Found x-systemd.growfs option in /etc/fstab, won't grow." >&2
> exit 0
> fi
>
> -# mount $LAST_PART out of tree, so we won't conflict with other mounts
> -MOUNT_POINT=$(mktemp -d -p /mnt "$(basename "$0").XXXXXXXXXX")
> -if [ ! -d "${MOUNT_POINT}" ]; then
> - echo "Cannot create temporary mount point ${MOUNT_POINT}." >&2
> - exit 1
> -fi
> +# Do not fail resize2fs if no mtab entry is found, e.g.,
> +# when using systemd mount units.
> +export EXT2FS_NO_MTAB_OK=1
>
> -mount "${LAST_PART}" "${MOUNT_POINT}"
> -/lib/systemd/systemd-growfs "${MOUNT_POINT}"
> -umount "${MOUNT_POINT}"
> -rmdir "${MOUNT_POINT}"
> +resize2fs "${LAST_PART}"
Tested with read-only rootfs. Looks good.
Quirin
next prev parent reply other threads:[~2022-12-14 11:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-09 16:22 henning.schild
2022-12-09 16:30 ` Henning Schild
2022-12-13 14:16 ` Schaffner, Tobias
2022-12-14 11:18 ` Gylstorff Quirin [this message]
2022-12-23 6:27 ` Anton Mikanovich
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=9adcbf0e-33c7-8b36-1095-eae5b6a3f485@siemens.com \
--to=quirin.gylstorff@siemens.com \
--cc=felix.moessbauer@siemens.com \
--cc=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
--cc=tobias.schaffner@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