summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:05:15 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:22:26 +0100
commitc79ab34a7c597c9e3ab202c644121c6944789424 (patch)
tree324691f4f851c719b864229b399584f035b2873f /functions
parent0d5ff4ca7596790f853cf637e0fe225cad810a76 (diff)
downloadvyos-live-build-c79ab34a7c597c9e3ab202c644121c6944789424.tar.gz
vyos-live-build-c79ab34a7c597c9e3ab202c644121c6944789424.zip
Adding live-helper 1.0~a19-1.
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/common.sh2
-rwxr-xr-xfunctions/defaults.sh3
-rwxr-xr-xfunctions/package.sh28
-rwxr-xr-xfunctions/templates.sh25
4 files changed, 39 insertions, 19 deletions
diff --git a/functions/common.sh b/functions/common.sh
index 8c1bca531..24212c4fd 100755
--- a/functions/common.sh
+++ b/functions/common.sh
@@ -10,4 +10,4 @@
set -e
PROGRAM="`basename ${0}`"
-VERSION="1.0~a18"
+VERSION="1.0~a19"
diff --git a/functions/defaults.sh b/functions/defaults.sh
index a5b9e73cc..098a87f23 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -584,6 +584,9 @@ Set_defaults ()
esac
fi
+ # Setting chroot option
+ LIVE_CHROOT_BUILD="${LIVE_CHROOT_BUILD:-enabled}"
+
# Setting debian-installer option
LIVE_DEBIAN_INSTALLER="${LIVE_DEBIAN_INSTALLER:-disabled}"
diff --git a/functions/package.sh b/functions/package.sh
index 3d11873c2..96316dcc2 100755
--- a/functions/package.sh
+++ b/functions/package.sh
@@ -11,18 +11,32 @@ set -e
Check_package ()
{
- FILE="${1}"
+ ITEM="${1}"
PACKAGE="${2}"
- if [ ! -f "${FILE}" ]
- then
- PACKAGES="${PACKAGES} ${PACKAGE}"
- fi
+ case "${LIVE_CHROOT_BUILD}" in
+ enabled)
+ if [ ! -d "${ITEM}" ] && [ ! -f "${ITEM}" ]
+ then
+ PACKAGES="${PACKAGES} ${PACKAGE}"
+ fi
+ ;;
+
+ disabled)
+ ITEM="`echo ${ITEM} | sed -e 's/chroot//'`"
+
+ if [ ! -d "${ITEM}" ] && [ ! -f "${ITEM}" ]
+ then
+ Echo_error "You need to install ${PACKAGE} on your host system."
+ exit 1
+ fi
+ ;;
+ esac
}
Install_package ()
{
- if [ -n "${PACKAGES}" ]
+ if [ -n "${PACKAGES}" ] && [ "${LIVE_CHROOT_BUILD}" != "disabled" ]
then
case "${LH_APT}" in
apt|apt-get)
@@ -38,7 +52,7 @@ Install_package ()
Remove_package ()
{
- if [ -n "${PACKAGES}" ]
+ if [ -n "${PACKAGES}" ] && [ "${LIVE_CHROOT_BUILD}" != "disabled" ]
then
case "${LH_APT}" in
apt|apt-get)
diff --git a/functions/templates.sh b/functions/templates.sh
index 9fbc36549..6b60c9e9a 100755
--- a/functions/templates.sh
+++ b/functions/templates.sh
@@ -11,22 +11,25 @@ set -e
Check_templates ()
{
- PROGRAM="${1}"
+ ITEM="${1}"
- # Check local templates
- if [ -d config/templates/"${PROGRAM}" ]
+ # Check user defined templates directory
+ if [ ! -d "${LIVE_TEMPLATES}" ]
then
- LIVE_TEMPLATES="config/templates"
+ if [ -d config/templates ]
+ then
+ LIVE_TEMPLATES=config/templates
+ else
+ Echo_error "templates not accessible in ${LIVE_TEMPLATES} nor config/templates"
+ exit 1
+ fi
fi
- # Checking user templates
- if [ ! -d "${LIVE_TEMPLATES}" ]
- then
- Echo_error "user specified templates not accessible in ${LIVE_TEMPLATES}"
- exit 1
- elif [ ! -d "${LIVE_TEMPLATES}/${PROGRAM}" ]
+ if [ -d "${LIVE_TEMPLATES}/${ITEM}" ]
then
- Echo_error "${PROGRAM} templates not accessible in ${LIVE_TEMPLATES}"
+ TEMPLATES="${LIVE_TEMPLATES}/${ITEM}"
+ else
+ Echo_error "${ITEM} templates not accessible in ${LIVE_TEMPLATES}"
exit 1
fi
}