public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2] In expand last partition wait for udev have finished
@ 2022-12-13 10:02 roberto.foglietta
  0 siblings, 0 replies; only message in thread
From: roberto.foglietta @ 2022-12-13 10:02 UTC (permalink / raw)
  To: isar-users; +Cc: roberto.foglietta

From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>

bugfix, expand last partition, wait for udev completion

On some hardware the udev did not created the links to the disk partitions
while this script is working thus it fails. This patch fixes that cases.

v2: as underlined by Tobias this script requires systemd-udevd.service and
it can safely runs only after that service has been started otherwise might
fail. This dependency will reorder the boot procedure but not slow down it
unless the hardware is slow to get mapped by udev but in that case resize
the last partition would have failed. Thus, no regression are expected.

Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
---
 .../expand-on-first-boot/files/expand-last-partition.sh         | 2 ++
 .../expand-on-first-boot/files/expand-on-first-boot.service     | 2 ++
 2 files changed, 4 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 57055cc..4d55645 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
@@ -9,6 +9,8 @@
 
 set -e
 
+udevadm settle
+
 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)
diff --git a/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
index fda5001..2c120c4 100644
--- a/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
+++ b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
@@ -7,7 +7,9 @@
 Description=Expand last partition
 DefaultDependencies=no
 Conflicts=shutdown.target
+Requires=systemd-udevd.service
 After=systemd-remount-fs.service
+After=systemd-udevd.service
 Before=local-fs-pre.target shutdown.target
 ConditionPathIsReadWrite=/etc
 
-- 
2.34.1


https://16F0H.trk.elasticemail.com/tracking/unsubscribe?d=q_kIGyOJgB5ctY2LrVKQFoWVVTXwBkuuDlwZYowLodqyXtsU-X2HAOBx1Rv6h0ZVk2ea8hHvOWQDQ9gI3kAT55VXnKtu2F0n5IcwTuZQRMRH0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-13 10:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13 10:02 [PATCH v2] In expand last partition wait for udev have finished roberto.foglietta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox