From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7021952409904611328 X-Received: by 2002:a05:6512:3f28:: with SMTP id y40mr1118534lfa.499.1634926742698; Fri, 22 Oct 2021 11:19:02 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:b9c:: with SMTP id b28ls3511397lfv.3.gmail; Fri, 22 Oct 2021 11:19:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXsYT61k36u+2n2+lFVxX5LHlC6PBBJw5hy+592Cwy4/aUo/SRbC5stDgvyW+ukemOByAN X-Received: by 2002:ac2:5934:: with SMTP id v20mr1121536lfi.605.1634926741514; Fri, 22 Oct 2021 11:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634926741; cv=none; d=google.com; s=arc-20160816; b=lDNcusCJ0QuQav+kgOANaPk3eaFx+mj3bXcBc7Hueh2q0u8CkWCoHtXO3g0oacPm4T spz3PsC57R2pdlqVLbCuuPkPeZZaj/lzcf8Rzz0OyYGS38uLr48XYNGG7O4M9zUWOSbM aFkpFtiwexcw/kH0bvbWaF7dMfyP92jf6hI+eShoMVX3NKlZH7Gn5bwuIQF3nH/4GkDx 0sE1RVZHOhNHrUraIPfxloNf1I3SeknL761ivhoDPI22n2UIJctgxphKCZo8XeiTs6ir O7UE4+ko1kOEqm5Q2GbnQe8TRcEdUKzqOhwLtV/t77bB/2dk5B1YnqN8fRMcOvu2YU0W fL/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject; bh=JQto0xJ4pslGW04eOvyxYGij9/O3W9KlIrqKfxqTRNI=; b=sNkm5Mt1nm5n32POslb60nfIMH6XPgCVtUKdw/hffJ72iBYnCQcvbMlpzPUkAZTymk r7K4AJdYue8ALvYqOLQHBu3dbKVqVQVEL9wzJmtfwd9MF3BYxkvPpaokizfsH26Ecofs NLiWIPRVhubdWVrzC6GWWXg31m58gKahGuJN+kXKJqKgYYdyEtcaWMS9AzoOsHbPuomM KQUFKuwc8KIV81jevorV3e8kgom5kfcN6kWi/r2LkNxGP5XXlj8MQ81ERUtKfu7vkemd py70DPzh7/fS9soc6rLXzYivAgw2rSDL9UMtv/1O7ay3IAiads6yvyRHMlc0v3heNUad xfzQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@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 g28si520053lfv.3.2021.10.22.11.19.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Oct 2021 11:19:01 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@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 jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@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 goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id 19MIJ0Yi007969 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Oct 2021 20:19:00 +0200 Received: from [167.87.72.144] ([167.87.72.144]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 19MIJ0xZ006606; Fri, 22 Oct 2021 20:19:00 +0200 Subject: Re: [PATCH] expand-on-first-boot: support resizing a btrfs root To: Joe MacDonald , isar-users@googlegroups.com Cc: joe.macdonald@siemens.com References: <20211022180133.1606322-1-joe_macdonald@mentor.com> From: Jan Kiszka Message-ID: <18299964-6809-d6a0-0f90-3ec6a785695c@siemens.com> Date: Fri, 22 Oct 2021 20:19:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211022180133.1606322-1-joe_macdonald@mentor.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: iKCyuxC905Ee 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 appropriate typo: instead > circumstance allows everything to function as expected. > > Signed-off-by: Joe MacDonald > --- > .../files/expand-last-partition.sh | 17 ++++++++++++----- > 1 file changed, 12 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..23cfd86 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,15 @@ 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 / ;; Could we reformat this to use multiple line, like the block above? > + * ) exit 1 ;; > +esac > Good extension! Jan -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux