From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7175355899708440576 X-Received: by 2002:a05:622a:4a8b:b0:3a8:177a:666f with SMTP id fw11-20020a05622a4a8b00b003a8177a666fmr303532qtb.49.1670911141461; Mon, 12 Dec 2022 21:59:01 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ac8:6683:0:b0:3a8:ad5:f551 with SMTP id d3-20020ac86683000000b003a80ad5f551ls6166420qtp.2.-pod-prod-gmail; Mon, 12 Dec 2022 21:59:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf5sal/hAv52O6CTmSN78zu02bSKSvEOmXWOOudJxNWuxSkU1jmMhGJkV9vVo8lW0c0c3s68 X-Received: by 2002:ac8:4d8c:0:b0:3a7:ff64:8c00 with SMTP id a12-20020ac84d8c000000b003a7ff648c00mr23576434qtw.22.1670911140764; Mon, 12 Dec 2022 21:59:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670911140; cv=none; d=google.com; s=arc-20160816; b=LYHjOqzXt1CGSSeHncFWXV244CBFx2qChXRXy1YnX+rcRtTmHL3/VH1R7N3LTZ+z7H OIJGTN/YF0W0xTRvacvc1MfSqYbJjyuSr54n87IsVyP3q+UR0zibETqlN4eDrKBhhjDo CxdIodMjm5P3UpNc83JILSQEJTP7I97wil87oREk4UJlpaweI8I7tg22yN0mL1PVQ47H lj+SUtFj6lUbO5RwuMxux2bys78Q7xWcgUcT4Dtv7mQ0TXKya0Onv1uIP8Hh61vq1FQE K0xy/Z+DGVOePLuoVnGX9eKrEWvcT4I9f5DLpXHQYT6xbS6P6Cqy1NVOY1shxOviszNR hpKw== 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=UwaMTomD3PYc+2i7bBHYHy15RMIWc1/KQVzaM9f6DVg=; b=E93MiBRw/l+GOwT2CsCboCNKORaedxRT6NNrpKobYk/Maq/soIZUcS6EH3/sQbyty+ 4W4h2wAbnY9sLP9rLyVFn1ODdvYfSmy4Qse8euzkbRvdcN9l8AMlrxplvkyvT8jmL2cO 8kHoVZWXYny4hqCCK5ID1tjMPIh2TJcvEsAz2ayG5tZsmAQCLsVlvsx2pUbWjjdVLQx9 TKf2g8lu4Vx0LxjebgA2R9rV4IN4IyFXSisKa4FdYIvColO/p7mJQn8PJgQN3dqPPUr1 bHO2jJ6BBz+TLMb4IBQjpZKn0Yoj6ow807YjP7iQZHIIFHjdAD4RykiG67/mq6ORd2JD GFWg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of bounces+sol1ubqu5cgqk77fqbvkgw2@bounces.elasticemail.net designates 216.169.99.117 as permitted sender) smtp.mailfrom=bounces+sol1UBqU5cGqK77fqBvKGw2@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 s15-20020ac85ecf000000b003a803b27748si581247qtx.0.2022.12.12.21.59.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Dec 2022 21:59:00 -0800 (PST) Received-SPF: pass (google.com: domain of bounces+sol1ubqu5cgqk77fqbvkgw2@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+sol1ubqu5cgqk77fqbvkgw2@bounces.elasticemail.net designates 216.169.99.117 as permitted sender) smtp.mailfrom=bounces+sol1UBqU5cGqK77fqBvKGw2@bounces.elasticemail.net; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com From: roberto.foglietta@gmail.com Date: Tue, 13 Dec 2022 05:58:59 +0000 Subject: [PATCH v2] In expand last partition script btrfs support added Message-Id: <4uin6yv0t6le.sol1UBqU5cGqK77fqBvKGw2@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+sol1UBqU5cGqK77fqBvKGw2=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?=3Dsol1UBqU5cGqK77fqBvKGw2&c=3D1588198146759178339=3E?= X-Msg-EID: sol1UBqU5cGqK77fqBvKGw2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-TUID: r7ciyk3ml/yB From: "Roberto A. Foglietta" Improvement, expand-on-first-boot: support for btrfs added The mount point for btrfs filesystem to resizes is under /dev/shm by default but a variable defined in the running enviroment can change the temporary directory path. The /dev/shm has been choosen because in some system /tmp can be on a RO root filesystem and /tmp not yet mounted with tmpfs. This requires the system has /dev/shm configured into the kernel. Signed-off-by: Roberto A. Foglietta --- .../expand-on-first-boot_1.2.bb | 2 +- .../files/expand-last-partition.sh | 38 +++++++------------ 2 files changed, 14 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 4d55645..e314f70 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 @@ -59,29 +59,17 @@ 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}" +tmp=${BOOT_DEV_TMPDIR:-/dev/shm} +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=GzJMTaKIgCv2mECxUheEZNcgtj9lZzFDoDfbv1IE7z_lAkMPcVw8snRiOYjJ9ATVm-TWPHObr98Hm9MMf2Ds6wgOsQ2uhqQGg7Zz3tSFwiKq0