refresh.sh
Note
This script with --silent is obsolete.
The silent option adds default values, however, as of 2017-07-09,
defconfig files are retained in a compressed format, i.e. with default values
removed. So the --silent option will accomplish nothing. Without
--silent, you will have the opportunity to override the default values
from the command line and, in that case, the script may still have some
minimal value.
This is a bash script that automates refreshing board default configuration (defconfig) files. It does not do anything special that you cannot do manually, but is useful for updating dozens of configuration files. It is also used in the NuttX CI process.
Configuration files have to be updated because, over time, the configuration settings change; new configurations are added and new dependencies are added. So an old configuration file may not be usable anymore until it is refreshed.
Help is also available:
$ tools/refresh.sh --help
tools/refresh.sh is a tool for refreshing board configurations
USAGE: tools/refresh.sh [options] (<board>:<config>|<path/to/config/folder>)+
Where [options] include:
--debug
Enable script debug
--silent
Update board configuration without interaction. Implies --defaults.
Assumes no prompt for save. Use --silent --prompt to prompt before saving.
--prompt
Prompt before updating and overwriting the defconfig file. Default is to
prompt unless --silent
--defaults
Do not prompt for new default selections; accept all recommended default values
--nocopy
Do not copy defconfig from nuttx/boards/<board>/configs to nuttx/.config
--help
Show this help message and exit
<board>
The board directory under nuttx/boards/arch/chip/
<config>
The board configuration directory under nuttx/boards/arch/chip/<board>/configs
<archname>
The architecture directory under nuttx/boards/
<chipname>
The chip family directory under nuttx/boards/<arch>/
<path/to/config/folder>
Relative or absolute path the configuration subdirectory
Note1: all configurations are refreshed if <board>:<config> is replaced with "all" keyword
Note2: all configurations of arch XYZ are refreshed if "arch:<namearch>" is passed
Note3: all configurations of chip XYZ are refreshed if "chip:<chipname>" is passed
Note4: all configurations of board XYZ are refreshed if "board:<boardname>" is passed
The steps to refresh the configurations and/or files given to refresh.sh are:
Copy the defconfig file to the top-level NuttX directory as
.configand its correspondingMake.defsfile (being careful to save any previous identically named files that you might want to keep).Execute
make oldconfigto update the configuration.make oldconfigwill prompt you for each change in the configuration that requires that you make some decision. With the--defaultsoption, the script will usemake oldefconfiginstead and you won’t have to answer any question; the refresh will simply accept the default value for any new configuration setting.Execute
make savedefconfigto create the new defconfig file. Any setting set to its default value is stripped down from this file.This will also strip down the
CONFIG_APPS_DIRandCONFIG_BASE_DEFCONFIGsettings. They should not be in checked-in defconfig files because they must be determined each time the configuration is installed.Check for any difference between the generated defconfig and the original configuration file using the
diffutility.If there are differences, it save the new configuration (with or without prompt depending on the
--silentand--promptoptions).Restore the
.configandMake.defsfiles from step 1.
Usage examples
Update all boards without verbose output:
$ ./tools/refresh.sh --defaults all
Update all boards and configs from arm architecture:
$ ./tools/refresh.sh --defaults arch:arm
Update all boards from stm32f7 chip family:
$ ./tools/refresh.sh --defaults chip:stm32f7
Update all configs from stm32f103-minimum board:
$ ./tools/refresh.sh --defaults board:stm32f103-minimum
Update only the nsh config from stm32f103-minimum board:
$ ./tools/refresh.sh --defaults stm32f103-minimum:nsh
Update the hello config from the arduino-mega2560 board and the ostest config
from the sim pseudo-board:
$ ./tools/refresh.sh --defaults arduino-mega2560:hello sim:ostest
Update the nsh config from stm32f103-minimum board, using the path to the
configuration subdirectory:
$ ./tools/refresh.sh --defaults boards/arm/stm32f1/stm32f103-minimum/configs/nsh