From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
To: "Schaffner, Tobias" <tobias.schaffner@siemens.com>
Cc: "MOESSBAUER, FELIX JONATHAN" <felix.moessbauer@siemens.com>,
"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Subject: Re: [PATCH] In expand last partition wait for udev have finished
Date: Tue, 13 Dec 2022 11:03:23 +0100 [thread overview]
Message-ID: <CAJGKYO6_wc2-odVW0aQ_9yUGH3j3VdxwY6kymjx21br4sKPw8w@mail.gmail.com> (raw)
In-Reply-To: <17231259-4c30-c3bb-389b-bb10bd342c1f@siemens.com>
[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]
On Tue, 13 Dec 2022 at 09:44, Schaffner, Tobias
<tobias.schaffner@siemens.com> wrote:
>
> Hi Felix, hi Roberto,
>
> udev is started via systemd-udevd and this service might not be up
> yet when the script runs.
>
> Adding this line would only work reliably if we add
> Requires=systemd-udevd and After=systemd-udevd to the
> expand-on-first-boot.service
>
> But adding this dependency might obviously increase the boot time.
>
Hi Tobias,
I do not think that adding that dependency will increase the boot
time in general case but just changing the order of the operations.
However, in those hardware which the devices recognition is slow, then
the boot will slow down but probably are also those cases in which
the resize will fail. In fast hardware, I think that udevd is just
started before that script otherwise udevadm would have failed and the
script as well due to set -e. This because the systemd paralyse the
activities. At the moment, I am trying these changes on a virtual
machine and it is enough fast that the script with udevadm settle do
not fail nor slow down the boot in a noticeable way.
I sent the patch v2 with this dependency. Also here in attachment.
Thanks, R-
[-- Attachment #2: v2-0001-In-expand-last-partition-wait-for-udev-have-finis.patch --]
[-- Type: text/x-patch, Size: 2291 bytes --]
From b5e52d2b7f542b6ec3645ff59e43da9fdedb9a9f Mon Sep 17 00:00:00 2001
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
Date: Mon, 12 Dec 2022 21:14:26 +0100
Subject: [PATCH v2] In expand last partition wait for udev have finished
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
next prev parent reply other threads:[~2022-12-13 10:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 20:23 roberto.foglietta
2022-12-13 2:01 ` Moessbauer, Felix
2022-12-13 8:44 ` Schaffner, Tobias
2022-12-13 10:03 ` Roberto A. Foglietta [this message]
2022-12-12 20:33 Roberto A. Foglietta
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=CAJGKYO6_wc2-odVW0aQ_9yUGH3j3VdxwY6kymjx21br4sKPw8w@mail.gmail.com \
--to=roberto.foglietta@gmail.com \
--cc=felix.moessbauer@siemens.com \
--cc=isar-users@googlegroups.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