From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7021952409904611328 X-Received: by 2002:a05:6214:80c:: with SMTP id df12mr1124316qvb.4.1634925699668; Fri, 22 Oct 2021 11:01:39 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ac8:1e13:: with SMTP id n19ls5193759qtl.10.gmail; Fri, 22 Oct 2021 11:01:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUI/C61GHDA9J0k0xzWMx/XO93FNt72H6wgo6Nxo0scYeqQjWopIAOrgBE2HKV9m/IhW1U X-Received: by 2002:ac8:5b8c:: with SMTP id a12mr1533193qta.342.1634925697852; Fri, 22 Oct 2021 11:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634925697; cv=none; d=google.com; s=arc-20160816; b=R2MkbtXRn+nMK41D0jU+h+gwKwIQj5hMsUrRAwz+zmTEtbdIKC+1qOEUsSibcWR/j/ YEtLWy2vMJQWMpFtEqUUvgVr4Q2yZWhvAahOexvLr3K87VnVudDBkvMJEzegJB1hQyGb vA8mC2QXl8lSYeLcLyf0UBZn9dPFwZv/3C+B3Tq4umJ9ybHY1tRDuvwnwUFP5liIKPtb wLznAfEz3ir3hkCJEhLBDvzZ2CSs3H/rVKOGYyG8THY4AjRSmxx8fUWx7P2ZXM+kYC0s sN5LR63ZpZ9WIY7BDzWV/Wno/jLol93e9XQRlS9wFJrx5t7QSf/YUj7gIvduKUPR1DA2 3Mkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:dkim-signature; bh=0uR4LOOAa2O3PHDF/v1R0eBEfakSMsIE5OMEymmRyXw=; b=cGFxDYvhowbyeWCAPSv9WD/4kQCUNN+z8AVUPu1cK68xi0/FOuWzqTYOhf+maA8t/7 yLvL2+SNkkaAJXe1DphT+9zTDFCzLMD+xfB9k5zAHGLJdf+DylpDgG5w/JUkyCzXFmg0 yRlpxU5HH65YTQmGyVpus03WmuO2pn8d+mDtoioGCk/fRGN68Eo1hEuuO+pVsQemn0YP xxQEfw9O2mRkuFplGSvd2c79seGpU+7lsa+rQ8Pju/XZ/QqJ71mkVFWsN07JC0YFu/sb snxH0n/ayQKnMBwxZPXAnOGDprZTYsM4RvK+FpGtItDe58FyAaJvvD0xWNCr9udj2zjb eowg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HfDREOWR; spf=pass (google.com: domain of joe.macdonald@gmail.com designates 2607:f8b0:4864:20::629 as permitted sender) smtp.mailfrom=joe.macdonald@gmail.com Return-Path: Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com. [2607:f8b0:4864:20::629]) by gmr-mx.google.com with ESMTPS id n20si844736qtl.1.2021.10.22.11.01.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Oct 2021 11:01:37 -0700 (PDT) Received-SPF: pass (google.com: domain of joe.macdonald@gmail.com designates 2607:f8b0:4864:20::629 as permitted sender) client-ip=2607:f8b0:4864:20::629; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HfDREOWR; spf=pass (google.com: domain of joe.macdonald@gmail.com designates 2607:f8b0:4864:20::629 as permitted sender) smtp.mailfrom=joe.macdonald@gmail.com Received: by mail-pl1-x629.google.com with SMTP id y1so3271390plk.10 for ; Fri, 22 Oct 2021 11:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0uR4LOOAa2O3PHDF/v1R0eBEfakSMsIE5OMEymmRyXw=; b=HfDREOWRr2ZkbZ7QSimQ/VJxDPzBAWl/xGzkkVY8kVQooCNAQ+qXHX2ft7MHRfi4ma QG5zKUG+erHdeahtTdyMwLnkjK8MJWh2OtwLCAe2zBQRMKwzr3JLa2Uur9dHiOYKgEE3 JPUUQ4IE87ro0RXCLF63BvfK4V8iKnddr2h5Cq2q/VJIepkxWNdO23h1KGzLGm9IA2l7 rqRMB4m5CrTdhSNszaDx7IzNrFG1ze3i7k9ubKGWV3w8/L3YkyxQHWj0PYrHYHknzckB r251ag8kZlzkYgNtQwOr8zYihA11wvnbhDkR1dNbWVbvqmxP1JKQ7lEvTLjZa6JdMEK6 lHBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=0uR4LOOAa2O3PHDF/v1R0eBEfakSMsIE5OMEymmRyXw=; b=E921zAil28LPt0NTuwLkFVWAiLDEkB54q60EywmuF4rr7lsfBW50c0kd9soG+OZ3S5 zaZdb5SuRkudOWAIHoNfbvVEGDmecWX8tmOq7ExnTP4+0vj0E7w2ezt25u84odT0Tj3S lED7WXmEmVHSOQq1jn5KFNmgRXobtSC/c0tDLQ8+ONl7N/pcSTALP38BF3Xpcm352bn3 ailhaktjpK/N7oL+myym1xIrPDh1vuRhiEpckPk9ZLyeX1/93lt/h6Ltc/sfbMY93V/n 8oqndVOMNY5AtxsfjmpRe8Gvl4hcETZeXGQ8m4MFEd8CrjDSL6DcrInxlfenFNUdow9j FHOg== X-Gm-Message-State: AOAM532OXNtzcWVU3aoD7gcwE8YzJevL0ZhwzchYo6j78uZ0UgAPhJ+P ALcS1ZdM9XD9IFFNZhXw0zn/mfzDICoH/dOt X-Received: by 2002:a17:90a:6b4f:: with SMTP id x15mr16293354pjl.233.1634925696691; Fri, 22 Oct 2021 11:01:36 -0700 (PDT) Return-Path: Received: from burninator3.cal.mentorg.com (nat-mam.mentorg.com. [139.181.8.34]) by smtp.gmail.com with ESMTPSA id h22sm10153808pfc.116.2021.10.22.11.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 11:01:36 -0700 (PDT) Sender: Joe MacDonald From: Joe MacDonald To: isar-users@googlegroups.com Cc: joe.macdonald@siemens.com Subject: [PATCH] expand-on-first-boot: support resizing a btrfs root Date: Fri, 22 Oct 2021 14:01:33 -0400 Message-Id: <20211022180133.1606322-1-joe_macdonald@mentor.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: F/i0cgMeypEU 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 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 / ;; + * ) exit 1 ;; +esac -- 2.30.2