From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: Re: [PATCHSET] expand last partition script and its usage
Date: Thu, 15 Dec 2022 19:27:46 +0100 [thread overview]
Message-ID: <CAJGKYO4KOXao5TRxDtOwDZDSn8H5kMwirZBWYQ=1CBE4a60Chg@mail.gmail.com> (raw)
In-Reply-To: <CAJGKYO58T1LZLMJ84+oLF3b6CtJcfEwz97=WGDcrWCanX+5HVA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 450 bytes --]
On Thu, 15 Dec 2022 at 19:06, Roberto A. Foglietta
<roberto.foglietta@gmail.com> wrote:
>
> Hi all,
>
> all these patches are just sent by elastic mail SMTP and they are
> waiting in moderation.
>
> * 9ab1ca3 - In expand last partition few improvements and a bugfix
Version 2 of the last patch
* 082d8af - In expand last partition few improvements and a bugfix
I forgot to mention Henning on which code I took inspiration from.
Best regards, R-
[-- Attachment #2: v2-0001-In-expand-last-partition-wait-for-udev-have-finis.patch --]
[-- Type: text/x-patch, Size: 2295 bytes --]
From d3aded1198e598b2c0612f2c0528c6aab26d98c2 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 1/7] 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-15 18:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-15 18:06 Roberto A. Foglietta
2022-12-15 18:27 ` Roberto A. Foglietta [this message]
2022-12-15 23:00 ` Roberto A. Foglietta
2022-12-16 8:14 ` Roberto A. Foglietta
2022-12-16 11:38 ` Roberto A. Foglietta
2022-12-18 13:50 ` 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='CAJGKYO4KOXao5TRxDtOwDZDSn8H5kMwirZBWYQ=1CBE4a60Chg@mail.gmail.com' \
--to=roberto.foglietta@gmail.com \
--cc=amikan@ilbers.de \
--cc=isar-users@googlegroups.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