summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2012-01-23 13:42:47 +0100
committerDaniel Baumann <daniel@debian.org>2012-02-06 23:15:11 +0100
commit43105e7a2d56ad2ea7feeace3cef410203277a9a (patch)
tree031d35dadeed548630ade895c2156e46c5a3348e
parent98932c4edfcdfb7086b4cd90049158cc398c3bba (diff)
downloadvyos-live-build-43105e7a2d56ad2ea7feeace3cef410203277a9a.tar.gz
vyos-live-build-43105e7a2d56ad2ea7feeace3cef410203277a9a.zip
Autodetecting mode depending on which distribution we're building.
-rwxr-xr-xfunctions/defaults.sh23
1 files changed, 22 insertions, 1 deletions
diff --git a/functions/defaults.sh b/functions/defaults.sh
index 97fc6016e..d4c16d490 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -26,7 +26,28 @@ Set_defaults ()
LB_SYSTEM="${LB_SYSTEM:-live}"
# Setting mode (currently: debian, emdebian, progress, ubuntu and kubuntu)
- LB_MODE="${LB_MODE:-debian}"
+ if [ -x /usr/bin/lsb_release ]
+ then
+ _DISTRIBUTOR="$(lsb_release -is | tr [A-Z] [a-z])"
+
+ case "${_DISTRIBUTOR}" in
+ debian|progress|ubuntu)
+ LB_MODE="${LB_MODE:-${_DISTRIBUTOR}}"
+ ;;
+
+ *)
+ LB_MODE="${LB_MODE:-debian}"
+ ;;
+ esac
+ else
+ if [ -e /etc/progress_version ]
+ then
+ LB_MODE="${LB_MODE:-progress}"
+ elif [ -e /etc/ubuntu_version ]
+ then
+ LB_MODE="${LB_MODE:-ubuntu}"
+ fi
+ fi
# Setting distribution name
case "${LB_MODE}" in