From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7175355899708440576 X-Received: by 2002:a05:6870:f810:b0:144:ab2e:7b81 with SMTP id fr16-20020a056870f81000b00144ab2e7b81mr8319403oab.131.1670642732866; Fri, 09 Dec 2022 19:25:32 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6808:8c2:b0:35a:8063:d38b with SMTP id k2-20020a05680808c200b0035a8063d38bls2727805oij.11.-pod-prod-gmail; Fri, 09 Dec 2022 19:25:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf4qycekT0TAkelLBP/xtjXfIIhDDM21QM4/5WYU1HdUcdKuWA+RKWpHLesEKjZtO6ygUj2D X-Received: by 2002:aca:f057:0:b0:35b:dea6:18fa with SMTP id o84-20020acaf057000000b0035bdea618famr3420861oih.36.1670642732102; Fri, 09 Dec 2022 19:25:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670642732; cv=none; d=google.com; s=arc-20160816; b=rBWTsp1mWdeMsbBzBUXaQAHNmj1xA72kFeg1TCX+jkMjNGRCR7S6RuQOdjs7Kr4EKj +6oDa8zCWLmQ5fxnbZuuGzKj3IWzaVlJjoc3sXLiqHVUh2AnWDr2m4BrVRwtmZ3LA0/k MjibQI9hX9CTuUutXtjgsPB5Jj5nSI2bmExfrXU7uI3YLOmH/qLsT/ClFv59/VnzCRFg AsN6M3jBXilPjL5U+u6FsgKCu9s25JEli7hO88hBll/hkD4Lbaom1RPYHxO77jAsGpeG RuOKTAtXMR5UW3XtPIIpJ1l2Uwn6Ehzdi1cznXufxv9kcQE3ibgNJ8xEF3LDHShPJXiu ianA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe:cc:to :reply-to:message-id:subject:date:from; bh=RDugC8OTy031mhKLS1g3pPhxeZ4b0fQ7Hok7TXbBnC8=; b=js/v9mfCHT14CnKjjchQoW8GBPg5zYvW1xFE8wSIR+j/BBR/qJcU7fd1cvzea8CXRC FPjkwIW/ohql2KWEJHKYPwahZ1BR8mazxDfIeSi/8tIuuZxx9zfwnSnkZKn3QWVdR9Ps vkpOOVoxpXACzzXTDXP9c+yoj9hUrVdENIZMf/fJJhvcBZ1eAfDQV9ashPdf552ckNJi B5AhSVMoEhaCKf0ktH4TtNmDDVe9Wt82v0l+usx8Z9w6qT++xlYtcqfMz0kQR8ImvMt6 6cyp6QNvl859tByn7BXyT82a8UVQj54j/ye3KXwJeOwjD+C+AfeY1U5wVEeS7GhaBXSG 4F3A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of bounces+228zzwbxcygtbwvc45qhua2@bounces.elasticemail.net designates 216.169.99.117 as permitted sender) smtp.mailfrom=bounces+228ZZWBxcYgtbWVc45qhuA2@bounces.elasticemail.net; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from pn117.mxout.mta2.net (pn117.mxout.mta2.net. [216.169.99.117]) by gmr-mx.google.com with ESMTPS id 184-20020aca05c1000000b0035c06b99516si323422oif.3.2022.12.09.19.25.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Dec 2022 19:25:32 -0800 (PST) Received-SPF: pass (google.com: domain of bounces+228zzwbxcygtbwvc45qhua2@bounces.elasticemail.net designates 216.169.99.117 as permitted sender) client-ip=216.169.99.117; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of bounces+228zzwbxcygtbwvc45qhua2@bounces.elasticemail.net designates 216.169.99.117 as permitted sender) smtp.mailfrom=bounces+228ZZWBxcYgtbWVc45qhuA2@bounces.elasticemail.net; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com From: roberto.foglietta@gmail.com Date: Sat, 10 Dec 2022 03:25:30 +0000 Subject: [PATCH] In expand last partition script btrfs support added Message-Id: <4uim8pt450zx.228ZZWBxcYgtbWVc45qhuA2@16F0H.trk.elasticemail.com> Reply-To: roberto.foglietta@gmail.com To: isar-users@googlegroups.com Cc: roberto.foglietta@gmail.com List-Unsubscribe: =?us-ascii?q?=3Cmailto=3Aunsubscribe+228ZZWBxcYgtbWVc45qhuA2=40bounces=2Eelasticem?= =?us-ascii?q?ail=2Enet=3Fsubject=3Dunsubscribe=3E=2C?= =?us-ascii?q?_=3Chttp=3A=2F=2F16F0H=2Etrk=2Eelasticemail=2Ecom=2Ftracking=2Funsubscribe=3Fmsgid?= =?us-ascii?q?=3D228ZZWBxcYgtbWVc45qhuA2&c=3D1588198146759178339=3E?= X-Msg-EID: 228ZZWBxcYgtbWVc45qhuA2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-TUID: A+i/Q0N9wQaP From: "Roberto A. Foglietta" improvement, expand-on-first-boot: support for btrfs added Signed-off-by: Roberto A. Foglietta --- .../expand-on-first-boot_1.2.bb | 2 +- .../files/expand-last-partition.sh | 37 ++++++------------- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.2.bb b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.2.bb index 0996000..fe7b72b 100644 --- a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.2.bb +++ b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.2.bb @@ -10,7 +10,7 @@ inherit dpkg-raw DESCRIPTION = "This service grows the last partition to the full medium during first boot" MAINTAINER = "isar-users " -DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs, fdisk (>=2.29.2-3) | util-linux (<2.29.2-3), util-linux" +DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs, fdisk (>=2.29.2-3) | util-linux (<2.29.2-3), util-linux, btrfs-progs" SRC_URI = " \ file://expand-on-first-boot.service \ 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 57055cc..acfef8a 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 @@ -57,29 +57,16 @@ sfdisk -d "${BOOT_DEV}" 2>/dev/null | \ # Inform the kernel about the partitioning change partx -u "${LAST_PART}" -# this is for debian stretch or systemd < 236 -if [ ! -x /lib/systemd/systemd-growfs ]; then - # Do not fail resize2fs if no mtab entry is found, e.g., - # when using systemd mount units. - export EXT2FS_NO_MTAB_OK=1 +# 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}" - exit 0 -fi - -if grep -q x-systemd.growfs /etc/fstab; then - echo "Found x-systemd.growfs option in /etc/fstab, won't call it explicitly." >&2 - exit 0 -fi - -# mount $LAST_PART out of tree, so we won't conflict with other mounts -MOUNT_POINT=$(mktemp -d -p /mnt "$(basename "$0").XXXXXXXXXX") -if [ ! -d "${MOUNT_POINT}" ]; then - echo "Cannot create temporary mount point ${MOUNT_POINT}." >&2 - exit 1 -fi - -mount "${LAST_PART}" "${MOUNT_POINT}" -/lib/systemd/systemd-growfs "${MOUNT_POINT}" -umount "${MOUNT_POINT}" -rmdir "${MOUNT_POINT}" +case $(lsblk -fno FSTYPE "${LAST_PART}") in + ext4) resize2fs "${LAST_PART}" + ;; + btrfs) mkdir -p /tmp/btrfs + mount "${LAST_PART}" /tmp/btrfs + btrfs filesystem resize max /tmp/btrfs + umount /tmp/btrfs && rmdir /tmp/btrfs + ;; +esac -- 2.34.1 https://16F0H.trk.elasticemail.com/tracking/unsubscribe?d=W3iSTwOIK-DOHnpemvzC8EMM0CgLGAUKd7tKCfVd6H8-zPuoxhzkljzRv-DkOJP1mOBhEL2zRDmb5aSeS31LMukikI75Ea3tHaNqA3GIw-_o0