public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] expand-on-first-boot: switch back away from systemd-growfs
@ 2022-12-09 16:22 henning.schild
  2022-12-09 16:30 ` Henning Schild
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: henning.schild @ 2022-12-09 16:22 UTC (permalink / raw)
  To: isar-users; +Cc: Tobias Schaffner, felix.moessbauer, jan.kiszka, Henning Schild

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}"
-- 
2.37.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-23  6:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 16:22 [PATCH] expand-on-first-boot: switch back away from systemd-growfs henning.schild
2022-12-09 16:30 ` Henning Schild
2022-12-13 14:16 ` Schaffner, Tobias
2022-12-14 11:18 ` Gylstorff Quirin
2022-12-23  6: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