From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7021952409904611328 X-Received: by 2002:a1c:f319:: with SMTP id q25mr12209989wmq.33.1635150165400; Mon, 25 Oct 2021 01:22:45 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:8b92:: with SMTP id o18ls607742wra.0.gmail; Mon, 25 Oct 2021 01:22:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgxIewseLIne4JKZ0SbPrnk16d98hH0zJUv4RXgXJtjnOOzUArSexi6g1BuHeo8N+v0EBn X-Received: by 2002:a5d:63c2:: with SMTP id c2mr11469759wrw.174.1635150164447; Mon, 25 Oct 2021 01:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635150164; cv=none; d=google.com; s=arc-20160816; b=k9MN9Se+DlgZ3iA92ZniwU4t7D3/thO6mzbddPgnhxBQqq13nLU92dfmMa/41aBNYV zxMYZv2K2bHwbICHpZYgD1F4cXcN7+8toJRQmNPqgemMM5lpfkchGXY4gUxDj2PZxHzq 3XyhhvHdKndsxGYB96gR6OV6cy20lH1WoeHxkbwXvXzReUVpQ7xZp8GZdJj+TZjql+W4 75hqAX87JI2Q6gF/LyPppTyyYYc/LTYxwtuyGgA3YcIPTnd51kb+/6ukKPLsN43WbPgl pYdH1la/5sSOHM8CmVi/Qc+TyLIyvX8+2VVbnncEtY7xr86vOg68C+R8Xpm80mwp92uD 63Rw== 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=CoWsVuDxxvCgyV5eDJoUALUSoAuvDU+5VzF7N6YgjY0=; b=trAS093lo4Xlz5G3VIMyzIAnWYgkWCSR0qj5nocuxcWf0qNlaP2ofp96+ff8e+2IRr EIZidHNlIZRhTdJ44Pn7YQtrQbzxIkUdpWQkaKbRSRqOYLLeDZFaIedh0RY2gPbWov0x 8CxtHGAPFSUhYxKl+1JYx4GHhBZdCLfCKHTeZRHqVc/t/FdvkU3IXKGqCYOGKpgH07ze k3ZezIts2fI+W5iVN8DWzKhRP7fbKkXgXzZxGW1LHvZa/lTEvHPeEIwzAR6gUx0+RBXu vj1fWyV69q1GYdmkpz3dlh6W/pqy7k8xWUbWdHTwmVj4wNIKvpKAZtKio9+VRmwh9aMr FJLA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 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 goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id k39si144516wms.1.2021.10.25.01.22.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Oct 2021 01:22:44 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id 19P8MhTc017728 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Oct 2021 10:22:44 +0200 Received: from md1za8fc.ad001.siemens.net ([139.22.32.154]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 19P8MhM6019791; Mon, 25 Oct 2021 10:22:43 +0200 Date: Mon, 25 Oct 2021 10:22:40 +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: <20211025102240.427b8ad4@md1za8fc.ad001.siemens.net> In-Reply-To: <20211025101054.4455adca@md1za8fc.ad001.siemens.net> References: <18299964-6809-d6a0-0f90-3ec6a785695c@siemens.com> <20211022195047.262589-1-joe_macdonald@mentor.com> <20211025101054.4455adca@md1za8fc.ad001.siemens.net> 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: CJCt4PKDMpZo Am Mon, 25 Oct 2021 10:10:54 +0200 schrieb Henning Schild : > 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". It is in fact more complicated than that. The two "progs" should not both be depended on, because we would install too much stuff. We can not use "|" because we will not know which one we get. Say one was installed for any other reason, the one we need for rootfs might not get pulled in. Recommends would be better, but isar will not pull them. (still would be an idea to be "correct") We could also spit out two packages "expand-on-first-boot-ext|btrfs" but that does not scale well for the next fs to cover. So i would say "Recommends: e2fsprogs, btrfs-progs" and make that script "command -v" and cry. Maybe keeping e2fsprogs in a first patch, and removing it from Depends in a second interface-breaking patch. regards, Henning > > + ;; > > + * ) > > + echo "Unrecognized filesystem type ${ROOTFS_TYPE} - no resize > > performed" > > + exit 1 > > + ;; > > +esac >