From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7021952409904611328 X-Received: by 2002:adf:fd8a:: with SMTP id d10mr2246883wrr.213.1634932223469; Fri, 22 Oct 2021 12:50:23 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:ef8b:: with SMTP id d11ls753740wro.2.gmail; Fri, 22 Oct 2021 12:50:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYhziJkm/c/iNfXJjf8GQw2w8TM75FVvH00iGjh7PqhrSBoyhM3uh380gPz4+ZlMxc0Ci0 X-Received: by 2002:adf:9b97:: with SMTP id d23mr2224421wrc.135.1634932222435; Fri, 22 Oct 2021 12:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634932222; cv=none; d=google.com; s=arc-20160816; b=t3rJOqhNzA3OBpzFUjFnK8H42G0+7K0B6lEgz6aYiz5ar+64tV+pdYl+VGnAWEh2ml drUzJqiOeMTJ3FVZ3gjbHB+b9M+O3U5SopeAIzJCpnt9j6UybIi9KcDJgYYI28fkFoZi yjED+xpYyBi7C8UTM5814aciw7HITbjhfjvO+oYAggx15KJGlTgPAlzhdq25/fiCeHsC p+OkGjPyiLq/DqymtP67hGkpvEfogArfuP6aZyAXLfc3czaBgUT5FnymCy1yI08rA/2b 2AcdSbatwfWzBiee1KyIei2bVxKCqjewSUGIMRUK0G8CgrpaTe6RSvUK4MB4ajAFTL6Y WYeA== 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:ironport-sdr; bh=WE7btjmO4Yx/Z2rggk919BMWCXruAdXlsz9HULwanFM=; b=JIjeu7RFshBPjE+NJaEuofg10/lQpNOuJVy1CK4vPfMQjrzDFQvFxbZHI77Jng0y63 k+e/dlvHtVqzx2YZSZtZgHYIAlTezaHMG9w679KFz7tFV/n6wwcLhElqH3zpV9aeJAFC 6+v9JXtLGZemL9IULX7oxm5tmkdYqWMyOrhe35WV4x29MLrn61iN5MPIuJYWST0/Ouwu WOCJPHO3aymZNhwjOhxuG4Ieyh73YhMA/TNjac28wbF7De2WdkFA0eHQdhuOpq539Adg WMGsMMor7BHC2HgXLZUi704NTcg8lhu7Pw/tuG5neQCDrDqG5/cBcPifzNnsgT5igzJb o1Hg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of joe_macdonald@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Joe_MacDonald@mentor.com Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com. [68.232.137.252]) by gmr-mx.google.com with ESMTPS id h11si603656wrs.3.2021.10.22.12.50.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Oct 2021 12:50:22 -0700 (PDT) Received-SPF: pass (google.com: domain of joe_macdonald@mentor.com designates 68.232.137.252 as permitted sender) client-ip=68.232.137.252; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of joe_macdonald@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Joe_MacDonald@mentor.com IronPort-SDR: UcMvg7M+mMO7nUMVQNIFreVu93rXaHswWLfIDySHCmkWNrWlpEaKwKiiM1+FQg4/7X64HWJAEw ELsv9KywA4iYoZnYZSr8XM55qG20fDCMRfajFHG390Mc/qrSZLyKXRzIUHXqniFiBc5LS+1dPL kNtF7/wjPhYpht74cw5zWrDbOB0K26HbL5ib9tbQgO1gkNCb/4ffre+kH2o3TU5lEKSV24h3Ol i3bu9Q2xxn+Si8gpytE/jWjksGVkkmulTeapsaSdDhzKKbNRX8R0afjSuFcKSFaU3pV6gLQX8E fS540j7amnqwSwvkx6WjmMVm X-IronPort-AV: E=Sophos;i="5.87,173,1631606400"; d="asc'?scan'208";a="67538678" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 22 Oct 2021 11:50:20 -0800 IronPort-SDR: RLwBgqu9Q0cfC4DkKft6GHmOFil5nob/m2gKnZft6ySwpP11vpoT3KnQMupepT6yONr7PC+00U VGTV9xaxmj4VpCYZP4zXama1Fheb3Wevlre+6ivUrRBohH7LTa0WO4lrOgFINlnbFw5dgyWAZU SBzLiC22Rx2dSCOu50iaSpttdpozAu1JhG0IWK3jIT/9VOSFIlfhiLCxkxDevUpFafTS9t63Eu Vu4jivbVjtmGK408J4tRfkhLEfv/xvSYutCz+yfHHARfasRs0+ZuVAbBD/+4TtXcD9QKDCqX+R myo= Date: Fri, 22 Oct 2021 15:50:16 -0400 From: Joe MacDonald To: Jan Kiszka CC: , Subject: Re: [PATCH] expand-on-first-boot: support resizing a btrfs root Message-ID: <20211022195015.GA22113@mentor.com> References: <20211022180133.1606322-1-joe_macdonald@mentor.com> <18299964-6809-d6a0-0f90-3ec6a785695c@siemens.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vkogqOf2sHV7VnPd" Content-Disposition: inline In-Reply-To: <18299964-6809-d6a0-0f90-3ec6a785695c@siemens.com> 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: MgWg545DYkCy --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [Re: [PATCH] expand-on-first-boot: support resizing a btrfs root] On 21.10.= 22 (Fri 20:19) Jan Kiszka wrote: > On 22.10.21 20:01, Joe MacDonald wrote: > > resize2fs fails if the build sets the root filesystem for an image to > > btrfs though the partition is expanded properly. Since the rest of the > > script works as intended, simply checking the last partition type with > > lsblk and adding `btrfs resize` instaed of `resize2fs` in the appropria= te >=20 > typo: instead Oop, fixed. Thanks. > > circumstance allows everything to function as expected. > >=20 > > Signed-off-by: Joe MacDonald > > --- > > .../files/expand-last-partition.sh | 17 ++++++++++++----- > > 1 file changed, 12 insertions(+), 5 deletions(-) > >=20 > > diff --git a/meta/recipes-support/expand-on-first-boot/files/expand-las= t-partition.sh b/meta/recipes-support/expand-on-first-boot/files/expand-las= t-partition.sh > > index 7175dfd..23cfd86 100755 > > --- a/meta/recipes-support/expand-on-first-boot/files/expand-last-parti= tion.sh > > +++ b/meta/recipes-support/expand-on-first-boot/files/expand-last-parti= tion.sh > > @@ -36,8 +36,15 @@ sfdisk -d "${BOOT_DEV}" 2>/dev/null | \ > > # Inform the kernel about the partitioning change > > partx -u "${LAST_PART}" > > =20 > > -# Do not fail resize2fs if no mtab entry is found, e.g., > > -# when using systemd mount units. > > -export EXT2FS_NO_MTAB_OK=3D1 > > - > > -resize2fs "${LAST_PART}" > > +# Determine the filesystem type and perform the appropriate resize fun= ction > > +ROOTFS_TYPE=3D$(lsblk -fno FSTYPE ${ROOT_DEV}) > > +case ${ROOTFS_TYPE} in > > + ext* ) > > + # Do not fail resize2fs if no mtab entry is found, e.g., > > + # when using systemd mount units. > > + export EXT2FS_NO_MTAB_OK=3D1 > > + resize2fs "${LAST_PART}" > > + ;; > > + btrfs ) btrfs filesystem resize max / ;; >=20 > Could we reformat this to use multiple line, like the block above? Yes, good suggestion. v2 also includes an informational message on the fall-through condition rather than silently exiting with a failure. -Joe. >=20 > > + * ) exit 1 ;; > > +esac > >=20 >=20 > Good extension! >=20 > Jan >=20 > --=20 > Siemens AG, T RDA IOT > Corporate Competence Center Embedded Linux --=20 -Joe MacDonald. Linux Architect | Mentor=AE A Siemens Business :wq --vkogqOf2sHV7VnPd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEkMd/b97HINT8/zEqSfx99yw59pYFAmFzFfcACgkQSfx99yw5 9pZ1Kgf/WVKhAXyHJFz/6ARgNyQurGZbSXtXYw8RIkpUQu7rcaDOPcUKwNiFr6MX vxlxhBn4GCmBrYQnUpZ6LF0GENjUF37dbKriRv/WKoMdIb7eMe+DGHbOJzOhcukz G3wOlrLnqNTEPIWhysupVnklvQ+qNwOxBQvUkPRnAT3QutuETIXbn5W2LfEm+oZq 9JUkR5qRj9bL2EL2Ax3M47vS9CuQ8AVY6S+IokxY0/VnOw/uhOh6IyBc67wSfaMo idvB8UinaRXj5h5n5+fXTFdnMQ3VbWztUShRx2A8mWb6EgkFnm8gkjDCh6Hg94l5 K5+xnYww9VOtSEiK2Wj7afJVFuVB4w== =Q5HR -----END PGP SIGNATURE----- --vkogqOf2sHV7VnPd--