From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7021952409904611328 X-Received: by 2002:a5d:564d:: with SMTP id j13mr21352936wrw.402.1635149458783; Mon, 25 Oct 2021 01:10:58 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:6b08:: with SMTP id v8ls562479wrw.3.gmail; Mon, 25 Oct 2021 01:10:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytuyAb+DLfIHZ8ih1D2+CWPbMtidMywgTxhwt1N1vj/B26aah2/SdwUgw/JE5VvPMHfAXq X-Received: by 2002:adf:c00d:: with SMTP id z13mr20958528wre.299.1635149457857; Mon, 25 Oct 2021 01:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635149457; cv=none; d=google.com; s=arc-20160816; b=yN8u43iX8mPbHDyA2t6g2V87um1XouysMTbjIVQln4nO2kvQMJTWLi5HodY0ZS8yU9 BFRXWEHnhneMq1GpvHYJXhveqbyx+Fr49B8/B0dgTlSCZ8MxvT4pBRpTksIszY/AR4kh lrt81ID6Rw3SaKdLJk1t6xwbHbH0HvQVzzPV0YsvHHmegSyOVu+KiB2e4xY7l0Zl9G+k I8GOrXjOeOQe+QanIcRY1Ti9tV7Lc6XB0Br51g3mAk76CTQYfGPnks5Qtiln+NdJh+pC 2rcIB1xlTNKjJ/a46jsoq70d/JYBWhlAnS7bMnAT5M0Xp6WIbBeqgzHFTVwu2hLUpKXR f2pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=yMsQd3h9b6nVC0/nMFaA6j7xiZwgG0nHIxDO0sE96cM=; b=KVv/lY2ohEF7f51EqQZD6zujr25zujNf6nnzKovjVJoKAPAZJxpEa+3lAGIVVTDIsN V6PfRaII7666nYjCvy/CIhHJNknxy4pZ4NOhYoopLXrh3xIJfGI/phIS5WBLXL4MD+Fz UUERiYYDEC8z44W0hTvarohRatFTRKB18GhMETrxRF3OmdzpIssPjTwJ2T6/A+0W97Jt wljM2MHaUy8WFLdQJgAOD9CU1Pgx1pvS2LQzCBIO9WbwA+4L0RmA2YuDpIgpacWxui6y ONZ17FtB5hYL2PlFr+mCxKwtDyN8DsWC2ZMdeKciS/Md3ZOeBK9KT7foEaF4vOoZRFfN g/5g== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id a10si1087162wmb.0.2021.10.25.01.10.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Oct 2021 01:10:57 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 19P8AvEJ013057 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Oct 2021 10:10:57 +0200 Received: from md1za8fc.ad001.siemens.net ([139.22.32.154]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 19P8AuXR010398; Mon, 25 Oct 2021 10:10:57 +0200 Date: Mon, 25 Oct 2021 10:10:54 +0200 From: Henning Schild To: Joe MacDonald Cc: isar-users@googlegroups.com, joe.macdonald@siemens.com Subject: Re: [PATCH v2] expand-on-first-boot: support resizing a btrfs root Message-ID: <20211025101054.4455adca@md1za8fc.ad001.siemens.net> In-Reply-To: <20211022195047.262589-1-joe_macdonald@mentor.com> References: <18299964-6809-d6a0-0f90-3ec6a785695c@siemens.com> <20211022195047.262589-1-joe_macdonald@mentor.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: ozOfNTBFQwZA Yes, good addition! But it would be even better if we had it running in CI. We could switch one target over to btrfs by providing an example wks file, one that boots an image in qemu. That way we would have a btrfs example in the tree and get confident that wic will do things as i would hope for. Am Fri, 22 Oct 2021 15:50:47 -0400 schrieb Joe MacDonald : > 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` instead of `resize2fs` in the > appropriate circumstance allows everything to function as expected. > > Signed-off-by: Joe MacDonald > --- > .../files/expand-last-partition.sh | 22 > ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) > > 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 7175dfd..6975d9c 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 > @@ -36,8 +36,20 @@ sfdisk -d "${BOOT_DEV}" 2>/dev/null | \ # Inform > the kernel about the partitioning change partx -u "${LAST_PART}" -# > Do not fail resize2fs if no mtab entry is found, e.g., -# when using > systemd mount units. -export EXT2FS_NO_MTAB_OK=1 > - > -resize2fs "${LAST_PART}" > +# Determine the filesystem type and perform the appropriate resize > function +ROOTFS_TYPE=$(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=1 > + resize2fs "${LAST_PART}" > + ;; > + btrfs ) > + btrfs filesystem resize max / Need to do something to "DEBIAN_DEPENDS", maybe "e2fsprogs" -> "e2fsprogs | btrfs-progs". > + ;; > + * ) > + echo "Unrecognized filesystem type ${ROOTFS_TYPE} - no resize > performed" > + exit 1 > + ;; > +esac