From patchwork Wed Oct 29 06:16:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 647 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=1761718655; bh=yQI0JZO9x2/H8nk3eTD225h2Z55PAzjrG1uQuMwpBHk=; 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=dmfdvseqjUIpVHCxJrgqXdA9GjIQHn7KmaX04GRI63v1RoRAqFecagZ2d8lG/zdCs Z66YFe3HxFK412wXHFXMBAWtwwGvXKSiNH5ixOVaUf18O6upVGiRVMmfMg6jTz0KbX sIDn1uogwKgBVFnFrnp4VK8j5hsvJIQUXUqzQk65H638QXmQAt2EfpIwUcH16kKVDl pBciykfeKFlrvPr9tzmWlj0OuZSLZ3ilXVi0pgmLOKk2alhhzRM6ATEDXpvLCMtt8Y niM3Q+iolUXhA1+cIZ5sjiVSZ28lMEJFiWogJI55ARC1WJc0SHVt4oNM6RDPoLgX4A m+TU+2NxM60kA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EE15C6824C for ; Wed, 29 Oct 2025 00:17:35 -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 6q9yRxQNv1YH for ; Wed, 29 Oct 2025 00:17:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761718655; bh=yQI0JZO9x2/H8nk3eTD225h2Z55PAzjrG1uQuMwpBHk=; 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=dmfdvseqjUIpVHCxJrgqXdA9GjIQHn7KmaX04GRI63v1RoRAqFecagZ2d8lG/zdCs Z66YFe3HxFK412wXHFXMBAWtwwGvXKSiNH5ixOVaUf18O6upVGiRVMmfMg6jTz0KbX sIDn1uogwKgBVFnFrnp4VK8j5hsvJIQUXUqzQk65H638QXmQAt2EfpIwUcH16kKVDl pBciykfeKFlrvPr9tzmWlj0OuZSLZ3ilXVi0pgmLOKk2alhhzRM6ATEDXpvLCMtt8Y niM3Q+iolUXhA1+cIZ5sjiVSZ28lMEJFiWogJI55ARC1WJc0SHVt4oNM6RDPoLgX4A m+TU+2NxM60kA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CF1EC68303 for ; Wed, 29 Oct 2025 00:17:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761718653; bh=O9CwRDnMwCWsxNVpKa2eRwMUe0k3inYNtMyT1IjfQzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BFdCLRImRyiMlAFxungBCzZfjct+936QJ3Fh7D/lIsp9Rc9+u1YH9GHcpOFV3MwGT jKHmzwVDO4SA/Wkotn6lQKSQt+W5DMC2xJXCt5ij2QLf4zJFN3xlw/2SW0KXk2Y94Q 2ZokRl2zAEJY7UwQEI0Toh+s8ddzYCrPcTaUv4DWEudgkEoaaCbsU34y2WBWHgy+Oa lnzMPDqHO+5OAqXoQIPasQNx9+Fi0PgkgcfzL+KUIIbYcVUAsrNHDgQzHSl+sqBASj KTM7jRwU64uQSfmXy7f7ZDXAT+KT48ZkdoLd7G9O+I4qH40oI7PzLYKC9WNNtmQFnA DJKeQ+bTTGK1Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1B5D06824C; Wed, 29 Oct 2025 00:17:33 -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 IasJfC1ofxYA; Wed, 29 Oct 2025 00:17:33 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761718647; bh=q2WnNT9x8xihFRy2SSZ72W5tzgSZ51tVPDvWhHX8Vh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C8it65N9+oDoOChUhcVjuTOQbG1in5q/wktcbdG/vrL5n90BLX8jJO/11+g2AhLSP ZmViPqhL3X8KPy9WQHjXvlPeVx2IyXs/iXO01W4GefhUNprZfLhu5cBi7RKuloY6BS TL472jfZKxuvu+mrG8zFNPxUdy3htxKBjFjO5RkjCWyhf/NaUNGZGrZ2rHV3Cfvvkg RQQ0mpKwSKIAUjJ42RxNGs3J12NVExhgSuq3I3QX5Q2MsAF26vJoZzgjjR/74eWHZo ul95Cs8LVKdU1SHVrupi5vi2+Uiaim9Pv7zj3sBfzYF/7jJCD2WFjKiIsA4+gFQEho piGtrcmxt+mDw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0CC05682B7; Wed, 29 Oct 2025 00:17:26 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 29 Oct 2025 00:16:46 -0600 Message-ID: <20251029061657.1456910-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251029061657.1456910-1-sjg@u-boot.org> References: <20251029061657.1456910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: B2M3W6VEHYL7AMI4ROQHJ6NVQ5HOFKAI X-Message-ID-Hash: B2M3W6VEHYL7AMI4ROQHJ6NVQ5HOFKAI 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 , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 4/7] scripts: Support --bootcmd more generally 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 -b as a short alias for --bootcmd to build_helper so it is available in both build-qemu and build-efi Move the fw_cfg bootcmd logic to build_helper as well. Co-developed-by: Claude Signed-off-by: Simon Glass --- scripts/build-qemu | 7 ------- scripts/build_helper.py | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/build-qemu b/scripts/build-qemu index 70dfe968f66..3d59012ed5e 100755 --- a/scripts/build-qemu +++ b/scripts/build-qemu @@ -41,8 +41,6 @@ def parse_args(): description='Build and/or run U-Boot with QEMU', formatter_class=argparse.RawTextHelpFormatter) build_helper.add_common_args(parser) - parser.add_argument('--bootcmd', type=str, - help='U-Boot bootcmd to pass via fw_cfg') parser.add_argument('-e', '--sct-run', action='store_true', help='Run UEFI Self-Certification Test (SCT)') parser.add_argument('-E', '--use-tianocore', action='store_true', @@ -297,11 +295,6 @@ class BuildQemu: # Add other parameters gathered from options qemu_cmd.extend(self.qemu_extra) - # Add bootcmd via fw_cfg if specified - if self.args.bootcmd: - qemu_cmd.extend(['-fw_cfg', - f'name=opt/u-boot/bootcmd,string={self.args.bootcmd}']) - self.helper.setup_share(qemu_cmd) self.helper.run(qemu_cmd) diff --git a/scripts/build_helper.py b/scripts/build_helper.py index d401da0215c..8bce9a6183c 100644 --- a/scripts/build_helper.py +++ b/scripts/build_helper.py @@ -189,6 +189,11 @@ sct_mnt = /mnt/sct cmd.extend(['-object', 'rng-random,filename=/dev/urandom,id=rng0', '-device', 'virtio-rng-pci,rng=rng0']) + # Add bootcmd via fw_cfg if specified + if args.bootcmd: + cmd.extend(['-fw_cfg', + f'name=opt/u-boot/bootcmd,string={args.bootcmd}']) + def setup_share(self, qemu_cmd): sock = Path('/tmp/virtiofs.sock') proc = None @@ -285,6 +290,8 @@ def add_common_args(parser): """ parser.add_argument('-a', '--arch', default='arm', choices=['arm', 'x86'], help='Select architecture (arm, x86) Default: arm') + parser.add_argument('-b', '--bootcmd', type=str, + help='U-Boot bootcmd to pass via fw_cfg') parser.add_argument('-B', '--no-build', action='store_true', help="Don't build; assume a build exists") parser.add_argument('--build-dir', help='Directory to use for the build')