public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
To: isar-users@googlegroups.com
Subject: Fwd: [PATCH 1/1] expand last partition supports btrfs (inline 2nd version)
Date: Fri, 30 Sep 2022 13:34:33 +0200	[thread overview]
Message-ID: <CAJGKYO6QC9rLAwWNvSca79GrrvRP8KZ1kDDdSikg1E4SLMb6Pg@mail.gmail.com> (raw)
In-Reply-To: <CAJGKYO7qEk7rtBP3sKQ1bnsM3PVbrXAn=5eOnwbpb2vTiJ=JRQ@mail.gmail.com>

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

Change before the first version: rmdir /tmp/btrfs added to avoid polluting
/tmp here hand edited.

>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] 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

[-- Attachment #2: Type: text/html, Size: 4060 bytes --]

      parent reply	other threads:[~2022-09-30 11:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30  8:00 [PATCH 1/1] expand last partition supports btrfs (inline test) Roberto A. Foglietta
2022-09-30  8:56 ` Jan Kiszka
2022-09-30 10:23   ` Schmidl, Tobias
2022-09-30 10:39     ` Roberto A. Foglietta
2022-09-30 10:50       ` Bezdeka, Florian
2022-09-30 11:09         ` Roberto A. Foglietta
2022-09-30 11:17           ` Roberto A. Foglietta
2022-09-30 10:51     ` Henning Schild
2022-09-30 11:34 ` 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=CAJGKYO6QC9rLAwWNvSca79GrrvRP8KZ1kDDdSikg1E4SLMb6Pg@mail.gmail.com \
    --to=roberto.foglietta@gmail.com \
    --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