tools/refresh.sh: Now runs make savedefconfig before copying the new defconfig file in place; Also, added a new option --defaults. Since the number of defaults that you now have to answer is so large, the option lets you just accept the default values. So it works just like --slilent but still prompts you for the decision to save or discard the new defconfig file.
This commit is contained in:
parent
ef1eb97660
commit
a49ec44427
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# refresh.sh
|
# refresh.sh
|
||||||
#
|
#
|
||||||
# Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2014, 2016-2017 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -37,6 +37,7 @@ ADVICE="Try '$0 --help' for more information"
|
|||||||
|
|
||||||
unset CONFIG
|
unset CONFIG
|
||||||
silent=n
|
silent=n
|
||||||
|
defaults=n
|
||||||
|
|
||||||
while [ ! -z "$1" ]; do
|
while [ ! -z "$1" ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
@ -45,6 +46,10 @@ while [ ! -z "$1" ]; do
|
|||||||
;;
|
;;
|
||||||
--silent )
|
--silent )
|
||||||
silent=y
|
silent=y
|
||||||
|
defaults=y
|
||||||
|
;;
|
||||||
|
--defaults )
|
||||||
|
defaults=y
|
||||||
;;
|
;;
|
||||||
--help )
|
--help )
|
||||||
echo "$0 is a tool for refreshing board configurations"
|
echo "$0 is a tool for refreshing board configurations"
|
||||||
@ -56,6 +61,8 @@ while [ ! -z "$1" ]; do
|
|||||||
echo " Enable script debug"
|
echo " Enable script debug"
|
||||||
echo " --silent"
|
echo " --silent"
|
||||||
echo " Update board configuration without interaction"
|
echo " Update board configuration without interaction"
|
||||||
|
echo " --defaults"
|
||||||
|
echo " Do not prompt for new default selections; accept all recommended default values"
|
||||||
echo " --help"
|
echo " --help"
|
||||||
echo " Show this help message and exit"
|
echo " Show this help message and exit"
|
||||||
echo " <board>"
|
echo " <board>"
|
||||||
@ -180,23 +187,27 @@ cp -a $MAKEDEFS Make.defs || \
|
|||||||
|
|
||||||
# Then run oldconfig or oldefconfig
|
# Then run oldconfig or oldefconfig
|
||||||
|
|
||||||
if [ "X${silent}" == "Xy" ]; then
|
if [ "X${defaults}" == "Xy" ]; then
|
||||||
make olddefconfig
|
make olddefconfig
|
||||||
else
|
else
|
||||||
make oldconfig
|
make oldconfig
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Run savedefconfig to create the new defconfig file
|
||||||
|
|
||||||
|
make savedefconfig
|
||||||
|
|
||||||
# Show differences
|
# Show differences
|
||||||
|
|
||||||
sed -i -e "s/^CONFIG_APPS_DIR/# CONFIG_APPS_DIR/g" .config
|
# sed -i -e "s/^CONFIG_APPS_DIR/# CONFIG_APPS_DIR/g" defconfig
|
||||||
$CMPCONFIG $DEFCONFIG .config
|
$CMPCONFIG $DEFCONFIG defconfig
|
||||||
|
|
||||||
# Save the refreshed configuration
|
# Save the refreshed configuration
|
||||||
|
|
||||||
if [ "X${silent}" == "Xy" ]; then
|
if [ "X${silent}" == "Xy" ]; then
|
||||||
echo "Saving the new configuration file"
|
echo "Saving the new configuration file"
|
||||||
mv .config $DEFCONFIG || \
|
mv defconfig $DEFCONFIG || \
|
||||||
{ echo "ERROR: Failed to move .config to $DEFCONFIG"; exit 1; }
|
{ echo "ERROR: Failed to move defconfig to $DEFCONFIG"; exit 1; }
|
||||||
chmod 644 $DEFCONFIG
|
chmod 644 $DEFCONFIG
|
||||||
else
|
else
|
||||||
read -p "Save the new configuration (y/n)?" -n 1 -r
|
read -p "Save the new configuration (y/n)?" -n 1 -r
|
||||||
@ -204,8 +215,8 @@ else
|
|||||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||||
then
|
then
|
||||||
echo "Saving the new configuration file"
|
echo "Saving the new configuration file"
|
||||||
mv .config $DEFCONFIG || \
|
mv defconfig $DEFCONFIG || \
|
||||||
{ echo "ERROR: Failed to move .config to $DEFCONFIG"; exit 1; }
|
{ echo "ERROR: Failed to move defconfig to $DEFCONFIG"; exit 1; }
|
||||||
chmod 644 $DEFCONFIG
|
chmod 644 $DEFCONFIG
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user