From: sean chang Date: Fri, 11 Jun 2004 16:06:55 -0700 Subject: [U-Boot-Users] problem with saveenv command if CFG_ENV_IS_IN_EEPROM... Message-ID: <6cf7690b67f9.40c9d89f@usc.edu> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi all, A quick question. If I have my environment variables stored in eeprom (i.e. define CFG_ENV_IS_IN_EEPROM), I should be able to use the saveenv command to save any user modified env values back to eeprom right? But U_BOOT_CMD saveenv does not get compiled unless I have defined both CFG_CMD_ENV and CFG_CMD_FLASH. Also, if you look at the function do_saveenv, which is called when user uses the saveenv command, it does get compiled if I only define CFG_ENV_IS_IN_EEPROM alone. Am I missing something or is there a problem? Any help is greatly appreciated. Thanks, Sean copied from common/cmd_nvedit.c ================================================================================ #if ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == (CFG_CMD_ENV|CFG_CMD_FLASH)) U_BOOT_CMD( saveenv, 1, 0, do_saveenv, "saveenv - save environment variables to persistent storage\n", NULL ); #endif /* CFG_CMD_ENV */ #if (CONFIG_COMMANDS & CFG_CMD_ASKENV) =================================================================== #if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \ ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \ (CFG_CMD_ENV|CFG_CMD_FLASH)) int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { extern char * env_name_spec; printf ("Saving Environment to %s...\n", env_name_spec); return (saveenv() ? 1 : 0); }