From patchwork Tue Nov 11 12:41:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 679 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=1762864951; bh=Kj8klNcgg7geafHvza4FAQhM/3ciZ6Ir94pBGsyzbIc=; 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=eyvI9O2iB5GZssuy5oDPocjdzMNk6d3DBjFHUV6T8ERk4rU3dAvAadAwgC+GCUjoY JDHJ594hq1tGwR+3S+va1RdBT3h3y1TcVeu6bitW8R3E+U2D04caCAAcJ8NC1X8M6P /bFr4d7anKBWMKfZk5/OIjPJqYTwIKIBpTO4v9BYUAH9WcMftCz7Q82aK6G456X8gC eWTAM+4N0+Gu6E7MVKAl67CUwitT9mdC0+4FbKQxXDP38ZD5fre3fxgdDP4cfmMj4E +TsU3Q0hQ82GhNfA0wydb1HhRX72HC4zeem3zlGuer4OLOR9MtdGs0/eujREtgIPzu CmcuRn4L18KIQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ECDA2684E7 for ; Tue, 11 Nov 2025 05:42:31 -0700 (MST) 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 kRwioWRha9NK for ; Tue, 11 Nov 2025 05:42:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1762864951; bh=Kj8klNcgg7geafHvza4FAQhM/3ciZ6Ir94pBGsyzbIc=; 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=eyvI9O2iB5GZssuy5oDPocjdzMNk6d3DBjFHUV6T8ERk4rU3dAvAadAwgC+GCUjoY JDHJ594hq1tGwR+3S+va1RdBT3h3y1TcVeu6bitW8R3E+U2D04caCAAcJ8NC1X8M6P /bFr4d7anKBWMKfZk5/OIjPJqYTwIKIBpTO4v9BYUAH9WcMftCz7Q82aK6G456X8gC eWTAM+4N0+Gu6E7MVKAl67CUwitT9mdC0+4FbKQxXDP38ZD5fre3fxgdDP4cfmMj4E +TsU3Q0hQ82GhNfA0wydb1HhRX72HC4zeem3zlGuer4OLOR9MtdGs0/eujREtgIPzu CmcuRn4L18KIQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DBB2868484 for ; Tue, 11 Nov 2025 05:42:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1762864950; bh=DvglxEdc6yPAbGFLmK0OjSj95cA6CxUTEJqNqUUHwrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=abSk6Bs3kwNnS6Oe18Xb6V2bYW6zSB+GTKZQMFqo3VagIHEiSPiTv9oF4hvXv6ZPJ KOi9XT0XnXiUa59yYGkWyqEN4Y61jd/Uh0l/BRQdXD7E/lir8r4NaDtRK6jlRcfdpf 0MtcS+iLQG0sKwKmITmdLQqvm7JkRRuZFosrTBdvdhOs46iLtqVGgbeQTmm1jZnhEL CnnSlaIkAa/Ej1cnhgaWk2QgB8Z/LqDV4YClfvqFPy8PFcUFrA7QyZlANSvxhAaB2y ZxK/LheFFpn5Im78ei7gVgzBGU62DxolTpnlr97SfkJH6BomfLKc4atCjO1/IRvrBR INlCNe7Jk0Vxw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 32F1D68484; Tue, 11 Nov 2025 05:42:30 -0700 (MST) 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 uhSIUw-Gwtfn; Tue, 11 Nov 2025 05:42:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1762864946; bh=F7/g58lu819hNQLiYLEleoBZ5zYXX9dQ/ZsHSikOuZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ufnbdgmWv7ozZcrMjTV/e9craAnDkARxQFuCpA7e/42skgMSP99n7OxFKRvaWOCkG K8pW3BUq21/ScWV6R5v7frYTOU3CbaDltceDacqttPRE6nvkh5HRG90rKTA1EkiuP1 KEDc3hMf95AK7awRisDPGmspd+eq0nB5OXB5ucX/fmriMjRXxJy9chWDbNBHecsjmv NsxVSiLCXMh6yIB88rZfIWa6otjE76ky8UoqXw0FZNGziqj8ptzrp37Xb8Aq0cN6Qq tdLWVpqzXumaxxA1uZRxFg+vpQa9sgCCDCt3QWGrt42UT9zCA5qRMgY8EqxmfVeGwF L3ICLRMXG4lXA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CCA886841A; Tue, 11 Nov 2025 05:42:25 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 11 Nov 2025 05:41:14 -0700 Message-ID: <20251111124131.1198930-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251111124131.1198930-1-sjg@u-boot.org> References: <20251111124131.1198930-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DIPQMVEK4ONPHB7RLUU6KGEQDI3VRXTG X-Message-ID-Hash: DIPQMVEK4ONPHB7RLUU6KGEQDI3VRXTG 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/15] test: Shorten the encrypt_passphrase parameter for FsHelper 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 This is very long and the 'encrypt' part is implied by the passphrase. Shorten it to just 'passphrase'. Signed-off-by: Simon Glass --- doc/usage/luks.rst | 2 +- test/py/img/common.py | 2 +- test/py/tests/fs_helper.py | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/usage/luks.rst b/doc/usage/luks.rst index a87abe140db..24be8d1ea81 100644 --- a/doc/usage/luks.rst +++ b/doc/usage/luks.rst @@ -232,7 +232,7 @@ See ``test/py/tests/fs_helper.py`` for the ``FsHelper`` class:: # Create encrypted filesystem with FsHelper(config, 'ext4', 30, 'test', part_mb=60, - encrypt_passphrase='mypassword') as fsh: + passphrase='mypassword') as fsh: # Add files to fsh.srcdir with open(os.path.join(fsh.srcdir, 'hello.txt'), 'w') as f: f.write('Hello from LUKS!\n') diff --git a/test/py/img/common.py b/test/py/img/common.py index 3b3fdb2734b..f5a7fcba804 100644 --- a/test/py/img/common.py +++ b/test/py/img/common.py @@ -82,7 +82,7 @@ def setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, ext4 = FsHelper(config, 'ext4', max(1, part2_size - 30), prefix=basename, part_mb=part2_size, - encrypt_passphrase='test' if use_fde else None, + passphrase='test' if use_fde else None, luks_version=use_fde if use_fde else 2) ext4.setup() diff --git a/test/py/tests/fs_helper.py b/test/py/tests/fs_helper.py index 914de09e381..4812d3f053b 100644 --- a/test/py/tests/fs_helper.py +++ b/test/py/tests/fs_helper.py @@ -41,7 +41,7 @@ class FsHelper: To create an encrypted LUKS2 partition (default): with FsHelper(ubman.config, 'ext4', 10, 'mmc1', - encrypt_passphrase='test') as fsh: + passphrase='test') as fsh: # create files in the fsh.srcdir directory fsh.mk_fs() # Creates and encrypts the filesystem with LUKS2 ... @@ -49,7 +49,7 @@ class FsHelper: To create an encrypted LUKS1 partition: with FsHelper(ubman.config, 'ext4', 10, 'mmc1', - encrypt_passphrase='test', luks_version=1) as fsh: + passphrase='test', luks_version=1) as fsh: # create files in the fsh.srcdir directory fsh.mk_fs() # Creates and encrypts the filesystem with LUKS1 ... @@ -59,7 +59,7 @@ class FsHelper: default value but can be overwritten """ def __init__(self, config, fs_type, size_mb, prefix, part_mb=None, - encrypt_passphrase=None, luks_version=2): + passphrase=None, luks_version=2): """Set up a new object Args: @@ -71,7 +71,7 @@ class FsHelper: 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 - encrypt_passphrase (str, optional): If provided, encrypt the + passphrase (str, optional): If provided, encrypt the filesystem with LUKS using this passphrase luks_version (int): LUKS version to use (1 or 2). Defaults to 2. """ @@ -85,7 +85,7 @@ class FsHelper: self.partition_mb = part_mb if part_mb is not None else size_mb self.prefix = prefix self.quiet = True - self.encrypt_passphrase = encrypt_passphrase + self.passphrase = passphrase self.luks_version = luks_version # Use a default filename; the caller can adjust it @@ -159,8 +159,8 @@ class FsHelper: shell=True) # Encrypt the filesystem if requested - if self.encrypt_passphrase: - self.encrypt_luks(self.encrypt_passphrase) + if self.passphrase: + self.encrypt_luks(self.passphrase) def setup(self): """Set up the srcdir ready to receive files"""