From patchwork Fri Mar 4 03:58:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 85366 X-Patchwork-Delegate: wd@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B88EBB70E8 for ; Fri, 4 Mar 2011 14:58:22 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EDD8E28089; Fri, 4 Mar 2011 04:58:18 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CoMi4xfA39+D; Fri, 4 Mar 2011 04:58:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1BE8828084; Fri, 4 Mar 2011 04:58:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DC33228084 for ; Fri, 4 Mar 2011 04:58:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cRFuv6VvlTvr for ; Fri, 4 Mar 2011 04:58:13 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by theia.denx.de (Postfix) with ESMTPS id 10AA928083 for ; Fri, 4 Mar 2011 04:58:10 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 34F061B400B for ; Fri, 4 Mar 2011 03:58:07 +0000 (UTC) From: Mike Frysinger To: u-boot@lists.denx.de Date: Thu, 3 Mar 2011 22:58:13 -0500 Message-Id: <1299211093-16609-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1294638366-32527-1-git-send-email-vapier@gentoo.org> References: <1294638366-32527-1-git-send-email-vapier@gentoo.org> Subject: [U-Boot] [PATCH v2] env: make import/export optional X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Mike Frysinger --- README | 2 ++ common/cmd_nvedit.c | 8 ++++++++ include/config_cmd_defaults.h | 2 ++ 3 files changed, 12 insertions(+), 0 deletions(-) diff --git a/README b/README index faee6fb..1773f00 100644 --- a/README +++ b/README @@ -632,6 +632,7 @@ The following options need to be configured: CONFIG_CMD_EDITENV edit env variable CONFIG_CMD_EEPROM * EEPROM read/write support CONFIG_CMD_ELF * bootelf, bootvx + CONFIG_CMD_EXPORTENV * export the environment CONFIG_CMD_SAVEENV saveenv CONFIG_CMD_FDC * Floppy Disk Support CONFIG_CMD_FAT * FAT partition support @@ -644,6 +645,7 @@ The following options need to be configured: CONFIG_CMD_IMI iminfo CONFIG_CMD_IMLS List all found images CONFIG_CMD_IMMAP * IMMR dump support + CONFIG_CMD_IMPORTENV * import an environment CONFIG_CMD_IRQ * irqinfo CONFIG_CMD_ITEST Integer/string test of 2 values CONFIG_CMD_JFFS2 * JFFS2 Support diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index fb69c24..715dffd 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -559,6 +559,7 @@ static int do_env_delete(cmd_tbl_t * cmdtp, int flag, int argc, char * const arg return 0; } +#ifdef CONFIG_CMD_EXPORTENV /* * env export [-t | -b | -c] addr [size] * -t: export as text format; if size is given, data will be @@ -695,7 +696,9 @@ sep_err: cmd); return 1; } +#endif +#ifdef CONFIG_CMD_IMPORTENV /* * env import [-d] [-t | -b | -c] addr [size] * -d: delete existing environment before importing; @@ -805,6 +808,7 @@ sep_err: cmd); return 1; } +#endif #if defined(CONFIG_CMD_RUN) extern int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); @@ -822,8 +826,12 @@ static cmd_tbl_t cmd_env_sub[] = { #if defined(CONFIG_CMD_EDITENV) U_BOOT_CMD_MKENT(edit, 2, 0, do_env_edit, "", ""), #endif +#if defined(CONFIG_CMD_EXPORTENV) U_BOOT_CMD_MKENT(export, 4, 0, do_env_export, "", ""), +#endif +#if defined(CONFIG_CMD_IMPORTENV) U_BOOT_CMD_MKENT(import, 5, 0, do_env_import, "", ""), +#endif U_BOOT_CMD_MKENT(print, CONFIG_SYS_MAXARGS, 1, do_env_print, "", ""), #if defined(CONFIG_CMD_RUN) U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""), diff --git a/include/config_cmd_defaults.h b/include/config_cmd_defaults.h index 9283daa..6adebdb 100644 --- a/include/config_cmd_defaults.h +++ b/include/config_cmd_defaults.h @@ -10,5 +10,7 @@ #define _CONFIG_CMD_DEFAULTS_H_ #define CONFIG_CMD_BOOTM 1 +#define CONFIG_CMD_EXPORTENV 1 +#define CONFIG_CMD_IMPORTENV 1 #endif