Add default element selection

This change includes the 'base' element by default and adds a
command line switch to prevent this behaviour. This should reduce
confusion since this element is almost always necessary.

Change-Id: Ib4a2ef53a76b119b764751fa21058f4e2cb37741
This commit is contained in:
Chris Jones 2013-01-28 18:24:05 +00:00
parent 9605c7090a
commit 8f96a286d7

View File

@ -33,13 +33,14 @@ function show_options () {
echo " -x -- turn on tracing" echo " -x -- turn on tracing"
echo " -u -- uncompressed; do not compress the image - larger but faster" echo " -u -- uncompressed; do not compress the image - larger but faster"
echo " -c -- clear environment before starting work" echo " -c -- clear environment before starting work"
echo " -n skip the default inclusion of the 'base' element"
echo " -p package[,package,package] -- list of packages to install in the image" echo " -p package[,package,package] -- list of packages to install in the image"
exit 0 exit 0
} }
INSTALL_PACKAGES="" INSTALL_PACKAGES=""
COMPRESS_IMAGE="true" COMPRESS_IMAGE="true"
TEMP=`getopt -o a:ho:xucp: -n $SCRIPTNAME -- "$@"` TEMP=`getopt -o a:ho:xucnp: -n $SCRIPTNAME -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential! # Note the quotes around `$TEMP': they are essential!
@ -53,6 +54,7 @@ while true ; do
-x) shift; set -x;; -x) shift; set -x;;
-u) shift; export COMPRESS_IMAGE="";; -u) shift; export COMPRESS_IMAGE="";;
-c) shift ; export CLEAR_ENV=1;; -c) shift ; export CLEAR_ENV=1;;
-n) shift; export SKIP_BASE="1";;
-p) IFS="," read -a INSTALL_PACKAGES <<< "$2"; export INSTALL_PACKAGES ; shift 2 ;; -p) IFS="," read -a INSTALL_PACKAGES <<< "$2"; export INSTALL_PACKAGES ; shift 2 ;;
--) shift ; break ;; --) shift ; break ;;
*) echo "Internal error!" ; exit 1 ;; *) echo "Internal error!" ; exit 1 ;;
@ -67,6 +69,10 @@ fi
for arg do IMAGE_ELEMENT="$IMAGE_ELEMENT $arg" ; done for arg do IMAGE_ELEMENT="$IMAGE_ELEMENT $arg" ; done
if [ "$SKIP_BASE" != "1" ]; then
IMAGE_ELEMENT="base $IMAGE_ELEMENT"
fi
source $_LIB/img-defaults source $_LIB/img-defaults
source $_LIB/common-functions source $_LIB/common-functions
source $_LIB/img-functions source $_LIB/img-functions