public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
To: Henning Schild <henning.schild@siemens.com>
Cc: "T. Schaffner" <tobias.schaffner@siemens.com>,
	isar-users@googlegroups.com,  felix.moessbauer@siemens.com,
	jan.kiszka@siemens.com
Subject: Re: [PATCH v3 1/1] expand-on-first-boot: wait for udev to create symlink
Date: Fri, 9 Dec 2022 18:23:12 +0100	[thread overview]
Message-ID: <CAJGKYO4k0bor2W70tYuJxO94Bg8h1i7NwmDRG4hmC-owDsqOpw@mail.gmail.com> (raw)
In-Reply-To: <20221209145752.0597a256@md1za8fc.ad001.siemens.net>

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

On Fri, 9 Dec 2022 at 14:58, Henning Schild <henning.schild@siemens.com> wrote:
>
> I propose to go back to resize2fs and add btrfs support with a
> switch-case. Still the whole story told us how repart/growfs can be used
> and we now have the wic patches needed for that and the bail-outs so
> the two methods do not start conflicting. We just did not manage to
> write a generic isar helper package.

In such a case, please give a second chance at this patch I submitted
to add btrfs to last partition growth

https://groups.google.com/g/isar-users/c/dxVJqRvnWjw/m/Y5g5mbIPBQAJ

In a positive case, I can manage to deliver a further version of it
more suitable

Best regards, R-

[-- Attachment #2: 0001-expand-last-partition-btrfs-support-added.patch --]
[-- Type: text/x-patch, Size: 1936 bytes --]

From 67c4ea67ac96276c5ec0e6b15d035543b99b8e04 Mon Sep 17 00:00:00 2001
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
Date: Thu, 29 Sep 2022 15:36:48 +0000
Subject: [PATCH v2] expand last partition btrfs support added

improvement, expand-on-first-boot: support for btrfs added

Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
---
 .../expand-on-first-boot/expand-on-first-boot_1.1.bb       | 2 +-
 .../expand-on-first-boot/files/expand-last-partition.sh    | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.1.bb b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.1.bb
index 1703a64..d41dd83 100644
--- a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.1.bb
+++ b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.1.bb
@@ -9,7 +9,7 @@ inherit dpkg-raw
 
 DESCRIPTION = "This service grows the last partition to the full medium during first boot"
 
-DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs, fdisk, util-linux"
+DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs, fdisk, util-linux, btrfs-progs"
 
 SRC_URI = " \
     file://expand-on-first-boot.service \
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 759ff8b..5b73dc4 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
@@ -61,4 +61,9 @@ partx -u "${LAST_PART}"
 # when using systemd mount units.
 export EXT2FS_NO_MTAB_OK=1
 
-resize2fs "${LAST_PART}"
+if ! resize2fs "${LAST_PART}"; then
+	mkdir -p /tmp/btrfs
+	mount "${LAST_PART}" /tmp/btrfs
+	btrfs filesystem resize max /tmp/btrfs
+	umount /tmp/btrfs && rmdir /tmp/btrfs
+fi
-- 
2.30.2


      parent reply	other threads:[~2022-12-09 17:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09 11:24 [PATCH v3 0/1] " T. Schaffner
2022-12-09 11:24 ` [PATCH v3 1/1] " T. Schaffner
2022-12-09 11:56   ` Jan Kiszka
2022-12-09 13:57   ` Henning Schild
2022-12-09 15:11     ` Schaffner, Tobias
2022-12-09 17:23     ` Roberto A. Foglietta [this message]

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=CAJGKYO4k0bor2W70tYuJxO94Bg8h1i7NwmDRG4hmC-owDsqOpw@mail.gmail.com \
    --to=roberto.foglietta@gmail.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