From patchwork Mon Oct 19 13:55:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1384320 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=D2WUNDz5; 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CFJJ602x6z9sPB for ; Tue, 20 Oct 2020 00:58:29 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 78AC68244E; Mon, 19 Oct 2020 15:56:35 +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="D2WUNDz5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C907182432; Mon, 19 Oct 2020 15:56:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (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 419E2823C9 for ; Mon, 19 Oct 2020 15:56:14 +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-xd43.google.com with SMTP id n6so12946853ioc.12 for ; Mon, 19 Oct 2020 06:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SduR4gtoNMxwqaMzrKU6CZzyy/vjuyvclvSe5fYMwUg=; b=D2WUNDz5OBVdmekwPJRBZLaHQ7bKw0VCt1v8Z1yvleY+rPTjO76EBVHHnCkM8jBl0J fRF38/0Ly1cYsQ1/52LdQaNMuem5VUDIKtHEbAFueVWr6IQN61OJ1TckBfueOuN9+zae lvLHSYhosLl530M59l3b9eFipFm2FNlmNDPpU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SduR4gtoNMxwqaMzrKU6CZzyy/vjuyvclvSe5fYMwUg=; b=UzrewUP6UoIMwpmcXNpdRYI22sXydtwDXvikLLXp8mXYMFaBX6t80D31P8GiE/XMiN gQSYNv/lrttJFaP2l71GR/2eLm1/ygexrGUL8ZJy3c384NJqrCJStFUl4pBFoqac2z3j 1+O9HxjB2wb9eUYOtrhet/NiiJrhJTWDKF2rxUt/97V5k431OHR3MVkbhPR4N0O6+GyA 2E3ZdrQC5H/Qzj94dnKl3OAgqbqk87CH5gEveIDwZtM9rAE2BisQQsuV7W25LMtruvbY X1X7Gj/I1iAjWbL6CFf5jRzTUeSRNMYtKa30oIdzt4f5YkK/rrDlVOzOUxcj3Z1DTlAd IY4g== X-Gm-Message-State: AOAM530tom8/Omk//EthsfF5aDCmNafOXPo+Pdeye41S98wQao775bwq n5fLeTmlJhJtuDx5NmnbfdKlxKBrT0+xExBp X-Google-Smtp-Source: ABdhPJySW4iRZCcWEFnRkoLci+igdvnxjTn2By9E9jhIta5iTTv1m1aJFIDOXj63Sv1onidnzryx1A== X-Received: by 2002:a6b:f909:: with SMTP id j9mr10995642iog.184.1603115767625; Mon, 19 Oct 2020 06:56:07 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id r17sm10164078iov.7.2020.10.19.06.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 06:56:07 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , AKASHI Takahiro , Adam Ford , Alexey Brodkin , Bin Meng , Bin Meng , Daniel Schwierzeck , Heiko Stuebner , Joe Hershberger , John Chau , Marek Vasut , Marek Vasut , Michael Walle , Michal Simek , Ovidiu Panait , Patrice Chotard , Patrick Delaunay , Pedro Aguilar , Philippe Reynes , Ramon Fried , Rasmus Villemoes , Sean Anderson , Tero Kristo , Thomas Hebb , Wolfgang Denk Subject: [PATCH 00/11] bootm: Support substitions in bootargs and add tests Date: Mon, 19 Oct 2020 07:55:51 -0600 Message-Id: <20201019135602.3943835-1-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean This series adds tests to the fixup_silent-linux() function and extends the 'zimage' command to use it. It also adds a new string-substition feature to allow bootargs to be a template, rather than having to build it up piece by piece with information obtained in a build script. It also updates zimage to use the same command-line processing. With these additions it is possible to boot Chrome OS from a U-Boot script on most Chromebooks. Simon Glass (11): env: Allow returning errors from hdelete_r() bootm: Add tests for fixup_silent_linux() bootm: Update fixup_silent_linux() to return an error bootm: Rename fixup_silent_linux() bootm: Add a bool parameter to bootm_process_cmdline_env() bootm: Use size rather than length for CONSOLE_ARG bootm: Split out bootargs environment reading / writing bootm: Update bootm_process_cmdline_env() to use flags bootm: Allow updating the bootargs in a buffer x86: zimage: Add silent-console processing bootm: Support string substitution in bootargs README | 16 +++ arch/Kconfig | 2 + arch/x86/lib/zimage.c | 14 +++ cmd/nvedit.c | 6 +- common/Kconfig.boot | 20 ++++ common/bootm.c | 206 +++++++++++++++++++++++++++++------ include/bootm.h | 40 +++++++ include/search.h | 11 +- include/test/suites.h | 1 + lib/hashtable.c | 12 +-- test/Makefile | 1 + test/bootm.c | 243 ++++++++++++++++++++++++++++++++++++++++++ test/cmd_ut.c | 1 + test/env/hashtable.c | 2 +- 14 files changed, 534 insertions(+), 41 deletions(-) create mode 100644 test/bootm.c