From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7114631008580796416 X-Received: by 2002:a05:6512:13a4:b0:477:a28a:2280 with SMTP id p36-20020a05651213a400b00477a28a2280mr2606195lfa.689.1656520418394; Wed, 29 Jun 2022 09:33:38 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:3b0c:b0:47f:9907:2b50 with SMTP id f12-20020a0565123b0c00b0047f99072b50ls418056lfv.3.gmail; Wed, 29 Jun 2022 09:33:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uZaHBRKHLmd5FNaHIQymkbfv5h4W9KzLakExQDDbnU4LaibNaDd79uD8ONsp51tF4/K13w X-Received: by 2002:ac2:4c52:0:b0:481:ce2:1802 with SMTP id o18-20020ac24c52000000b004810ce21802mr2697526lfk.586.1656520417179; Wed, 29 Jun 2022 09:33:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656520417; cv=pass; d=google.com; s=arc-20160816; b=p4XUNBMzOc8u0nWX3cMepWMEZs5HI5/3X3BJmLIk0DW07ECfkPye7F/XLoLPFeuILF 2rTCI9hsM+NazM22ZjyoHASCL87HlTCta0ZF7zB0elEbe/VtwuOWlD70plqR9sDfSdY1 BS7dDh6Xc0uGYmiXxdXf5Rl9vANFomDfcMUKgef4G5F5D+7QwS8ZmH72xbYByESyJDyb +Wrl7AY3yzjtg0lcVbFB524+f798B86KCFUVZC5cFiHtuLPseYg6FlwCuKT//j7MK1cQ mUbXPvP8ZySZvKVV2rKk3/NowcpIRbORLCsh4QFWF+2isbTGUgcS77M+BJrQKAPHFAbq Nk+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-transfer-encoding:references:in-reply-to :message-id:subject:cc:to:from:date:dkim-signature; bh=SshlsZrD6NxCM5Icg74uR/+ytmZjAUw4sdo1KK5/ZNM=; b=fxf7g5DU8L5dprFjSLS+CfFn0/0HBapm1YJbL7cuGq0D3kI0orhUg+z9PnnE8TKfiu pcxlfvL8dP2jEpzljv3Chsz8Oex5HQtvLS6Wyx4KvQ+qd2xecFDT9mul+kNTCtwxdRdN MFn33kWnhD6t8yx/bP+uUK83MxdFBF8STZUci1wA196H9nFGyzv2mldamDcWMmoMuzWF GqrtLhhk5CCeHv/2VeAM80mdW3NR43Qe3Je1Lvo/HTYGG45nBl5QQ8AGOe5VaT0uPmpn /T1pZEhGbKkSWOGX1H94SvPfyb/FHC1CtcEGjluIu+K0b7NmAeaafqz3wStoHfAbWE/y 9gyw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=OOJrGPfm; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of henning.schild@siemens.com designates 40.107.1.51 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10051.outbound.protection.outlook.com. [40.107.1.51]) by gmr-mx.google.com with ESMTPS id m7-20020a2e9107000000b0025594e68748si711372ljg.4.2022.06.29.09.33.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jun 2022 09:33:37 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 40.107.1.51 as permitted sender) client-ip=40.107.1.51; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=OOJrGPfm; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of henning.schild@siemens.com designates 40.107.1.51 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JvF/1tTb8vAd0fULS+wJaPF7Kn3VAEcsR4PGiYZN8+e6RHKk0LZITeX23SdCyTSiPfyTWZTyxMoVaRRUqqTRelR+Aicb3EutwE5zHnVAk7P4ebgVM/E74C+EDIpRVSayRidYfbUvp48CVFLlSW5iDNPfK3ettvR+ZISJsbQLGj3oy3qBx7ZYuFMvAdLK6T36bCWbM8Xnql1uSD0pFqmAJqONZoUYX9gs50HsvBvDCFOD7vMsRKcMBiNOymDSE+4nEV4SV8cdUXiUXYb3sIilsI71ikRuPpYBKWQfe9DEFpmux6pv7KMMl839IKEhSe9N+0sgrz+I6D61UZFvfckjVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SshlsZrD6NxCM5Icg74uR/+ytmZjAUw4sdo1KK5/ZNM=; b=bEwwfBpsjPFJuoe3hBGajj02+038g49G/6HknJiLrhrlsKNaNh0txrmnfQD2UodJlTu5JlmnI+WuEKCrbvvuTuq0MsjdEq31e6mE7dzrqMxbAXny9KBRvvinGgesPBtTY6Wvt/bcJ5y/7IUKqM5jVf9flHv0au3yl1C8HiOdwaA27VVrJMdQrndHCVL4HL02pJsEeWpsPmab92kScyVblH908nPMsQGrt6b2/+S/EnmXSDzFOpqrNyEnze9jmmpJKqckCsj7Tvt0vEF8q3QX8MC5ROH9EkoLLJFL6O4bTo8kdPww7IMxpFfdootzwPw8zg1KEyQuO+QwWmkwFpLrRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SshlsZrD6NxCM5Icg74uR/+ytmZjAUw4sdo1KK5/ZNM=; b=OOJrGPfm5Ag6pi+L6njOtIrQV0acFwqdTngw3qe3U2oAgC9XZF6yrcwNAO1DsfD0JpQ61NF4zNScCf0l7oGKDPMIIZd+uqMSfzB+ArMZTxigMhbEd/fV7C5Zcg7i5usCXubYcHtiquiwlsJ+mt62tS/fSaKoG/eBbyFXD9SJqB1oA5W3nwKJGUm9ea77svtZeM4HaZg6MwNnMz/KI09bQZFiQbS1RM434jMJX6qy6B5EGmvWLwMUvaS3U/hgn9H0fzrctsxM32w4PqgQHH16dSlZ+j4+pIP9G4gdwDAmI0Xo5aKY+vLqiH7pySBMCluFEZZq/oz4luyfuCusZyVRcQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siemens.com; Received: from PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:269::8) by PR3PR10MB3755.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:28::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.17; Wed, 29 Jun 2022 16:33:35 +0000 Received: from PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM ([fe80::b925:3d3d:8f5f:c4d9]) by PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM ([fe80::b925:3d3d:8f5f:c4d9%8]) with mapi id 15.20.5373.018; Wed, 29 Jun 2022 16:33:35 +0000 Date: Wed, 29 Jun 2022 18:33:33 +0200 From: Henning Schild To: Tobias Schmidl Cc: , Joe MacDonald Subject: Re: [PATCH v4 1/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs Message-ID: <20220629183333.4443bd8e@md1za8fc.ad001.siemens.net> In-Reply-To: <20220629120144.507398-2-tobiasschmidl@siemens.com> References: <20220629120144.507398-1-tobiasschmidl@siemens.com> <20220629120144.507398-2-tobiasschmidl@siemens.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0104.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a9::15) To PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:269::8) Return-Path: henning.schild@siemens.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f86d58e2-7ea7-4fdd-c9f4-08da59ed1ced X-MS-TrafficTypeDiagnostic: PR3PR10MB3755:EE_ X-LD-Processed: 38ae3bcd-9579-4fd4-adda-b42e1495d55a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k6nxReCo5H+j4oxNRm2f+dq/CTs/PY/oHpwfMgKyn+8ZA2tR1tLaVVSwa3SfwB0O22hAWRTSHBiFmHUM7lDO3HI06b12+hTAeq9c7789Nzjt3X/Dt67xEja6jPBywGJADRIdf4LJp7/0QRwRHiJjnbB5cicFp/ZXYM8fBGGPgMnNcttOGop3ViTS5smJlJ9KCbZhmRY5UKZnujyGvJXfUlK2+m5ldT6Abqn46X5BUBcxYisHkCsCpqeRxCkQ6gcwvqF7wfEi0vEp0ol+b2tcfs3jUhtz6eNsA8u6h07C5CatUDpd7DG0HWFIuHjVHs/zDZWHmBK2gU5tF/MTgwU1ite1Lahh683QrvCmd62DhCt6rPY5rpWrNsLN0JvA03sNPauhFbj3s71WzyLAy9eaZrU52NsOOpE17Fywf8nn6ivG/od6ldn4FwluYVkas2Aw8ssoo9NfjDQck4512hIgAAUJNebk2zgq5b/T6YHoQYmMbmQwa4L8JpjADno7WOt8vdZnh2AYYfaSK5fNVkoIry9wry/3mjc5HDNzF+P6uvuZ9Ugnf+ksV3oqZhthDYZQx/J1iSijFi+WAbkmjosu02V4nAtALrduqWxJJ+h/eY1pbwDhcL1xJh1RJXpnXpHaxXTAaUaq0YCv6N8J3MPIgzG4kro+zomKPhJD0obwbIbs1jM2CMIaWGGIFtVVwVtkGr9PBezFopc3HeuQCW/fyPH3B7Ajiuqt8cHQg6wdkKM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230016)(4636009)(396003)(39860400002)(346002)(366004)(136003)(376002)(83380400001)(86362001)(6486002)(6636002)(186003)(44832011)(2906002)(107886003)(66476007)(66556008)(66946007)(26005)(6862004)(8676002)(478600001)(8936002)(82960400001)(1076003)(41300700001)(316002)(38100700002)(9686003)(6506007)(4326008)(6512007)(54906003)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?QesliTxdaZtqMANgqynhbHxumurmf+TUoClqZrc8ZGTulMRpMIKWt6KdNaIE?= =?us-ascii?Q?zZAHNe00GBsuf/6wD7yZY8qk9W2jaZ37LMJi5fG4a8KNqGAWQVsfjnw19wgK?= =?us-ascii?Q?Ng3sl4awmbtk9S7PutkG0DuQkKUtbyUdIowA61I2Lu9W5RZr/6E64OZ58br/?= =?us-ascii?Q?+iG2heHqycu5oRs2VKOixxeyDCaMeZilgQA7g4cAvJHv2FeS4Efaz+tYIF36?= =?us-ascii?Q?2iRAMRyJU2/w9AB6SqyWiTaM/Rjji64yPAZtyA/gFNg2OV2vgR4BwCKd6+pB?= =?us-ascii?Q?KSpGQ1AQa6j5Uk/MtYbYxFp/3/efjxVD+QvuD6SvIC/9bm7WJMm6k3RD8JYl?= =?us-ascii?Q?97bxF7BSy00NTKU5lqfB6S2ed8bLdb2X2C90P5+yDDeiY06CKxL3f6D4pO7X?= =?us-ascii?Q?G14vds4fwnWIiRHLqpLk67yH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m?= =?us-ascii?Q?cOFf9lXl5KymRnq7CukrR24WHDAL51oeTFV/PSVgVi8VkOPTAceiX7nOHznG?= =?us-ascii?Q?QU6psUo5oO6DFScaNbhOqFYqx2TnKFTZbh3GAtukM0LtCm1IuZLNnaEPvSwE?= =?us-ascii?Q?k/9nk8++1rXrFag1HLiq1/zmeYwYoHGbdUwxItuK7g09LZO30FN4jhx5UQgW?= =?us-ascii?Q?fFUfgq3cN2kHkxbyMkGM9zwISbJkldAUiwBeVfNWKR7kc8x50hND4/UKFOZR?= =?us-ascii?Q?O3648fa++hHqODeQCfsBcgvpq6Q8Slr6vVY5Vj0Af/AGs2ShDOxTeWphI7OV?= =?us-ascii?Q?7A=3D=3D?= X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: f86d58e2-7ea7-4fdd-c9f4-08da59ed1ced X-MS-Exchange-CrossTenant-AuthSource: PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2022 16:33:35.5063 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eH19nqaz/FqNKR+qTX4lq738Wah6CaIpEhkOP4uJgMaogU/r+RQ2rJW3TrU6lsIOg0R9grmsqMHK/AOTVN1icEx+5MReN161RJr+ZKDrM5w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR10MB3755 X-TUID: 5ImTBInwr29o Am Wed, 29 Jun 2022 14:01:44 +0200 schrieb Tobias Schmidl : > We want to be more versatile in our approach of resizing the last > partition. Therefore we switch from resize2fs to systemd-growfs. > > This allows for ext4, btrfs, xfs, and dm-crypt partitions to be > resized. > > Since systemd-growfs landed in v236, this obsoletes > expand-on-first-boot on stretch (v232). > > Signed-off-by: Tobias Schmidl > --- > ...oot_1.1.bb => expand-on-first-boot_1.2.bb} | 5 +++-- > .../files/expand-last-partition.sh | 21 > +++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) > rename > meta/recipes-support/expand-on-first-boot/{expand-on-first-boot_1.1.bb > => expand-on-first-boot_1.2.bb} (78%) > > diff --git > a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.1.bb > b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.2.bb > similarity index 78% rename from > meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.1.bb > rename to > meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.2.bb > index 1703a64..48d30d3 100644 --- > a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.1.bb > +++ > b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.2.bb > @@ -1,15 +1,16 @@ # Resize last partition to full medium size on fist > boot # # This software is a part of ISAR. -# Copyright (c) Siemens > AG, 2018 +# Copyright (c) Siemens AG, 2018-2022 # > # SPDX-License-Identifier: MIT > > 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, util-linux" +DEBIAN_DEPENDS = "systemd (>=236), sed, grep, > coreutils, mount, fdisk, util-linux" > 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 c0edde7..1743890 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 > @@ -3,7 +3,7 @@ # Resize last partition to full medium size # # This > software is a part of ISAR. -# Copyright (c) Siemens AG, 2018 > +# Copyright (c) Siemens AG, 2018-2022 > # > # SPDX-License-Identifier: MIT > > @@ -45,4 +45,21 @@ partx -u "${LAST_PART}" > # when using systemd mount units. > export EXT2FS_NO_MTAB_OK=1 > > -resize2fs "${LAST_PART}" > +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_POINT=$(findmnt -o target -n "${LAST_PART}") > +UNMOUNT_AFTERWORDS=0 > +if [ -z "${MOUNT_POINT}" ]; then > + MOUNT_POINT=$(findmnt -o target -n --fstab "{$LAST_PART}") > + if [ -z "${MOUNT_POINT}" ]; then > + echo "Cannot find mount point for ${LAST_PART}" >&2 > + exit 1 > + else > + UNMOUNT_AFTERWORDS=1 > + fi > +fi > +/lib/systemd/systemd-growfs "${MOUNT_POINT}" > +[ $UNMOUNT_AFTERWORDS -eq 1 ] && umount "${MOUNT_POINT}" where did the mount go? i would assume a mount to be here somewhere which happens in the context where we remember that we have to umount Here a "noauto" in the fstab line of that last partition should help to put that script into the role of the mounter and actually test that path. So the problem is that the partition needs to be mounted to get resized. And now we have the problem to sync up with other mounters and potentially having to umount ... not as easy as it sounds. We need to get the order right and know things like "noauto" or other fun exceptions. I suggest to try and --bind mount it to /tmp/partition-to-expand ... if we are lucky we can grow it when mounted twice and unconditionally mount/umount without ever having to findmnt. But i am kind of afraid of an EBUSY ... Henning