From patchwork Fri Oct 31 06:54:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 659 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761893740; bh=t+1BGYO57CFKx4PDNVw5zjXa4p7HyKpf5dsovbCIrj8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=k+hAKGyXliR/EodAG/O3fzqhiQXt9w1hC5RTfKAwZMtnE5Lwpq6yCsNudTD9WU80H RhXY78lfsh5UL/x1Ev1qvRN75hNGdKVMShEjeK0RuQ53dPeJhssilGkIrAQ3JkWACe 02cXVE9YOsLOWBDnV9BY/GfYTELpNOBB7fauY2HCIj4vKJ8fpgZgwyZKQLOxy1sAZE 6S4s+MChouwpRE43I1nbLR+GBQBFGak9z+efyzqvROxJShZ0vVP5nIIEALdjOnIlgE dSv8egewyGSbgs3VsN1SyK3/q9qWR1PcyQa3khXlvoFBfRdKDQ5o4K3LyMjFW+3xBI 4r0h3KM2HaMrw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C96AC68368 for ; Fri, 31 Oct 2025 00:55:40 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id QXc0oM-NmM2X for ; Fri, 31 Oct 2025 00:55:40 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761893740; bh=t+1BGYO57CFKx4PDNVw5zjXa4p7HyKpf5dsovbCIrj8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=k+hAKGyXliR/EodAG/O3fzqhiQXt9w1hC5RTfKAwZMtnE5Lwpq6yCsNudTD9WU80H RhXY78lfsh5UL/x1Ev1qvRN75hNGdKVMShEjeK0RuQ53dPeJhssilGkIrAQ3JkWACe 02cXVE9YOsLOWBDnV9BY/GfYTELpNOBB7fauY2HCIj4vKJ8fpgZgwyZKQLOxy1sAZE 6S4s+MChouwpRE43I1nbLR+GBQBFGak9z+efyzqvROxJShZ0vVP5nIIEALdjOnIlgE dSv8egewyGSbgs3VsN1SyK3/q9qWR1PcyQa3khXlvoFBfRdKDQ5o4K3LyMjFW+3xBI 4r0h3KM2HaMrw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B96A768362 for ; Fri, 31 Oct 2025 00:55:40 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761893739; bh=KAiLOO9PTTlOYahOOHxUxoTSm+wagJ1tBuqMPIU4H5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UT6j9QYat6bvNGBLwiW5BwCW5jEU9X/87vxhq6gzE1YRgjmJRCLF2h9QKFb2SHDFt ZSpQMn9C5chiijKXEIHfV8c339sYoJaGsr2GT/WnnW2bJv3Mpjh5TLkRg0z3hT1j0b 32XJleBPAXggstRy2i5WDmT7zhZXbJ3KUR3SiYaLsOk0o11QHG0C6ejwajQclIpKqj FnDNmtsxQUXWAnalwWf20z8KpXuytDlR2ze3lCv/99lByGsi1ByvptoEkHDDD95E9A QHtXJUvbhQuTlr8Adzr8Z8e75VoRCYMRNrZm8fDMFNCmk0pl0L/55ZOVRcEP9VZshU o25SQd+U/PFog== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 630AD6827C; Fri, 31 Oct 2025 00:55:39 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id doSQGA_MiSLd; Fri, 31 Oct 2025 00:55:39 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761893735; bh=3xr/zMfe29nUFethVrcKvMYVCPaNgWofh1qjsLmZkXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yf54AI88mSWBDwIsuM9pxOyax5oNx5OdA+S4NDWKyOiXF36AFmERnAWZoD4BnrQB5 OMgod7LTT++qgQbyXSe+O3mA2vHYfyR9veIEUh6YHF6lrMyV/QwWvLkRwBS+5nJHSk 3kN9tphRjJRqKaMQcVG0pZz+jz8+vLdrjAQClefa4Dqj/hVOj/iucRGIoqaEyFV/52 h96EWQTQ7q0dMG1yjzwN2Wnbcxq8Sm8IBaK/lwIYLuU96t7fckjVJbmdg+SLpoGw9B gmYQYNTkYRMFJM1SwMcNJVAYBVxNagwMipVKigpEICRxk+9sjVuCpOaTZJEdKDmITr wEgFhlEuz3ZAg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 273DD682CD; Fri, 31 Oct 2025 00:55:35 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 31 Oct 2025 00:54:05 -0600 Message-ID: <20251031065439.3251464-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251031065439.3251464-1-sjg@u-boot.org> References: <20251031065439.3251464-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: EYVS3OCAUZ7EV5TWAEE3OH3IIWP76FI7 X-Message-ID-Hash: EYVS3OCAUZ7EV5TWAEE3OH3IIWP76FI7 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/24] test/py: Support creating space after a filesystem List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass At present the partition size is always the same as the filesystem within it. Add a way to specify a larger size, to make space for LUTS tables needed for full-disk encryption. Signed-off-by: Simon Glass --- test/py/tests/fs_helper.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/py/tests/fs_helper.py b/test/py/tests/fs_helper.py index baf61cbd232..e4ac946064f 100644 --- a/test/py/tests/fs_helper.py +++ b/test/py/tests/fs_helper.py @@ -42,7 +42,7 @@ class FsHelper: fs_img (str): Filename for the filesystem image; this is set to a default value but can be overwritten """ - def __init__(self, config, fs_type, size_mb, prefix): + def __init__(self, config, fs_type, size_mb, prefix, part_mb=None): """Set up a new object Args: @@ -51,6 +51,9 @@ class FsHelper: fat12, fat16, fat32, exfat, fs_generic (which means vfat) size_mb (int): Size of file system in MB prefix (str): Prefix string of volume's file name + part_mb (int, optional): Size of partition in MB. If None, defaults + to size_mb. This can be used to make the partition larger than + the filesystem, to create space for disk-encryption metadata """ if ('fat' not in fs_type and 'ext' not in fs_type and fs_type not in ['exfat', 'fs_generic']): @@ -59,6 +62,7 @@ class FsHelper: self.config = config self.fs_type = fs_type self.size_mb = size_mb + self.partition_mb = part_mb if part_mb is not None else size_mb self.prefix = prefix self.quiet = True @@ -222,10 +226,10 @@ class DiskHelper: for fsi, part_type, bootable in self.fs_list: if spec: spec += '\n' - spec += f'type={part_type:x}, size={fsi.size_mb}M, start={pos}M' + spec += f'type={part_type:x}, size={fsi.partition_mb}M, start={pos}M' if bootable: spec += ', bootable' - pos += fsi.size_mb + pos += fsi.partition_mb img_size = pos try: @@ -241,7 +245,7 @@ class DiskHelper: check_call( f'dd if={fsi.fs_img} of={self.fname} bs=1M seek={pos} conv=notrunc', shell=True) - pos += fsi.size_mb + pos += fsi.partition_mb return self.fname def cleanup(self):