summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-11-19 08:56:03 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-11-19 09:20:21 +0000
commit4ff2e9a9046851329369b2de6f2b254a797264a9 (patch)
tree265e358c989366a6aad0d5c75b518491fda39b2d
parentRewriting makefile. (diff)
downloadsystem-build-tmp-daniel.tar.xz
system-build-tmp-daniel.zip
Adding init command stub (FIXME).tmp-daniel
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
-rwxr-xr-xlib/build/init88
1 files changed, 88 insertions, 0 deletions
diff --git a/lib/build/init b/lib/build/init
new file mode 100755
index 000000000..8183917e4
--- /dev/null
+++ b/lib/build/init
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+# system-build - Build Debian-based system images
+# Copyright (C) 2006-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+COMMAND="$(basename ${0})"
+
+Parameters ()
+{
+ LONG_OPTIONS="distribution:,mirror:,mirror-security:,"
+ OPTIONS="d:,n:,"
+
+ PARAMETERS="$(getopt --longoptions ${LONG_OPTIONS} --name=${COMMAND} --options ${OPTIONS} --shell sh -- ${@})"
+
+ if [ "${?}" != "0" ]
+ then
+ echo "'${COMMAND}': getopt exit" >&2
+ exit 1
+ fi
+
+ eval set -- "${PARAMETERS}"
+
+ while true
+ do
+ case "${1}" in
+ -d|--distribution)
+ DISTRIBUTION="${2}"
+ shift 2
+ ;;
+
+ -m|--mirror)
+ MIRROR="${2}"
+ shift 2
+ ;;
+
+ --mirror-security)
+ MIRROR_SECURITY="${2}"
+ shift 2
+ ;;
+
+ --)
+ shift 1
+ break
+ ;;
+
+ *)
+ echo "'${COMMAND}': getopt error" >&2
+ exit 1
+ ;;
+ esac
+ done
+}
+
+Usage ()
+{
+ echo "Usage: build ${COMMAND} -n|--name NAME" >&2
+ exit 1
+}
+
+Parameters "${@}"
+
+# Defaults
+DISTRIBUTION="${DISTRIBUTION:-stretch}"
+MIRROR="${MIRROR:-https://deb.debian.org/debian}"
+MIRROR_SECURITY="${MIRROR_SECURITY:-http://security.debian.org}"
+
+# Configuration: Archives
+mkdir -p config/archives
+
+case "${DISTRIBUTION}" in
+ dschinn)
+
+cat >>