From patchwork Tue Nov 1 19:20:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francis Laniel X-Patchwork-Id: 1697896 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=ksBxEjHD; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N20V726xlz23lV for ; Wed, 2 Nov 2022 06:30:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 98DCB8504A; Tue, 1 Nov 2022 20:29:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.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=amarulasolutions.com header.i=@amarulasolutions.com header.b="ksBxEjHD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CBDF084F99; Tue, 1 Nov 2022 20:21:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (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 1BB3984F99 for ; Tue, 1 Nov 2022 20:21:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=francis.laniel@amarulasolutions.com Received: by mail-wr1-x431.google.com with SMTP id k8so21527270wrh.1 for ; Tue, 01 Nov 2022 12:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=LV1Xbeu4XozDtwvN2Rlb6xPvK8FX0uYHo+mPXLbota8=; b=ksBxEjHDhSbOSrfubDTfOvhCudHFo4A2nupPzm9hkkZ83U2MdsKeGIARHsV4tKDR1+ 6jzB4dxo10ZobkUktxRl71aYWXCJMz6zo+ZHZtzP4pExb/m5ZGyHN9CE072rL5mjz1pO +WWZcXkCQm2mnYkIo/P/vdnAOYCZRS2Z7eBfA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=LV1Xbeu4XozDtwvN2Rlb6xPvK8FX0uYHo+mPXLbota8=; b=XU1/D+fPPxtoATTyX9lQIe/MctQydrrkLN13Sl8nwtBwbJayNoSoGTeCnvrD7lltr6 jvABqb7+QCMqQMJNz/DbmWVAJ5YIy6CV/fy6p3KuwYz3qkVAJCxSR2bKxbah6/aQ9guc z7F1bzMu+DhjR1n4Ph/avky+QFLLC7H0urnQsQMfpDBnlsv2vw+DsXqB5Bj83ZRMsrZF p+EepRkOfiDYv4jDJ8JRYqWCr7RhfCF8GElBd8320VqADxJ0ucnIQOxbD9l7JlGTfLLp qaRJJQPG1XU1egjTblLeDdx/T19nHKczUpwOWJ1gXcr1TIMrGAViGOFd1mGkD5VBpb0z 2p1Q== X-Gm-Message-State: ACrzQf1uwzVrqScg5UwtugAy7gVqItLp1oQtJ97BrerEimabsQJI2Jkx KvM0HzkbQLJSxuyMLUmF5GnB+bnOajLtkQ== X-Google-Smtp-Source: AMsMyM6NugRBN0UTcH6QxIpPsA1h5Xtf2B/QlBOot6lXdDqac6sn0N2jwKguO1dqiMmtCBTa3bQyTQ== X-Received: by 2002:a5d:6a90:0:b0:236:4835:ca94 with SMTP id s16-20020a5d6a90000000b002364835ca94mr12488258wru.187.1667330477607; Tue, 01 Nov 2022 12:21:17 -0700 (PDT) Received: from pwmachine.numericable.fr (85-170-25-210.rev.numericable.fr. [85.170.25.210]) by smtp.gmail.com with ESMTPSA id h17-20020a5d6e11000000b002356c051b9csm10755732wrz.66.2022.11.01.12.21.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 12:21:17 -0700 (PDT) From: Francis Laniel To: u-boot@lists.denx.de Cc: Michael Nazzareno Trimarchi , Tom Rini , Aleksandar Gerasimovski , Holger Brunck , Francis Laniel , Simon Glass , Masahisa Kojima , Heinrich Schuchardt , Philippe Reynes , Ovidiu Panait , Ashok Reddy Soma , Patrick Delaunay , Thomas Huth , Artem Lapkin Subject: [RFC PATCH v5 09/24] cli: Add menu for hush parser Date: Tue, 1 Nov 2022 20:20:14 +0100 Message-Id: <20221101192029.10231-10-francis.laniel@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221101192029.10231-1-francis.laniel@amarulasolutions.com> References: <20221101192029.10231-1-francis.laniel@amarulasolutions.com> MIME-Version: 1.0 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.6 at phobos.denx.de X-Virus-Status: Clean For the moment, the menu contains only entry: HUSH_OLD_PARSER which is the default. The goal is to prepare the field to add a new hush parser which guarantees actual behavior is still correct. Signed-off-by: Francis Laniel --- cmd/Kconfig | 21 +++++++++++++++++++++ common/Makefile | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index 3f6bc70d43..c15d7c51f7 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -23,6 +23,27 @@ config HUSH_PARSER If disabled, you get the old, much simpler behaviour with a somewhat smaller memory footprint. +menu "Hush flavor to use" + depends on HUSH_PARSER + + 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. + + It is actually the default U-Boot shell when decided to use hush as shell. + + config HUSH_2021_PARSER + bool "Use hush 2021 parser" + help + This option enables the new flavor of hush based on hush Busybox from + 2021. + + For the moment, it is highly experimental and should be used at own risks. +endmenu + config CMDLINE_EDITING bool "Enable command line editing" depends on CMDLINE diff --git a/common/Makefile b/common/Makefile index 20addfb244..360a155af3 100644 --- a/common/Makefile +++ b/common/Makefile @@ -8,7 +8,8 @@ ifndef CONFIG_SPL_BUILD obj-y += init/ obj-y += main.o obj-y += exports.o -obj-$(CONFIG_HUSH_PARSER) += cli_hush.o +obj-$(CONFIG_HUSH_OLD_PARSER) += cli_hush.o +obj-$(CONFIG_HUSH_2021_PARSER) += cli_hush_2021.o obj-$(CONFIG_AUTOBOOT) += autoboot.o # # boards