* [PATCH v3 0/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs
@ 2022-06-02 19:45 Tobias Schmidl
2022-06-02 19:46 ` [PATCH v3 1/1] " Tobias Schmidl
0 siblings, 1 reply; 5+ messages in thread
From: Tobias Schmidl @ 2022-06-02 19:45 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
Doff to v2:
- Version bump to v1.2
- Removed e2fsprogs as dependency
Tobias Schmidl (1):
expand-on-first-boot: Switch from resize2fs to systemd-growfs
...n-first-boot_1.1.bb => expand-on-first-boot_1.2.bb} | 5 +++--
.../files/expand-last-partition.sh | 10 ++++++++--
2 files changed, 11 insertions(+), 4 deletions(-)
rename meta/recipes-support/expand-on-first-boot/{expand-on-first-boot_1.1.bb => expand-on-first-boot_1.2.bb} (78%)
--
2.36.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3 1/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs
2022-06-02 19:45 [PATCH v3 0/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs Tobias Schmidl
@ 2022-06-02 19:46 ` Tobias Schmidl
2022-06-02 19:56 ` Henning Schild
0 siblings, 1 reply; 5+ messages in thread
From: Tobias Schmidl @ 2022-06-02 19:46 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>
---
...n-first-boot_1.1.bb => expand-on-first-boot_1.2.bb} | 5 +++--
.../files/expand-last-partition.sh | 10 ++++++++--
2 files changed, 11 insertions(+), 4 deletions(-)
rename meta/recipes-support/expand-on-first-boot/{expand-on-first-boot_1.1.bb => expand-on-first-boot_1.2.bb} (78%)
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.2.bb
similarity index 78%
rename from meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.1.bb
rename to meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.2.bb
index 1703a64..48d30d3 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.2.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, 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 v3 1/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs
2022-06-02 19:46 ` [PATCH v3 1/1] " Tobias Schmidl
@ 2022-06-02 19:56 ` Henning Schild
2022-06-03 6:48 ` Schmidl, Tobias
0 siblings, 1 reply; 5+ messages in thread
From: Henning Schild @ 2022-06-02 19:56 UTC (permalink / raw)
To: Tobias Schmidl; +Cc: isar-users, Joe MacDonald
Am Thu, 2 Jun 2022 21:46:00 +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.
LGTM!
We are missing resize test cases, we always have been. I assume you did
test all the filesystems listed here somehow manually.
At some point in the future we might really want those resize test
cases with several wks files to make sure it works and works for all
the filesystems we do care about. Probably extX and btrfs to start with.
Thanks!
Henning
> Since systemd-growfs landed in v236, this obsoletes
> expand-on-first-boot on stretch (v232).
>
> Signed-off-by: Tobias Schmidl <tobiasschmidl@siemens.com>
> ---
> ...n-first-boot_1.1.bb => expand-on-first-boot_1.2.bb} | 5 +++--
> .../files/expand-last-partition.sh | 10
> ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-)
> rename
> meta/recipes-support/expand-on-first-boot/{expand-on-first-boot_1.1.bb
> => expand-on-first-boot_1.2.bb} (78%)
>
> 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.2.bb
> similarity index 78% rename from
> meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.1.bb
> rename to
> meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.2.bb
> index 1703a64..48d30d3 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.2.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, 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 v3 1/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs
2022-06-02 19:56 ` Henning Schild
@ 2022-06-03 6:48 ` Schmidl, Tobias
2022-06-03 7:55 ` Moessbauer, Felix
0 siblings, 1 reply; 5+ messages in thread
From: Schmidl, Tobias @ 2022-06-03 6:48 UTC (permalink / raw)
To: isar-users; +Cc: joe.macdonald
Hi all,
Am Donnerstag, dem 02.06.2022 um 21:56 +0200 schrieb Henning Schild:
> Am Thu, 2 Jun 2022 21:46:00 +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.
>
> LGTM!
>
> We are missing resize test cases, we always have been. I assume you did
> test all the filesystems listed here somehow manually.
>
I did test with btrfs and ext4, on both root partition and additional
partition.
Kind regards,
Tobias
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH v3 1/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs
2022-06-03 6:48 ` Schmidl, Tobias
@ 2022-06-03 7:55 ` Moessbauer, Felix
0 siblings, 0 replies; 5+ messages in thread
From: Moessbauer, Felix @ 2022-06-03 7:55 UTC (permalink / raw)
To: Schmidl, Tobias, isar-users; +Cc: joe.macdonald
> -----Original Message-----
> From: isar-users@googlegroups.com <isar-users@googlegroups.com> On
> Behalf Of Schmidl, Tobias
> Sent: Friday, June 3, 2022 8:48 AM
> To: isar-users@googlegroups.com
> Cc: MacDonald, Joe (DI SW CAS ES EPT) <joe.macdonald@siemens.com>
> Subject: Re: [PATCH v3 1/1] expand-on-first-boot: Switch from resize2fs to
> systemd-growfs
>
> Hi all,
>
> Am Donnerstag, dem 02.06.2022 um 21:56 +0200 schrieb Henning Schild:
> > Am Thu, 2 Jun 2022 21:46:00 +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.
> >
> > LGTM!
> >
> > We are missing resize test cases, we always have been. I assume you
> > did test all the filesystems listed here somehow manually.
These kinds of tests currently cannot be added to the testsuite as they likely require mounting the partition.
For details, see the discussion on patches 4,5 of the "wic: Update to the latest revision" series.
IMO we should not spend too much time on writing CI tests for that until we have a proper testing infrastructure.
But this will also require some tools to be present on the host / the kas container.
It's more of a long term goal. I learned that the hard way...
Felix
> >
>
> I did test with btrfs and ext4, on both root partition and additional partition.
>
> Kind regards,
>
> Tobias
>
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrou
> ps.google.com%2Fd%2Fmsgid%2Fisar-
> users%2F9b00c86807b1c682cb21201f479031e6fe3e2844.camel%2540siemens
> .com&data=05%7C01%7Cfelix.moessbauer%40siemens.com%7Cb7f84f
> d5400e44f31a1a08da452d091b%7C38ae3bcd95794fd4addab42e1495d55a%7C
> 1%7C0%7C637898357688435689%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiM
> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000
> %7C%7C%7C&sdata=jaiFxftc%2B818u%2F71uSmFnI%2F2G1Jcr4hZY8FNi
> bCNZQ8%3D&reserved=0.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-06-03 7:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 19:45 [PATCH v3 0/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs Tobias Schmidl
2022-06-02 19:46 ` [PATCH v3 1/1] " Tobias Schmidl
2022-06-02 19:56 ` Henning Schild
2022-06-03 6:48 ` Schmidl, Tobias
2022-06-03 7:55 ` Moessbauer, Felix
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox