Commit e84b0820 authored by Alessandro Elias's avatar Alessandro Elias
Browse files

Merge branch 'issue/555' into 'develop'

SCRUM#555: Make preconfiguration file to store and initialize variables that can be changed by parameters

See merge request !12
parents e6641bcc aa7de148
_HELP=false
_DIST=""
_ARCH="amd64"
_REPO="stable"
...@@ -20,10 +20,9 @@ ...@@ -20,10 +20,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA. # USA.
_HELP=false export PREFIX=$(pwd)
_DIST="nodistro" source ${PREFIX}/conf/pre.conf \
_ARCH="amd64" || log ERROR "Preconfiguration file not found"
_REPO="stable"
while true; do while true; do
case "$1" in case "$1" in
...@@ -37,7 +36,7 @@ while true; do ...@@ -37,7 +36,7 @@ while true; do
done done
if [ ${_HELP} = true ]; then if [ ${_HELP} = true ]; then
echo "Usage: sudo $0 [OPTION] [ARGUMENT]..." echo "Usage: $0 [OPTION] [ARGUMENT]..."
echo "" echo ""
echo "Examples:" echo "Examples:"
echo " sudo $0 --distro le6/testing # Generate default arch (amd64) le6 iso image" echo " sudo $0 --distro le6/testing # Generate default arch (amd64) le6 iso image"
...@@ -51,8 +50,8 @@ if [ ${_HELP} = true ]; then ...@@ -51,8 +50,8 @@ if [ ${_HELP} = true ]; then
exit 2 exit 2
fi fi
if [ ${_DIST} = "nodistro" ]; then if [ -z ${_DIST} ]; then
echo "No distro. Try with --help." echo "No distro specified. Try with --help."
exit 1 exit 1
fi fi
...@@ -71,10 +70,8 @@ if [ "$(id -u)" != "0" ]; then ...@@ -71,10 +70,8 @@ if [ "$(id -u)" != "0" ]; then
exit -1 exit -1
fi fi
export PREFIX=$(pwd)
source ${PREFIX}/conf/$_DIST/create-iso.conf \ source ${PREFIX}/conf/$_DIST/create-iso.conf \
|| log ERROR "configuration file not found for dist: \"${_DIST}\"" || log ERROR "Configuration file not found for dist: \"${_DIST}\""
source common.sh source common.sh
source lib/mktmpfs.sh source lib/mktmpfs.sh
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment