summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2012-12-13 18:51:54 +0100
committerDaniel Baumann <daniel@debian.org>2012-12-13 18:51:54 +0100
commit3f19c0c3576f067b827aade6be90041eb57fcf0c (patch)
treead7b3a7b16a42c1f5f1a88e70622abb473affe6e /scripts/build
parent1f07481fbc688b73dcd93551ddb3f6357cef3dc2 (diff)
downloadvyos-live-build-3f19c0c3576f067b827aade6be90041eb57fcf0c.tar.gz
vyos-live-build-3f19c0c3576f067b827aade6be90041eb57fcf0c.zip
Adding support for live-images configs and arbitrary configuration directories in lb_config --config option.
Diffstat (limited to 'scripts/build')
-rwxr-xr-xscripts/build/config31
1 files changed, 21 insertions, 10 deletions
diff --git a/scripts/build/config b/scripts/build/config
index f3b575441..b563ee955 100755
--- a/scripts/build/config
+++ b/scripts/build/config
@@ -874,17 +874,28 @@ fi
if [ -n "${_CONFIG}" ]
then
- _GIT_REPOSITORY="$(echo ${_CONFIG} | sed -e 's|::.*$||')"
-
- Echo_message "Cloning ${_GIT_REPOSITORY}"
- git clone ${_GIT_REPOSITORY} ./
-
- if [ "${_GIT_REPOSITORY}" != "${_CONFIG}" ]
+ if [ -e "${_CONFIG}" ] || [ -e "/usr/share/live/images/${_CONFIG}" ]
then
- _GIT_BRANCH="$(echo ${_CONFIG} | awk -F\:\: '{ print $NF }')"
-
- Echo_message "Checking out ${_GIT_BRANCH}"
- git checkout ${_GIT_BRANCH}
+ if [ ! -e "${_CONFIG}" ] && [ -e "/usr/share/live/images/${_CONFIG}" ]
+ then
+ _CONFIG="/usr/share/live/images/${_CONFIG}"
+ fi
+
+ Echo_message "Copying ${_CONFIG}"
+ tar -C "${_CONFIG}" -c . | tar -C ./ -x
+ else
+ _GIT_REPOSITORY="$(echo ${_CONFIG} | sed -e 's|::.*$||')"
+
+ Echo_message "Cloning ${_GIT_REPOSITORY}"
+ git clone ${_GIT_REPOSITORY} ./
+
+ if [ "${_GIT_REPOSITORY}" != "${_CONFIG}" ]
+ then
+ _GIT_BRANCH="$(echo ${_CONFIG} | awk -F\:\: '{ print $NF }')"
+
+ Echo_message "Checking out ${_GIT_BRANCH}"
+ git checkout ${_GIT_BRANCH}
+ fi
fi
if [ -e auto/config ]