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 CC4EAC433F5 for ; Thu, 21 Apr 2022 12:20:39 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A456683B46; Thu, 21 Apr 2022 14:20:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com 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=konsulko.com header.i=@konsulko.com header.b="A6JKAQ5Y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 040AC83C70; Thu, 21 Apr 2022 14:20:36 +0200 (CEST) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (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 DCCAA8209D for ; Thu, 21 Apr 2022 14:20:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x734.google.com with SMTP id a186so3370901qkc.10 for ; Thu, 21 Apr 2022 05:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mfk1ITmbO4aZ6ZmHUo+DEpmfuZKVFr4A8eAKmtLizDo=; b=A6JKAQ5YP1mYVIhZOnr/9qWTdxWl7qsljGCwHiKbOQJ5rx7Wv2eSAoJs1JZqO7n0kI yoQzxGq67Vb1OFGWSKvXMMUFk+3YoNX5j1LdYHtmdMdhHP9l8WxSyKGtYFY9kmwHUFED HwKcD0s2mYfkfx3ntZbgS89zsxIz98vVTycGw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mfk1ITmbO4aZ6ZmHUo+DEpmfuZKVFr4A8eAKmtLizDo=; b=oo/CDv277BR8JBNbIZRHRlaKdSCaPjLXgqdkeD/CQu/eSnSWafxPF8SVsIGHFHUr69 cDLCpIYr1aQ6E0VTTNVbUZBuaqm9F6gP6qTaqbHrL8g3VeGU2I6ELF/wjrSh+eaFBlCK mzxi61njssbGmGN0qpF1/RFYSqVakl3s4mzzmSoFs7gwcqr7AsAhuI7+eVHskv+VEXBz 3sw2fWfcbjazbrdCAGTGvzUTHnWt4kINJDMNtBpGX7Wgo59AvRwI1Zr7OTIs2oy58Rlc CYFQxzXVkMQoOTS1yviI7k7j5YxgMOxLG9jrhp2Ceb+olVIjy4Eey6Io7N3KyPyn6M2W SdfA== X-Gm-Message-State: AOAM5329P4bZyUTMp2RN0M5H5fEBYpjZ+sdBGB0Jeyye1iOzwa4QwT92 eXFhppPkRKRGjHWvTgvj9v+p4Q== X-Google-Smtp-Source: ABdhPJz2PrAXfUFWckFV2tBoXDGmbty7RxqTsz+TsAqi2c+U0Fd1zlMvl3RnUlYXBfP+0rDJOenviw== X-Received: by 2002:a05:620a:2807:b0:67d:6349:2577 with SMTP id f7-20020a05620a280700b0067d63492577mr15067791qkp.785.1650543631605; Thu, 21 Apr 2022 05:20:31 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id t4-20020ae9df04000000b0069e9a6734dbsm2884018qkf.11.2022.04.21.05.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 05:20:30 -0700 (PDT) Date: Thu, 21 Apr 2022 08:20:28 -0400 From: Tom Rini To: Francis Laniel Cc: u-boot@lists.denx.de, Marek Behun , Michael Nazzareno Trimarchi , Simon Glass , Wolfgang Denk , Harald Seiler Subject: Re: [RFC PATCH v3 00/23] Modernize U-Boot shell Message-ID: <20220421122028.GY3045430@bill-the-cat> References: <20220331232716.241283-1-francis.laniel@amarulasolutions.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Tm3avfvRG8umVcF7" Content-Disposition: inline In-Reply-To: <20220331232716.241283-1-francis.laniel@amarulasolutions.com> X-Clacks-Overhead: GNU Terry Pratchett 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.5 at phobos.denx.de X-Virus-Status: Clean --Tm3avfvRG8umVcF7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 01, 2022 at 01:26:53AM +0200, Francis Laniel wrote: > Hi. >=20 > First I hope you are fine and the same for your relatives. > I would also like to apologize for the delay between v2 and v3. >=20 > During 2021 summer, Sean Anderson wrote a contribution to add a new shell= , based > on LIL, to U-Boot [1][2]. > While one of the goals of this contribution was to address the fact actual > U-Boot shell, which is based on Busybox hush, is old there was a discussi= on > about adding a new shell versus updating the actual one [3][4]. >=20 > So, in this series, with Harald Seiler, we updated the actual U-Boot shel= l to > reflect what is currently in Busybox source code. > Basically, this contribution is about taking a snapshot of Busybox shell/= hush.c > file (as it exists in commit 37460f5da) and adapt it to suit U-Boot needs. In order to put this through CI and my local testing loop as well, I need: commit 0eae144ef84e7190b3c2da5fbd745468f7d1f7e6 Author: Tom Rini Date: Wed Apr 20 15:28:10 2022 -0400 HACK: Make new HUSH default =20 Signed-off-by: Tom Rini diff --git a/cmd/Kconfig b/cmd/Kconfig index 3454229d9c92..d0fb264e7df1 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -23,12 +23,13 @@ config HUSH_PARSER If disabled, you get the old, much simpler behaviour with a somewhat smaller memory footprint. =20 -menu "Hush flavor to use" +choice + prompt "Hush flavor to use" depends on HUSH_PARSER + default HUSH_2021_PARSER =20 config HUSH_OLD_PARSER bool "Use hush old parser" - default y help This option enables the old flavor of hush based on hush Busybox from 2005. @@ -42,7 +43,7 @@ menu "Hush flavor to use" 2021. =20 For the moment, it is highly experimental and should be used at own ri= sks. -endmenu +endchoice =20 config CMDLINE_EDITING bool "Enable command line editing" diff --git a/common/cli_hush_2021.c b/common/cli_hush_2021.c index 68b2fa4b3fe6..0b1ef6dc642f 100644 --- a/common/cli_hush_2021.c +++ b/common/cli_hush_2021.c @@ -40,12 +40,6 @@ #define USE_FOR_NOMMU(...) __VA_ARGS__ #define USE_FOR_MMU(...) =20 -/* TODO: Drop this before upstreaming */ -#ifdef CONFIG_SYS_PROMPT -#undef CONFIG_SYS_PROMPT -#define CONFIG_SYS_PROMPT "2021> " -#endif /* CONFIG_SYS_PROMPT */ - /* * Size-saving "small" ints (arch-dependent) */ diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c index e46875847018..2a659dcd4eae 100644 --- a/common/cli_hush_upstream.c +++ b/common/cli_hush_upstream.c @@ -1448,6 +1448,7 @@ static void xxfree(void *ptr) * HUSH_DEBUG >=3D 2 prints line number in this file where it was detected. */ #if HUSH_DEBUG < 2 +#include # define msg_and_die_if_script(lineno, ...) msg_and_die_if_script(__VA= _ARGS__) # define syntax_error(lineno, msg) syntax_error(msg) # define syntax_error_at(lineno, msg) syntax_error_at(msg) @@ -1465,7 +1466,7 @@ static void die_if_script(void) } } =20 -static void msg_and_die_if_script(unsigned lineno, const char *fmt, ...) +static void __maybe_unused msg_and_die_if_script(unsigned lineno, const ch= ar *fmt, ...) { va_list p; =20 @@ -1539,7 +1540,7 @@ static void syntax_error_unexpected_ch(unsigned linen= o UNUSED_PARAM, int ch) /* Replace each \x with x in place, return ptr past NUL. */ static char *unbackslash(char *src) { - char *dst =3D src =3D strchrnul(src, '\\'); + char *dst =3D src =3D (char *)strchrnul(src, '\\'); while (1) { if (*src =3D=3D '\\') { src++; With everything but the Kconfig part being the same as RFCv2. For the next RFC please: - Include a patch near the end making this new HUSH the default - Include a link to CI running and passing (see https://u-boot.readthedocs.io/en/latest/develop/ci_testing.html for how to get the CI to run for everything) - Include a patch near the end that moves from the updated hush you started with to the current hush, as a way of showing how easy (or hardd!) keeping this in sync moving forward will be. Thanks! --=20 Tom --Tm3avfvRG8umVcF7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmJhTAwACgkQFHw5/5Y0 tyxodAv8D1a5ZIzif32t3Crqj7FpM7mjDU0oNIHBNdISbRtOxOMpgQtonwUOX+vh zrsOEHDSz0lfyIJ5ysRGWHOzanVL6EIucgQANryabMjsQ0qsbUiGcEqckoPKdFAB +a4u0vpPYRLgbKCRotiK/AXbnh+03g02H2kxPoNSSgZbre5wGJFVcPbbLCjhECU+ aFvQZgXcdITDfCUZ2s83wUt2tXDwErKtnSFYD6z3m4eDwRnDvJjyNqVthzuaPCBI Hc1A0DKKVYodR2fBWWk67aDsIl3JvH5lEllyZvOOun23zjy9ABFgKoyJIv6fWLEI n+IIVlzVAFpWEFWObJn3ROBjUFnm0BRe5q8aAmZLqzCKlBUPIeODUtnCXQdUDl0e AdyVOGP79bvq/pentbppXkX2jX3+/L5ieDHQP74SvUYCKdLEILAaiue/ThDraLnd eVIQqPBs6WgApAhXXbCM0Tv5MIQTmUn6Q3kgD8NXHV6e6m8SM0HuMfFgoie021HW A637h7je =24hX -----END PGP SIGNATURE----- --Tm3avfvRG8umVcF7--