From patchwork Tue Dec 13 05:58:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Roberto A. Foglietta" X-Patchwork-Id: 2287 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Tue, 13 Dec 2022 06:59:08 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-qk1-f192.google.com (mail-qk1-f192.google.com [209.85.222.192]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 2BD5x6ui031698 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Dec 2022 06:59:07 +0100 Received: by mail-qk1-f192.google.com with SMTP id bm30-20020a05620a199e00b006ff813575b1sf9663728qkb.16; Mon, 12 Dec 2022 21:59:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670911141; cv=pass; d=google.com; s=arc-20160816; b=N9w9gK/2ybWGZlwnp1eCKLhFHm1nghuoW28y+BO9ZKITFgQcJhcKC/0I+GT2b+I4H3 4Z0I0barvlSqVVVDxt291fxKZ3cWt6QHBmtNnot2tyQ6FH3FcOh8vGscVPInYpvNnsyN BAT0CNhUQpGmKp5A2dtH8RlMC+laSfxmyHu7LaYuXH86rBMkGbBXGL6l1WGcaHp7tdzk rOZzZkB4ER83jlio5MJp/du1N6hl9tCWX672FQGWl/Ehbd8adZwf22QSnmqbzeq4Eldl qK6wkcwu0olUEUI+M6BNOL5sEz1yulzcd1pyZbMH/246av63Brkh8XUGBxE2pTXI3JN/ Mvnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-subscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:list-unsubscribe:cc:to :reply-to:message-id:subject:date:from:sender:dkim-signature; bh=u7lGuz2n91DUggiTi42c59iJilqGFeg8gWnMhuzo5Zo=; b=Rt4GrQPUyzPe81zTQoU75AmicFl+vX6TTgBl494gbkAAAtDM1BKbtYPIEyPkG1b8fs tOhqJ5mpVPcx5EAZ68z4yE0kCE9ZKd5T12OsCQ0Qhv0jLz8X5ueIOhKmomauAws7id5f yNvNC/YaQSPlrigLJD16t0h7/rf56FVWiQmEwo6Yb4RIHeJoDzTmHH2aeVDOUA2SXEN9 JyI0Q8kisd4rsmbK0gBBEyeXjfMVa82kn90rO4CGeyCK+v1RLrmUG8eBS3UXcQGfYSq+ eGAf2AMCJq6TderxcwkZ00hA7MExBbeH9FcZHHT4a8Q77wzQqO+/ADmQjZ6Go7CdpQDd TGqg== ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-subscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:list-unsubscribe:cc:to:reply-to :message-id:subject:date:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=u7lGuz2n91DUggiTi42c59iJilqGFeg8gWnMhuzo5Zo=; b=j2CRIs+6rqeJPbZWUBr5e/BJOYTNqlIhFh3zx3qfJ7+jWL2nYCpVLUlh0dj6bBb+Zo Ahy2Hlzz+5KSvejjeJk2FcMcfzwbwx9/PkRouJSDuP+tnqHPIa706uhwz1Gw57UBu5+x ynyUzYf7XVkQkVJzA/4gfsHxlitjOp6buH3KrFC5oto8uAPJyPbuRxy/b0BbcB0CrJiz tkaLz2npSzDwGlp4EZUsKsQ2lz8dKw7SrN73XlflxmMs6e0fyHwQKNVk1WoKwg6aaLZS W5KW99gP/J16SvVdBPKvQwMorwTtDBBZ1R9xtDrY78MHnncJrt1GUA01k5W0mUPi6CeL GqTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :list-unsubscribe:cc:to:reply-to:message-id:subject:date:from :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=u7lGuz2n91DUggiTi42c59iJilqGFeg8gWnMhuzo5Zo=; b=HOs7A7MAI2jecuK+ZC3JOQxsaQBC+iaTfTwMOjorzGBQAKg8Dz8GSnIngNWUdjlY1+ xvp0aTcjm9fR2KRVuyB3CakiGFl97F40hcl3iZfvOa3WWcfDwJStx3JNY7nrIhgzuj5k Xzl91Bx14OBRLT10CYXmAV/KZF/SWZdNjoAY2zoxLJgE9A1Bv0dg9fHvaDXSOHfdXxru 7q1Hlmfg8VwRWnkOu2AO9FnbcONrtEkx4JvGh9x1j8pF3qRNZOq3TYK8vwHQG1MnN/6O 0oPHAm5W82GgeTQ0Y6oIrMAF37y7DtgF1rnx/xkHuBGe07mR9UfUA+R0kSF4lp4gb3jD ofGg== Sender: isar-users@googlegroups.com X-Gm-Message-State: ANoB5plFV5gcJqu4+sD9BRb6dHmS/lxC5HzSYau7QqoTLeTkIYtP5TAK 2Ev4KxKi2xgr+XCI8TGjYbk= X-Google-Smtp-Source: AA0mqf6P8OaAXRjZh9FqdqEufT/Skyhgldnd5vdTupcvLD6Hw5l7h5QOlbZXCxsF7HorP3uJsvAlNg== X-Received: by 2002:ac8:60d:0:b0:39c:e8cc:ff69 with SMTP id d13-20020ac8060d000000b0039ce8ccff69mr70956740qth.245.1670911141373; 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-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 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; 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: , X-Msg-EID: sol1UBqU5cGqK77fqBvKGw2 MIME-Version: 1.0 X-Original-Sender: roberto.foglietta@gmail.com X-Original-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 Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= 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