From patchwork Fri Oct 31 06:54:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 660 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=1761893745; bh=eT167ydoiF+kapiyDcUUO3VN4BKbvicxxBZVsgJgs3g=; 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=QFr0dqEgXI3H0/eb2qhWeWWZulQWlohleb5FBP7KHvXFJC2YEnc4OSpR/Eo8wfOE5 +YeXqM/9+JLrljbV0xpZt4DIqiTXXasdsvpcOx9TioBD2JJBSurO6uX45V5NobzpqK 628uZoMtT4c/eidWFLjRoRgPdMLC+/28cVI4LqXfw7LtX6Lv8FYRfqjIq9ombzoCvT AJDflHurPGqRVmHghMg0oKmwSpZfpwis/yjjO6DWXTiNUu9an6M7QGEg/wPy2YdEXv Kj2J8h/PPJCHggtyi1Eut17mD8cBJ6TvCy6oM2kuEixjxRYDGFxWWxw+zShEuNGXBq cvB2oYBsAxMqw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4162268346 for ; Fri, 31 Oct 2025 00:55:45 -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 nC9_kaIClPCQ for ; Fri, 31 Oct 2025 00:55:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761893745; bh=eT167ydoiF+kapiyDcUUO3VN4BKbvicxxBZVsgJgs3g=; 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=QFr0dqEgXI3H0/eb2qhWeWWZulQWlohleb5FBP7KHvXFJC2YEnc4OSpR/Eo8wfOE5 +YeXqM/9+JLrljbV0xpZt4DIqiTXXasdsvpcOx9TioBD2JJBSurO6uX45V5NobzpqK 628uZoMtT4c/eidWFLjRoRgPdMLC+/28cVI4LqXfw7LtX6Lv8FYRfqjIq9ombzoCvT AJDflHurPGqRVmHghMg0oKmwSpZfpwis/yjjO6DWXTiNUu9an6M7QGEg/wPy2YdEXv Kj2J8h/PPJCHggtyi1Eut17mD8cBJ6TvCy6oM2kuEixjxRYDGFxWWxw+zShEuNGXBq cvB2oYBsAxMqw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 30FF8682E9 for ; Fri, 31 Oct 2025 00:55:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761893744; bh=td52+cWtLrNDFaOtQ2k3IefhaWRLLmRjiwwoQTU7P6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H3SiCkbwOjVrFHUfbKHRlfcWH9nf7b7sewbkuuEHsdYevgTKI6PI4uSbtBm7vaJsM lZYDYnVQk0Ktr47Ca6blpReSDLHbllyE65Ih8H7tIKHCyh9EoMuydoaaSkZZW9+qzO 0AE2JWTo3lGgDz1rcp/YM/yFalRMlWTKv/zzOcmdniglbPXJwgBtSyOvjQJ4urFrNo by5ozp6sNzmSLvSm5KBgUSDwtnj0yiqhEi09KGmTYN0kOnVSB6wgT/bYylk52voAZW HPKZru3JnY5XVkJhYCfIdEmERWWE8DeqhLSKXeRqoHmUPkO9ew7xeu/CKdkkGK4440 7IcFtE/98pn0w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 148346827C; Fri, 31 Oct 2025 00:55:44 -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 plpo_4AZL2io; Fri, 31 Oct 2025 00:55:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761893739; bh=P0jk8XNVRgVtJrZrk5J2ExH+xqeo8K54aHXPA/zFn0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F7qXupm/GUqcgI7EuXlUQ/bWoNr9Hs/orw+jzgB/o3ekt/kNQBIb0WyrmbPyW3XES uJNstEPjuudUSOAvS5D4fvmif8uncOSsb6m6LAc8Z1zv+Khlx7ZgZm8nq4KdTjYHDf wtHdfmTvXFLx6r6HkNalWBHeBIEUSUPG4F5rteiPk/xQRz47lFy8wsOs6AAmYzyu/e F+83S1O5MROMM4Pcb+BRqRqJwfmxWhzzH6R7070qwy+xFk+pl9QIRAKesQUxSSRJHL mCeo8ufEH5NETQzxwpqNP2laclXMmUT36W81SXJ0/S3G39tnh8owIf9i6cNO2bpAWJ w3iEkGm1F1fEQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A4897682CD; Fri, 31 Oct 2025 00:55:39 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 31 Oct 2025 00:54:06 -0600 Message-ID: <20251031065439.3251464-11-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: NZSNVCOMMJXRJW6W7KAHFIBYKAASIVW4 X-Message-ID-Hash: NZSNVCOMMJXRJW6W7KAHFIBYKAASIVW4 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 10/24] test/py: Support FDE with the extlinux image 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 Add a parameter to indicate the size of the root partition so that it can have space for the LUTS metadata. Move the import of gzip to the top of the file while we are here. Signed-off-by: Simon Glass --- test/py/img/common.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/py/img/common.py b/test/py/img/common.py index c9be6a22362..a08744fbb76 100644 --- a/test/py/img/common.py +++ b/test/py/img/common.py @@ -3,6 +3,7 @@ """Common utilities for image creation""" +import gzip import os import utils @@ -32,7 +33,7 @@ def copy_partition(ubman, fsfile, outname): def setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, - script): + script, part2_size=1): """Create a 20MB disk image with a single FAT partition Args: @@ -44,9 +45,8 @@ def setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, initrd (str): Ramdisk filename dtbdir (str or None): Devicetree filename script (str): Script to place in the extlinux.conf file + part2_size (int): Size of second partition in MB (default: 1) """ - import gzip - fsh = FsHelper(config, 'vfat', 18, prefix=basename) fsh.setup() @@ -79,8 +79,15 @@ def setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, img = DiskHelper(config, devnum, basename, True) img.add_fs(fsh, DiskHelper.VFAT, bootable=True) - ext4 = FsHelper(config, 'ext4', 1, prefix=basename) + ext4 = FsHelper(config, 'ext4', max(1, part2_size - 30), prefix=basename, + part_mb=part2_size) ext4.setup() + + bindir = os.path.join(ext4.srcdir, 'bin') + mkdir_cond(bindir) + with open(os.path.join(bindir, 'bash'), 'w', encoding='ascii') as fd: + print('bash', file=fd) + ext4.mk_fs() img.add_fs(ext4, DiskHelper.EXT4)