Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96CFEEB64D9 for ; Wed, 12 Jul 2023 15:06:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4001386B2C; Wed, 12 Jul 2023 17:05:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="kclCuo/9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A819F86B22; Wed, 12 Jul 2023 17:05:08 +0200 (CEST) Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1000686B1C for ; Wed, 12 Jul 2023 17:05:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-78374596182so326791039f.0 for ; Wed, 12 Jul 2023 08:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689174304; x=1691766304; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fvIb2jvoz/8neL4iuugHrlW2dUb6Z8oE/kTD3ZZBE4M=; b=kclCuo/9pHjL3O50+18PQur9OelVYW4Vsww+nB6+3ryrZi6/OHDquUEs2+jk1yZmfq kfp2FeN5MaNgP+ixjHHgPpozPj57bgwd3F+J4Ufih2PPVeymh+LewDW621rF1J7F1mS9 3hKPVOKzqxKs14yuPds8RvsHIfle7GkysWlNY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689174304; x=1691766304; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fvIb2jvoz/8neL4iuugHrlW2dUb6Z8oE/kTD3ZZBE4M=; b=Zrbhhdg/WIOyi/s3FQ2x65d71ufqwOBZVcUFFfd+wGdC8xthV5ls9QmoIzaoyMFk4G ty5vdzmodIUjIyXan1Uz7Khxp7Qdn4QlgUtS3g52kyBwEgaSH/za/cLV2Tp36mJdD+nX xmrrMGa1aAdvKbPDF+WTxLChLaN66KGFVP02fcj0WQS5MHDqodUr/PHCI2vIjINoFHud 8dNyqD9o3aqXiawFurnSbl8g3PCOroOlFt5hWeS/If1JAL23VFoWZVZVnzMYlgoDw93u 8fst/0pi6CcSrfP/YH3G1Fjo2D+oap8X6qOyytKjwMCg7dtGxCYubqVax8NdotRVQjz8 6YNw== X-Gm-Message-State: ABy/qLZwKXpC85MVjq930e7NLNzEEAjuAYw3D4vRUreUI3GVQJPNLxn5 AkN6uKz14PJtml+Qmp2tqWtMzIvYstuKQ1dHwsU= X-Google-Smtp-Source: APBJJlGktON5nhkun5qlHMtvWgDLh7jD/82DFW3n6Ukqi9Mf9fM47HjJ7cVRTlyrgbZBf7lioSvq3A== X-Received: by 2002:a05:6602:42d3:b0:77e:3e85:34ee with SMTP id ce19-20020a05660242d300b0077e3e8534eemr12065928iob.13.1689174304591; Wed, 12 Jul 2023 08:05:04 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id h16-20020a0566380f1000b0042b08954dc3sm1202958jas.33.2023.07.12.08.05.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 08:05:04 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Bin Meng , Simon Glass Subject: [PATCH v3 05/18] bootstd: Allow storing the OS command line in the bootflow Date: Wed, 12 Jul 2023 09:04:34 -0600 Message-ID: <20230712150453.2407923-6-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.390.g38632f3daf-goog In-Reply-To: <20230712150453.2407923-1-sjg@chromium.org> References: <20230712150453.2407923-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Some operating systems have a command line which can be adjusted before booting. Store this in the bootflow so it can be controlled within U-Boot. Fix up the example output while we are here, since there are a few new items. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v2) Changes in v2: - Correct 'it not known' typo cmd/bootflow.c | 6 ++++++ doc/usage/cmd/bootflow.rst | 5 ++++- include/bootflow.h | 2 ++ test/boot/bootflow.c | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/bootflow.c b/cmd/bootflow.c index 5c61286a2a76..ddb168c70390 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -324,6 +324,12 @@ static int do_bootflow_info(struct cmd_tbl *cmdtp, int flag, int argc, printf("Buffer: %lx\n", (ulong)map_to_sysmem(bflow->buf)); printf("Size: %x (%d bytes)\n", bflow->size, bflow->size); printf("OS: %s\n", bflow->os_name ? bflow->os_name : "(none)"); + printf("Cmdline: "); + if (bflow->cmdline) + puts(bflow->cmdline); + else + puts("(none)"); + putc('\n'); printf("Logo: %s\n", bflow->logo ? simple_xtoa((ulong)map_to_sysmem(bflow->logo)) : "(none)"); if (bflow->logo) { diff --git a/doc/usage/cmd/bootflow.rst b/doc/usage/cmd/bootflow.rst index 8590efca2182..907d44ad9f9b 100644 --- a/doc/usage/cmd/bootflow.rst +++ b/doc/usage/cmd/bootflow.rst @@ -258,7 +258,6 @@ displayed and booted:: Name: mmc@7e202000.bootdev.part_2 Device: mmc@7e202000.bootdev Block dev: mmc@7e202000.blk - Sequence: 1 Method: distro State: ready Partition: 2 @@ -266,6 +265,10 @@ displayed and booted:: Filename: extlinux/extlinux.conf Buffer: 3db7ae88 Size: 232 (562 bytes) + OS: Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl) + Cmdline: (none) + Logo: (none) + FDT: Error: 0 U-Boot> bootflow boot ** Booting bootflow 'smsc95xx_eth.bootdev.0' diff --git a/include/bootflow.h b/include/bootflow.h index 018d021b8107..a1c16ab93b75 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -81,6 +81,7 @@ enum bootflow_flags_t { * @fdt_size: Size of FDT file * @fdt_addr: Address of loaded fdt * @flags: Flags for the bootflow (see enum bootflow_flags_t) + * @cmdline: OS command line, or NULL if not known (allocated) */ struct bootflow { struct list_head bm_node; @@ -104,6 +105,7 @@ struct bootflow { int fdt_size; ulong fdt_addr; int flags; + char *cmdline; }; /** diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 2b5f87d7f091..f7ebf9d7f278 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -226,6 +226,7 @@ static int bootflow_cmd_info(struct unit_test_state *uts) ut_assert_nextlinen("Buffer: "); ut_assert_nextline("Size: 253 (595 bytes)"); ut_assert_nextline("OS: Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl)"); + ut_assert_nextline("Cmdline: (none)"); ut_assert_nextline("Logo: (none)"); ut_assert_nextline("FDT: "); ut_assert_nextline("Error: 0"); -- 2.41.0.390.g38632f3daf-goog