From patchwork Thu Aug 13 01:37:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 1343971 X-Patchwork-Delegate: wd@denx.de 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=85.214.62.61; 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=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=EXAk51jm; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4BRq2N1ddDz9sTR for ; Thu, 13 Aug 2020 11:37:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DC9D981B45; Thu, 13 Aug 2020 03:37:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EXAk51jm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 632B081B50; Thu, 13 Aug 2020 03:37:41 +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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (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 74BD8812FE for ; Thu, 13 Aug 2020 03:37:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=judge.packham@gmail.com Received: by mail-pl1-x642.google.com with SMTP id q19so1931753pll.0 for ; Wed, 12 Aug 2020 18:37:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=q7V45Lzt5HvdcGcRL34hpjxTrLkSZB5vedqMxARGiTQ=; b=EXAk51jmsD/V9lBGxZm+4QuwDJCQ0KhvNrjj6qPnHX5Gu67MTHhw4rcTs9gzoQthna ZJQbnLhEhkA37IvkXjrwh2alcElyv0I9+zYKdnGojTRVy54WLzbKWnb+a8pUqs9V4ZK9 fVwtJRVHS1jke5xfVhkN0+3eJfuiwmGWXY1hr5GoUspMTd3oyDZ/wf30MtWsvmvQ339/ 95pQ70bb0ivEhpmbverl2+cc0IORHAwKGylU+xpgAIGPQ/iHxhfU/Tc58+qJnj0zJYI0 pcvAss1vtSXd3t25o2Asya0vITN7EKm3GilueRhA5ahf1TRqL9Hr12TOZhq7V7elq9qB vbtg== 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=q7V45Lzt5HvdcGcRL34hpjxTrLkSZB5vedqMxARGiTQ=; b=suxY5HgSG1xkAwMAsC9CB4ZjgiHcu6TPUom2ViQOMdSUZG9GBxfkb+wWfIvr5N5Dky E82J6O1o2xOXQFffC5zK57529fdnHVoDR9kog6ce44JU0DiyqP/Hp7V85oP08H43C65D nW668ZIDY4CnnDPbJi5mQLkEN0D1MxAJz80Ki/i+8iy+QZdtI6sJ8tE4KyfEmyQK7UVB KmOihNai0/nQD3heboKVOH950/34UjQx4HqqxeNMS+tLaC/O7HRNLBV92K2w2GS5hOtM 6mhG5QYWkMrH6wLr/beXkVlcx0IxwskUb7MVeXIGxqERoXQv8FcAL1M8BylJYT/1ZE1E 8Dfg== X-Gm-Message-State: AOAM531BTYMHZDAl4jlCIzrKxybys9nwd+3HHrQq7LfjS/nGKlJoXytz MqOKbpZ7sPBzuYLDZJz0pYU= X-Google-Smtp-Source: ABdhPJwpCDOsvDnDPt4LXQZ04UZ4DadDRb90+VOlCPGbTaw3mP1RXwJQ7PvQ3TA79YMXkCnWZuieHg== X-Received: by 2002:a17:90a:de83:: with SMTP id n3mr2479475pjv.62.1597282656836; Wed, 12 Aug 2020 18:37:36 -0700 (PDT) Received: from chrisp-dl.atlnz.lc ([2001:df5:b000:22:d16b:1fb6:8a89:ae9d]) by smtp.gmail.com with ESMTPSA id v128sm3721368pfc.14.2020.08.12.18.37.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 18:37:36 -0700 (PDT) From: Chris Packham To: sjg@chromium.org, trini@konsulko.com Cc: Chris Packham , Joe Hershberger , Wolfgang Denk , u-boot@lists.denx.de Subject: [RFC PATCH] tools: env: Add an option to have an empty default environment Date: Thu, 13 Aug 2020 13:37:27 +1200 Message-Id: <20200813013727.8186-1-judge.packham@gmail.com> X-Mailer: git-send-email 2.28.0 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 When building envtools via tools-only_defconfig the builtin defaults are based on options in the defconfig. For example: bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm bootdelay=2 baudrate=115200 stdin=serial,cros-ec-keyb,usbkbd stdout=serial,vidconsole stderr=serial,vidconsole ethaddr=00:00:11:22:33:44 eth3addr=00:00:11:22:33:45 eth5addr=00:00:11:22:33:46 eth6addr=00:00:11:22:33:47 ipaddr=1.2.3.4 bootm_size=0x10000000 kernel_addr_r=0x1000000 fdt_addr_r=0xc00000 ramdisk_addr_r=0x2000000 scriptaddr=0x1000 pxefile_addr_r=0x2000 These may or may not be sensible for any particular target. Rather than trying to have a set of defaults that work for every target add a config option to make the default environment completely empty. Signed-off-by: Chris Packham Acked-by: Joe Hershberger --- configs/tools-only_defconfig | 1 + env/Kconfig | 7 +++++++ include/env_default.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/configs/tools-only_defconfig b/configs/tools-only_defconfig index a853abf2b8fc..0ddd0518ef9a 100644 --- a/configs/tools-only_defconfig +++ b/configs/tools-only_defconfig @@ -12,6 +12,7 @@ CONFIG_BOOTP_DNS2=y CONFIG_OF_CONTROL=y CONFIG_OF_HOSTFILE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_EMPTY_DEFAULT_ENV=y CONFIG_BOOTP_SEND_HOSTNAME=y CONFIG_IP_DEFRAG=y # CONFIG_ACPIGEN is not set diff --git a/env/Kconfig b/env/Kconfig index af4d9cbaa4d8..f7860f01cc16 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -614,6 +614,13 @@ config DEFAULT_ENV_FILE containing key=value pairs, blank lines and lines beginning with # are ignored. +config EMPTY_DEFAULT_ENV + bool "Create an empty default environment" + help + Create an empty default environment. This is intended to be + used when building generic target tools and no sensible + default that can be included. + config ENV_VARS_UBOOT_RUNTIME_CONFIG bool "Add run-time information to the environment" help diff --git a/include/env_default.h b/include/env_default.h index 8a0c3057f0aa..859188a8e7c9 100644 --- a/include/env_default.h +++ b/include/env_default.h @@ -23,6 +23,7 @@ static char default_environment[] = { const uchar default_environment[] = { #endif #ifndef CONFIG_USE_DEFAULT_ENV_FILE +#ifndef CONFIG_EMPTY_DEFAULT_ENV #ifdef CONFIG_ENV_CALLBACK_LIST_DEFAULT ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0" #endif @@ -107,6 +108,7 @@ const uchar default_environment[] = { #endif #ifdef CONFIG_EXTRA_ENV_SETTINGS CONFIG_EXTRA_ENV_SETTINGS +#endif #endif "\0" #else /* CONFIG_USE_DEFAULT_ENV_FILE */