From patchwork Sat Dec 10 03:25:30 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: 2284 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sat, 10 Dec 2022 04:25:39 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-ot1-f64.google.com (mail-ot1-f64.google.com [209.85.210.64]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 2BA3Pcqv017204 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 10 Dec 2022 04:25:39 +0100 Received: by mail-ot1-f64.google.com with SMTP id ca5-20020a056830610500b0066ea21701cesf3393294otb.7; Fri, 09 Dec 2022 19:25:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670642733; cv=pass; d=google.com; s=arc-20160816; b=YnBmVNdIJjOYHv6o5WRXWJxiHQFu3fudpLTRRS39fs5m2jMKY1oVi1x1bQguBh9odC HIsn4antiFdjVcfjLjJy7STZFoGaX6757I87P7S+sCHGucbSR7BfOd/ZvV6kIxjxGc6o zLIP08X/72td/Kbvw9dySfJJbYwcdCE0w7fYPTjBwDKyeZ4gBIVrdWwbbJ8UGZaYVYf5 qGzcU894f+yHnjcUOfKH/qx9wPjPMfm/e0zGUv0my75j3p+07PIDDz+Vv8SRs9CGqoPQ b5a8ae1LWuwGGBhaf1o2QxGrnqgXFGiCPdZxw7FsBQEU0K97ci+eIYMCO2h1XZD1jM02 QTRg== 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=6xU7vDAzwGCwViME+di0Ltuo7kp3COhzP8jGWAf+pKk=; b=Tvoh2qAI6lne7WKMPfyz5WoxGjxTteKOEQjgf9gDkMujwfOAfRMMae9oOml5Ssw6Of bghmrEhM1FNoyX5rKGG5ByDnLC0BxVKlIO+bWyFmmIXS4qnThYgHEqMihieIsuVugfUJ KLmpkJ4Uwh8MxPekxXlxEr+xDQdwerinALeagNWVb9yXhnj+txVnj+27/fvDSkhJkm3q 1z12C0aLFLG8tZUvDJCCatDyNeA8FgfX4QQR6gQfsAoj2RMXbmbbvufVoFrGj/ht/Dc2 hrFcdVIjOh5YMBFwXArq+VYtwBd8vryRqDTaHoWWXCB43CqLzK4YyqBJytokn1WzRyZk 9ijA== ARC-Authentication-Results: i=2; 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 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=6xU7vDAzwGCwViME+di0Ltuo7kp3COhzP8jGWAf+pKk=; b=FRoFmUgAItNgxSX+ReN2NRzq/GetV7HVhUoy+XtLXSBnBjbh40WPi1jEjyu7RytYMa GN5gkbhHT0oKkW41wI5CwydMSXtBByisGldKInF1qiiyvqqLv4ce5EEwM3hqJtlPHK41 57VDtjMrWiVli+3DeiFrpQhCnvZGDiIcz50GMmLuPW93ujdu+V5xhyM8SUwVkeFgL0LS /QZbBDtgiqcFbJJ83pHWV48q9gWIYNJXoGzws/P9Uj1vCkCv0dtcujmqROnT1bttkGuN ewOkRnYRi42fW5IRHyWgOx3vDcTQ9pEBJJULVuVe1r85xYq+E8OXUigsVzd4hV0mIfmL RUzw== 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=6xU7vDAzwGCwViME+di0Ltuo7kp3COhzP8jGWAf+pKk=; b=IynDVs9NmhJwdhKWyVkNNqgvTnBJnw9G1HNPDLERLZijkg/ziPY8Pz0W3/flrlvQkv Eh/z+5c/RYVyRHNHxAIDEMGvqsAlwTe5hAxiKmCulgeEN64jtMIpA1inwM6VBb+1kQpE IbvSJTKdVse/lzz/ASHeJIrZTGj6QBv0SXSMuowAj1Uprxzgq81j+fHUHnIvg+YjWRG+ JVixEm+CNX3QVEINfRnfZ2rfUOrHJPee7UzUbPpEKpLt7P818uYElZ48NNBH6nK5/hMj UbnyZGqPPw2bWqD5YEqYxEH0YBzDs93CU086UR/f1qNcbQH52vzYbfl9mYuvDHOHkjFQ Jdkw== Sender: isar-users@googlegroups.com X-Gm-Message-State: ANoB5pny3eZGRJWqLGqUUUvhdo5mnFHDzfw0KaE/pbU3CvZSoNXSv2Ca FeoDyEwp5mfhv/lw1BRZMXI= X-Google-Smtp-Source: AA0mqf4wvfmCe+gRfV+fkCUNyEbV/k8gHXp9efA8DcUFqix6thFTcrnjYFu7mXZ/SiaEQsbwHrAYdQ== X-Received: by 2002:a05:6870:b48e:b0:144:d315:ca3a with SMTP id y14-20020a056870b48e00b00144d315ca3amr20758oap.2.1670642732717; 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-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 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; 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: , X-Msg-EID: 228ZZWBxcYgtbWVc45qhuA2 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+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 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 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