From patchwork Fri Oct 31 06:54:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 665 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=1761893769; bh=Ic30Ez9gLoUs7rhYUhKwlYvhONpjYGSxXh5TGehfqNg=; 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=DRXQN34hx9T5Wsj3LvMfGA9Dvbr8JHshT3Xwe62Wb9FDsvDFdgAiCHLZMBFefY383 IycmEifz+9GURhqs/HMwLmBnQeLp3KaxIbNoIrsLWDmm0bq/oEGLJCDLGqX6mPWZbD vHG2YpvyPRFH7l1+J4KAT5+kQziVCu509cFu5qCTmuq3J0w1ML6znMmMkZ04gwXhfG F94lXsCwzp1s96kAh48PQWQ/EaSXV5DeIjm+eHOTT/XnWIo1oWXa9lo0/d/9uRjpeC pNY4Key+ShHKq6Y/nByMx3FiLo2B3XqjV8wW3Akh8+jKDtwvu6AMNVbolkZb3yJZhy 5jII2IYzKT4Qg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8EFBA68362 for ; Fri, 31 Oct 2025 00:56:09 -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 1wPOrNuItof2 for ; Fri, 31 Oct 2025 00:56:09 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761893769; bh=Ic30Ez9gLoUs7rhYUhKwlYvhONpjYGSxXh5TGehfqNg=; 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=DRXQN34hx9T5Wsj3LvMfGA9Dvbr8JHshT3Xwe62Wb9FDsvDFdgAiCHLZMBFefY383 IycmEifz+9GURhqs/HMwLmBnQeLp3KaxIbNoIrsLWDmm0bq/oEGLJCDLGqX6mPWZbD vHG2YpvyPRFH7l1+J4KAT5+kQziVCu509cFu5qCTmuq3J0w1ML6znMmMkZ04gwXhfG F94lXsCwzp1s96kAh48PQWQ/EaSXV5DeIjm+eHOTT/XnWIo1oWXa9lo0/d/9uRjpeC pNY4Key+ShHKq6Y/nByMx3FiLo2B3XqjV8wW3Akh8+jKDtwvu6AMNVbolkZb3yJZhy 5jII2IYzKT4Qg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7E39D68316 for ; Fri, 31 Oct 2025 00:56:09 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761893767; bh=MRNzEXGwlwyp2o+U2J168nGNLTuEfguPlULkwy8Epv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=opAcE8istNUwKY8o1SHv7XWBxZqrokritH1l6rmHr+k57V+NsuGeGqeMW3wqoCIbO E898lqx5cBTvmsYJFVmXNtyFHaL+h6YowCYgzxFTMWLZ38OZXM+wjt8M6d8PrpgSBf +uL3OW5+LB+ERDQrzWobcsQh6/Koo1CcxSKo0HOTzdp0J30KQ56whyFVlZiu8HzOhc 4VaKScog2w2k/E5TzhrsNHeDU31TCWaHk550bTh0ZwDlY9ZVuXmk9mgk78V76a+6EA 5SbBkBmBfEuTFkZf6pBez0GxAGWTeYlLq8qxFEE6bgDgNdzFLy1hPr1WGWDsHhzcJu H/0dzaJSYoLYw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7566268321; Fri, 31 Oct 2025 00:56:07 -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 th_xFdwEYFMA; Fri, 31 Oct 2025 00:56:07 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761893763; bh=GjQV1INhU8/W72Y9udZ7UfVLIuo4MACXLeIvvUGiYQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t1+oD+3SchNHUncCPM3Xs0yp3sdAMawOo5BjQ167RWnt9rF4UdRWKXx3B9hEoQJ0y ASu/a3r8ZDloY6m0nA2Q7lZdyIDEwgpveXdoJzud8zb7reTF2uSwiC0qyRrG77i0hx 1hYfp1llYDYP0ewPKzoi8tj1971Mg80eDOk7i4dVvhdxVt9FYx4xa1SiWAcE/Km9lY i9F3Jh6R4op6AeqoSbQnKQTypj3b1Q35WNFjD2AMaoJ+dbko2gi+mr8cPB5xW3fv5q 9YCPXJN772dZw4SxF9IiRCwRWFMp5kDu2VKTLLKijH4COJDWb5fKPijERx6KcxHjKI owNnaNAl0Up1g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C0225682E9; Fri, 31 Oct 2025 00:56:02 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 31 Oct 2025 00:54:11 -0600 Message-ID: <20251031065439.3251464-16-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: DWCATFOGQZ5Q2K53ZONVEMLUQ3ZWBCIB X-Message-ID-Hash: DWCATFOGQZ5Q2K53ZONVEMLUQ3ZWBCIB 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 15/24] luks: Encrypt the mmc11 test 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 Encrypt the ext4 partition in this image so that we can use it for tests. Signed-off-by: Simon Glass --- test/py/img/common.py | 6 ++++-- test/py/img/ubuntu.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/py/img/common.py b/test/py/img/common.py index a08744fbb76..01745ce73b3 100644 --- a/test/py/img/common.py +++ b/test/py/img/common.py @@ -33,7 +33,7 @@ def copy_partition(ubman, fsfile, outname): def setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, - script, part2_size=1): + script, part2_size=1, use_fde=False): """Create a 20MB disk image with a single FAT partition Args: @@ -46,6 +46,7 @@ def setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, 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) + use_fde (bool): True to encrypt the ext4 partition with LUKS1 """ fsh = FsHelper(config, 'vfat', 18, prefix=basename) fsh.setup() @@ -80,7 +81,8 @@ def setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, img.add_fs(fsh, DiskHelper.VFAT, bootable=True) ext4 = FsHelper(config, 'ext4', max(1, part2_size - 30), prefix=basename, - part_mb=part2_size) + part_mb=part2_size, + encrypt_passphrase='test' if use_fde else None) ext4.setup() bindir = os.path.join(ext4.srcdir, 'bin') diff --git a/test/py/img/ubuntu.py b/test/py/img/ubuntu.py index c60da4a0c41..58ee9f20277 100644 --- a/test/py/img/ubuntu.py +++ b/test/py/img/ubuntu.py @@ -49,4 +49,5 @@ label l0r initrd /boot/%s ''' % ((version, vmlinux, initrd) * 2) setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, - script, part2_size=60 if use_fde else 1) + script, part2_size=60 if use_fde else 1, + use_fde=use_fde)