Run check_version and validate_config before to perform any other task.
Asking user confirmation for confuguration options.
This commit is contained in:
parent
0a7e5d0ebe
commit
13e816f9fc
1 changed files with 44 additions and 38 deletions
64
master.sh
64
master.sh
|
@ -232,24 +232,6 @@ while test $# -gt 0 ; do
|
|||
shift
|
||||
done
|
||||
|
||||
|
||||
# Prevents setting "-d /" by mistake.
|
||||
|
||||
if [ $BUILDDIR = / ] ; then
|
||||
echo -ne "\nThe root directory can't be used to build LFS.\n\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If $BUILDDIR has subdirectories like tools/ or bin/, stop the run
|
||||
# and notify the user about that.
|
||||
|
||||
if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
|
||||
eval "$no_empty_builddir"
|
||||
fi
|
||||
|
||||
# If requested, clean the build directory
|
||||
clean_builddir
|
||||
|
||||
# Find the download client to use, if not already specified.
|
||||
|
||||
if [ -z $DL ] ; then
|
||||
|
@ -274,6 +256,41 @@ fi
|
|||
BOOK=${BOOK:=$PROGNAME-$LFSVRS}
|
||||
#===================================================
|
||||
|
||||
|
||||
# Check for minumum gcc and kernel versions
|
||||
#check_requirements 1 # 0/1 0-do not display values.
|
||||
check_version "2.6.2" "`uname -r`" "KERNEL"
|
||||
check_version "3.0" "$BASH_VERSION" "BASH"
|
||||
check_version "3.0" "`gcc -dumpversion`" "GCC"
|
||||
echo "---------------${nl_}"
|
||||
|
||||
validate_config 1 # 0/1 0-do not display values
|
||||
echo "---------------${nl_}"
|
||||
|
||||
echo -n "Are yoy happy with that settings (yes/no) (no): "
|
||||
read ANSWER
|
||||
if [ x$ANSWER != "xyes" ] ; then
|
||||
echo "${nl_}Fix the configuration options and rerun the script.${nl_}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Prevents setting "-d /" by mistake.
|
||||
|
||||
if [ $BUILDDIR = / ] ; then
|
||||
echo -ne "\nThe root directory can't be used to build LFS.\n\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If $BUILDDIR has subdirectories like tools/ or bin/, stop the run
|
||||
# and notify the user about that.
|
||||
|
||||
if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
|
||||
eval "$no_empty_builddir"
|
||||
fi
|
||||
|
||||
# If requested, clean the build directory
|
||||
clean_builddir
|
||||
|
||||
if [[ ! -d $JHALFSDIR ]]; then
|
||||
mkdir -pv $JHALFSDIR
|
||||
fi
|
||||
|
@ -293,17 +310,6 @@ fi
|
|||
>$LOGDIR/$LOG
|
||||
echo "---------------${nl_}"
|
||||
|
||||
|
||||
# Check for minumum gcc and kernel versions
|
||||
#check_requirements 1 # 0/1 0-do not display values.
|
||||
check_version "2.6.2" "`uname -r`" "KERNEL"
|
||||
check_version "3.0" "$BASH_VERSION" "BASH"
|
||||
check_version "3.0" "`gcc -dumpversion`" "GCC"
|
||||
echo "---------------${nl_}"
|
||||
|
||||
validate_config 1 # 0/1 0-do not display values
|
||||
echo "---------------${nl_}"
|
||||
|
||||
get_book
|
||||
echo "---------------${nl_}"
|
||||
|
||||
|
|
Reference in a new issue