From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7114631008580796416 X-Received: by 2002:a05:6512:23a4:b0:47f:79df:2ea9 with SMTP id c36-20020a05651223a400b0047f79df2ea9mr27135700lfv.498.1657130333124; Wed, 06 Jul 2022 10:58:53 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ac2:5a41:0:b0:481:3963:1222 with SMTP id r1-20020ac25a41000000b0048139631222ls464276lfn.2.gmail; Wed, 06 Jul 2022 10:58:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sJyJc4xljnMySegf5WWB6mbbso4qivcRlN3NLpWYbfVFgDwGgrzX5qqU3VnSIwXUGiwqTR X-Received: by 2002:a05:6512:2185:b0:482:b4f0:f23 with SMTP id b5-20020a056512218500b00482b4f00f23mr11268970lft.31.1657130331777; Wed, 06 Jul 2022 10:58:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657130331; cv=none; d=google.com; s=arc-20160816; b=t4KO9RwDH1zub6v/sV4DWJQ2lUC375ryUlmxEsXszBwHe2U6wdp2QsbR9X3qSF+uYb Ik50sBFI9+MsBJkhxUsu5Dx9RJEXjjzmKe69R+ySFEHcLMHOryKfwty6wTcAiPiDBcS8 Y0ydEtelw3cunJlRSRws2IhDEl72zRtuaVdMjGm7Ss/LbOykRWPFPox222rcnmIsTUc8 OAkLn/IDss3DltHK0KMQ9SxCCe5CaunA+Xnz84ktY6S/ak0ayqv2HYUSqfua26KGqwOu b3qyEWVIPYNZWBfljseF4KhefX8tbxdcu+vj32tBqcWpvn14JvtwaG5SAdW4kea1Te1Q By8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:ironport-sdr; bh=xm4m3FroChgQxUvFijbyiGHlboPH0etHtBjemajAyM8=; b=rkBkkDWA6RhU2yf8kWV+OKBLZpALPxMPsq3LC0AVjZHqYXRd7OxHrktIQggKRp6Ncp lzB2mXlg/kYAymnnU8TQIklKueq9KfGZdOOCP2CR0uwU5axIceLPY5RI1CHEhh4Wae5p +ntha9UiiZImfbn3LfPX5OlW8Dqj9S9unK9bKOSg7NQALun8OVr6uE4EQMWin7gaaWle 19FWQm41WAvr+dHEVL1Y78Z4LDns5qSX+U8xmewJIqBOO7Ack9FruyKhQuGr3Or9MHPb Ho1ZWbUexYYv4ryTkwotfb+sYtEiuwkRWvfYJyTyxrpz4EtOEN32xLOo+kdF1cB24xPD JwWQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of joe_macdonald@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Joe_MacDonald@mentor.com Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com. [68.232.137.180]) by gmr-mx.google.com with ESMTPS id k10-20020ac24f0a000000b0047ad98bddbasi1739875lfr.0.2022.07.06.10.58.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jul 2022 10:58:51 -0700 (PDT) Received-SPF: pass (google.com: domain of joe_macdonald@mentor.com designates 68.232.137.180 as permitted sender) client-ip=68.232.137.180; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of joe_macdonald@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Joe_MacDonald@mentor.com X-IronPort-AV: E=Sophos;i="5.92,250,1650960000"; d="asc'?scan'208";a="78288588" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 06 Jul 2022 09:58:49 -0800 IronPort-SDR: JpYpqrUzB9qZik5OqYLBvJftq8HvUgahMgp0BdQ4m2YBVgYkvR5FRHiAlmEsXfELothRf/oyl7 TqkXRBhmmYQSwVQUKxGLiUMAfom2ta8Cmdzn0kKm5N0Dj4ojvzRBYSks0cTe2sFDZpLWJPPoem VSbhQdYboo2qjG3Ss/rCnCP6c8oE54NBDlCL/mab93nLfH4M15TxaXEv4RwFG12aUumqiAWwzk uJ6O+sam8FK+Pio8sKUXs7ZbEZfZILKl8t2TxJY4EcjhZlq6qYy5Q9qOQc+ZrvHi3q56iM5nk8 BE8= Date: Wed, 6 Jul 2022 13:58:45 -0400 From: Joe MacDonald To: Henning Schild CC: Tobias Schmidl , , Joe MacDonald Subject: Re: [PATCH v5 1/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs Message-ID: <20220706175845.GA8527@mentor.com> References: <20220630135531.717696-1-tobiasschmidl@siemens.com> <20220630135531.717696-2-tobiasschmidl@siemens.com> <20220630164124.GC26667@mentor.com> <20220701093328.6afb1538@md1za8fc.ad001.siemens.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pf9I7BMVVzbSWLtt" Content-Disposition: inline In-Reply-To: <20220701093328.6afb1538@md1za8fc.ad001.siemens.net> X-URL: http://github.com/joeythesaint/joe-s-common-environment/tree/master X-Configuration: git://github.com/joeythesaint/joe-s-common-environment.git User-Agent: Mutt/1.10.1 (2018-07-13) Return-Path: Joe_MacDonald@mentor.com X-TUID: Uw3/BJv9+1/2 --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [Re: [PATCH v5 1/1] expand-on-first-boot: Switch from resize2fs to systemd-= growfs] On 22.07.01 (Fri 09:33) Henning Schild wrote: > Am Thu, 30 Jun 2022 12:41:25 -0400 > schrieb Joe MacDonald : >=20 > > Only one minor observation that I should have made sooner (so if > > there are other changes that might warrant a v6, great, but otherwise > > I don't think it's necessary). > >=20 > > [[PATCH v5 1/1] expand-on-first-boot: Switch from resize2fs to > > systemd-growfs] On 22.06.30 (Thu 15:55) Tobias Schmidl wrote: > >=20 > > > We want to be more versatile in our approach of resizing the last > > > partition. Therefore we switch from resize2fs to systemd-growfs. > > >=20 > > > This allows for ext4, btrfs, xfs, and dm-crypt partitions to be > > > resized. > > >=20 > > > Since systemd-growfs landed in v236, this obsoletes > > > expand-on-first-boot on stretch (v232). > > >=20 > > > Signed-off-by: Tobias Schmidl > > > --- > > > ...oot_1.1.bb =3D> expand-on-first-boot_1.2.bb} | 5 +++-- > > > .../files/expand-last-partition.sh | 19 > > > +++++++++++++++++-- 2 files changed, 20 insertions(+), 4 > > > deletions(-) rename > > > meta/recipes-support/expand-on-first-boot/{expand-on-first-boot_1.1.bb > > > =3D> expand-on-first-boot_1.2.bb} (78%) > > >=20 > > > 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 > > > =20 > > > inherit dpkg-raw > > > =20 > > > DESCRIPTION =3D "This service grows the last partition to the full > > > medium during first boot" +MAINTAINER =3D "isar-users > > > "=20 > > > -DEBIAN_DEPENDS =3D "systemd, sed, grep, coreutils, mount, e2fsprogs, > > > fdisk, util-linux" +DEBIAN_DEPENDS =3D "systemd (>=3D236), sed, grep, > > > coreutils, mount, fdisk, util-linux"=20 > > > SRC_URI =3D " \ > > > file://expand-on-first-boot.service \ > > > diff --git > > > a/meta/recipes-support/expand-on-first-boot/files/expand-last-partiti= on.sh > > > b/meta/recipes-support/expand-on-first-boot/files/expand-last-partiti= on.sh > > > index c0edde7..31f1ae3 100755 --- > > > a/meta/recipes-support/expand-on-first-boot/files/expand-last-partiti= on.sh > > > +++ > > > b/meta/recipes-support/expand-on-first-boot/files/expand-last-partiti= on.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 > > > =20 > > > @@ -45,4 +45,19 @@ partx -u "${LAST_PART}" > > > # when using systemd mount units. > > > export EXT2FS_NO_MTAB_OK=3D1 > > > =20 > > > -resize2fs "${LAST_PART}" > > > +if grep -q x-systemd.growfs /etc/fstab; then > > > + echo "Found x-systemd.growfs option in /etc/fstab, won't > > > call it explicitly." >&2 > > > + exit 0 > > > +fi > > > + > > > +# mount $LAST_PART out of tree, so we won't conflict with other > > > mounts +MOUNT_POINT=3D$(mktemp -d -p /mnt "$(basename > > > "$0").XXXXXXXXXX") +if [ ! -d "${MOUNT_POINT}" ]; then > > > + echo "Cannot create temporary mount point ${MOUNT_POINT}." > > > >&2 =20 > >=20 > > This error message may be a bit more helpful if it stated the impact > > of this problem. Something like this, instead: > >=20 > > echo "Cannot create temporary mount point ${MOUNT_POINT}, > > ${LAST_PART} will not be resized." >&2 >=20 > The script failing always has that result. In fact you end up in a > weird state where the partition has been grown and the filesystem has > not. Not sure this is needed. That's a good point. Actually, ideally we would roll back to the previous (probably consistent) state, but that's going to be a difficult thing to do safely, for sure! > Joe did you get a chance to try that all on your btrfs use-case? I know > Tobias tested that but getting a confirm that it works in other layers > would be cool. But we do not need such a confirm to continue, we assume > it will work in layers. I did not yet, but I keep intending to, it's just a matter of finding time to. Having watched the progression of the work, I would be very surprised if it does not, but I'll follow up here as soon as I get a chance to verify this one way or the other. -J. >=20 > Henning >=20 > > -J. > >=20 > > > + exit 1 > > > +fi > > > + > > > +mount "${LAST_PART}" "${MOUNT_POINT}" > > > +/lib/systemd/systemd-growfs "${MOUNT_POINT}" > > > +umount "${MOUNT_POINT}" > > > +rmdir "${MOUNT_POINT}" > > > --=20 > > > 2.36.1 > > > =20 > >=20 >=20 --=20 -Joe MacDonald. Linux Architect | Siemens Digital Industries Software :wq --pf9I7BMVVzbSWLtt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEkMd/b97HINT8/zEqSfx99yw59pYFAmLFzVIACgkQSfx99yw5 9pZwJwf/eSPZWde/Agw5nSyE+6f060WffPzDEGqVWxvy2mbB1TnDanACpyr1W9QV JYwjwiPuGAN1DzUqWwFSQD2Nu3V7scNpjTPHJEFyLlh6SLenW2elBgogmY3iLtHL E0IJzAY15Rzo+g0137OPVbLadbtZMYn/j1OkQztWbeW+HHui7ld8/3/G2RUNctW1 4h+fvSLvtRHiTxxEKEB4u1ddKsAcUkyRpROPBoV3ACDGYEJntQZZoGwpONOLmkCs HqM1yQPrIpK1HiOIQqYlwxpG33IUY+l7Svlfsm5yoIrYH9KB102TYy0i5hDtRh5N u5/q6NsPWcSvy5p+pwygwFml9JgRSQ== =T3Pt -----END PGP SIGNATURE----- --pf9I7BMVVzbSWLtt--