public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2 0/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs
@ 2022-05-30 11:37 Tobias Schmidl
  2022-05-30 11:37 ` [PATCH v2 1/1] " Tobias Schmidl
  0 siblings, 1 reply; 5+ messages in thread
From: Tobias Schmidl @ 2022-05-30 11:37 UTC (permalink / raw)
  To: isar-users; +Cc: Joe MacDonald, Tobias Schmidl

Diff to v1:
- Rewording on patch message ("root partition" --> "last partition",
  added note to systemd-dependency and its impact)
- Added systemd-version dependency
- Removed runtime if case that allowed for non-systemd systems

Tobias Schmidl (1):
  expand-on-first-boot: Switch from resize2fs to systemd-growfs

 .../expand-on-first-boot/expand-on-first-boot_1.1.bb   |  5 +++--
 .../files/expand-last-partition.sh                     | 10 ++++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)

-- 
2.36.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs
  2022-05-30 11:37 [PATCH v2 0/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs Tobias Schmidl
@ 2022-05-30 11:37 ` Tobias Schmidl
  2022-06-02 14:47   ` Henning Schild
  0 siblings, 1 reply; 5+ messages in thread
From: Tobias Schmidl @ 2022-05-30 11:37 UTC (permalink / raw)
  To: isar-users; +Cc: Joe MacDonald, Tobias Schmidl

We want to be more versatile in our approach of resizing the last
partition. Therefore we switch from resize2fs to systemd-growfs.

This allows for ext4, btrfs, xfs, and dm-crypt partitions to be resized.

Since systemd-growfs landed in v236, this obsoletes expand-on-first-boot
on stretch (v232).

Signed-off-by: Tobias Schmidl <tobiasschmidl@siemens.com>
---
 .../expand-on-first-boot/expand-on-first-boot_1.1.bb   |  5 +++--
 .../files/expand-last-partition.sh                     | 10 ++++++++--
 2 files changed, 11 insertions(+), 4 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..09ff234 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
@@ -1,15 +1,16 @@
 # Resize last partition to full medium size on fist boot
 #
 # This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2018
+# Copyright (c) Siemens AG, 2018-2022
 #
 # SPDX-License-Identifier: MIT
 
 inherit dpkg-raw
 
 DESCRIPTION = "This service grows the last partition to the full medium during first boot"
+MAINTAINER = "isar-users <isar-users@googlegroups.com>"
 
-DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs, fdisk, util-linux"
+DEBIAN_DEPENDS = "systemd (>=236), sed, grep, coreutils, mount, e2fsprogs, fdisk, util-linux"
 
 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 bb371e9..37e94ca 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
@@ -3,7 +3,7 @@
 # Resize last partition to full medium size
 #
 # This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2018
+# Copyright (c) Siemens AG, 2018-2022
 #
 # SPDX-License-Identifier: MIT
 
@@ -45,4 +45,10 @@ partx -u "${LAST_PART}"
 # when using systemd mount units.
 export EXT2FS_NO_MTAB_OK=1
 
-resize2fs "${LAST_PART}"
+MOUNT_POINT=$(findmnt "${LAST_PART}" -o target -n)
+if [ -z "$MOUNT_POINT" ]; then
+	echo "Cannot find mount point for ${LAST_PART}"
+	exit 1
+fi
+mount "${MOUNT_POINT}" || true
+/lib/systemd/systemd-growfs "${MOUNT_POINT}"
-- 
2.36.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs
  2022-05-30 11:37 ` [PATCH v2 1/1] " Tobias Schmidl
@ 2022-06-02 14:47   ` Henning Schild
  2022-06-02 16:26     ` Schmidl, Tobias
  0 siblings, 1 reply; 5+ messages in thread
From: Henning Schild @ 2022-06-02 14:47 UTC (permalink / raw)
  To: Tobias Schmidl; +Cc: isar-users, Joe MacDonald

Am Mon, 30 May 2022 13:37:37 +0200
schrieb Tobias Schmidl <tobiasschmidl@siemens.com>:

> We want to be more versatile in our approach of resizing the last
> partition. Therefore we switch from resize2fs to systemd-growfs.
> 
> This allows for ext4, btrfs, xfs, and dm-crypt partitions to be
> resized.
> 
> Since systemd-growfs landed in v236, this obsoletes
> expand-on-first-boot on stretch (v232).
> 
> Signed-off-by: Tobias Schmidl <tobiasschmidl@siemens.com>
> ---
>  .../expand-on-first-boot/expand-on-first-boot_1.1.bb   |  5 +++--
>  .../files/expand-last-partition.sh                     | 10
> ++++++++-- 2 files changed, 11 insertions(+), 4 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..09ff234 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
> @@ -1,15 +1,16 @@ # Resize last partition to full medium size on fist
> boot # # This software is a part of ISAR. -# Copyright (c) Siemens
> AG, 2018 +# Copyright (c) Siemens AG, 2018-2022
>  #
>  # SPDX-License-Identifier: MIT
>  
>  inherit dpkg-raw
>  
>  DESCRIPTION = "This service grows the last partition to the full
> medium during first boot" +MAINTAINER = "isar-users
> <isar-users@googlegroups.com>" 
> -DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs,

Maybe e2fsprogs can be dropped now? If not ... maybe we need to add
something here to really enable btrfs?

Henning

> fdisk, util-linux" +DEBIAN_DEPENDS = "systemd (>=236), sed, grep,
> coreutils, mount, e2fsprogs, fdisk, util-linux" 
>  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 bb371e9..37e94ca 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
> @@ -3,7 +3,7 @@ # Resize last partition to full medium size # # This
> software is a part of ISAR. -# Copyright (c) Siemens AG, 2018
> +# Copyright (c) Siemens AG, 2018-2022
>  #
>  # SPDX-License-Identifier: MIT
>  
> @@ -45,4 +45,10 @@ partx -u "${LAST_PART}"
>  # when using systemd mount units.
>  export EXT2FS_NO_MTAB_OK=1
>  
> -resize2fs "${LAST_PART}"
> +MOUNT_POINT=$(findmnt "${LAST_PART}" -o target -n)
> +if [ -z "$MOUNT_POINT" ]; then
> +	echo "Cannot find mount point for ${LAST_PART}"
> +	exit 1
> +fi
> +mount "${MOUNT_POINT}" || true
> +/lib/systemd/systemd-growfs "${MOUNT_POINT}"


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs
  2022-06-02 14:47   ` Henning Schild
@ 2022-06-02 16:26     ` Schmidl, Tobias
  2022-06-02 18:37       ` Henning Schild
  0 siblings, 1 reply; 5+ messages in thread
From: Schmidl, Tobias @ 2022-06-02 16:26 UTC (permalink / raw)
  To: Schild, Henning; +Cc: isar-users, joe.macdonald

Hi all,
> 

> > 
> >  .../expand-on-first-boot/expand-on-first-boot_1.1.bb   |  5 +++--
> >  .../files/expand-last-partition.sh                     | 10
> > ++++++++-- 2 files changed, 11 insertions(+), 4 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..09ff234 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
> > @@ -1,15 +1,16 @@ # Resize last partition to full medium size on fist
> > boot # # This software is a part of ISAR. -# Copyright (c) Siemens
> > AG, 2018 +# Copyright (c) Siemens AG, 2018-2022
> >  #
> >  # SPDX-License-Identifier: MIT
> >  
> >  inherit dpkg-raw
> >  
> >  DESCRIPTION = "This service grows the last partition to the full
> > medium during first boot" +MAINTAINER = "isar-users
> > <isar-users@googlegroups.com>" 
> > -DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs,
> 
> Maybe e2fsprogs can be dropped now? If not ... maybe we need to add
> something here to really enable btrfs?
> 
> 


while I'm on it, should I also do a version bump for the package to 1.2,
since there a lot of new stuff in it?

Kind regards,

Tobias

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs
  2022-06-02 16:26     ` Schmidl, Tobias
@ 2022-06-02 18:37       ` Henning Schild
  0 siblings, 0 replies; 5+ messages in thread
From: Henning Schild @ 2022-06-02 18:37 UTC (permalink / raw)
  To: Schmidl, Tobias (T CED SES-DE)
  Cc: isar-users, MacDonald, Joe (DI SW CAS ES EPT)

Am Thu, 2 Jun 2022 18:26:05 +0200
schrieb "Schmidl, Tobias (T CED SES-DE)" <tobiasschmidl@siemens.com>:

> Hi all,
> >   
> 
> > > 
> > >  .../expand-on-first-boot/expand-on-first-boot_1.1.bb   |  5 +++--
> > >  .../files/expand-last-partition.sh                     | 10
> > > ++++++++-- 2 files changed, 11 insertions(+), 4 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..09ff234 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
> > > @@ -1,15 +1,16 @@ # Resize last partition to full medium size on
> > > fist boot # # This software is a part of ISAR. -# Copyright (c)
> > > Siemens AG, 2018 +# Copyright (c) Siemens AG, 2018-2022
> > >  #
> > >  # SPDX-License-Identifier: MIT
> > >  
> > >  inherit dpkg-raw
> > >  
> > >  DESCRIPTION = "This service grows the last partition to the full
> > > medium during first boot" +MAINTAINER = "isar-users
> > > <isar-users@googlegroups.com>" 
> > > -DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount,
> > > e2fsprogs,  
> > 
> > Maybe e2fsprogs can be dropped now? If not ... maybe we need to add
> > something here to really enable btrfs?
> > 
> >   
> 
> 
> while I'm on it, should I also do a version bump for the package to
> 1.2, since there a lot of new stuff in it?

Very good point, yes please bump when you touch. Version is up to you
but 1.2 sounds good.

Henning

> Kind regards,
> 
> Tobias


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-02 18:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-30 11:37 [PATCH v2 0/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs Tobias Schmidl
2022-05-30 11:37 ` [PATCH v2 1/1] " Tobias Schmidl
2022-06-02 14:47   ` Henning Schild
2022-06-02 16:26     ` Schmidl, Tobias
2022-06-02 18:37       ` Henning Schild

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