summaryrefslogtreecommitdiffstats
path: root/share/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2016-10-25 13:10:17 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2016-10-25 13:10:17 +0000
commit17e90600218e654071457f0845968e143e8c5d15 (patch)
treef58c502fe6dadaef45e1a3844944905837b37e51 /share/scripts
parentAdding upstream version 20160801. (diff)
downloadopen-infrastructure-compute-tools-17e90600218e654071457f0845968e143e8c5d15.tar.xz
open-infrastructure-compute-tools-17e90600218e654071457f0845968e143e8c5d15.zip
Adding upstream version 20161101.upstream/20161101
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-rwxr-xr-xshare/scripts/debconf73
-rw-r--r--share/scripts/debconf.d/0001-preseed-file.templates3
-rwxr-xr-xshare/scripts/debconf.d/0003-debconf56
-rw-r--r--share/scripts/debconf.d/0003-debconf.templates16
-rwxr-xr-xshare/scripts/debootstrap14
5 files changed, 65 insertions, 97 deletions
diff --git a/share/scripts/debconf b/share/scripts/debconf
index 4c89e6f..4878d98 100755
--- a/share/scripts/debconf
+++ b/share/scripts/debconf
@@ -156,6 +156,9 @@ EOF
Chroot "${DIRECTORY}" "apt-get --yes --option APT::Force-LoopBreak=true upgrade"
Chroot "${DIRECTORY}" "apt-get --yes --option APT::Force-LoopBreak=true dist-upgrade"
+ # Install systemd support packages
+ Chroot "${DIRECTORY}" "apt-get --yes install dbus libpam-systemd systemd-sysv"
+
# Unmount systems apt cache
umount "${DIRECTORY}/var/cache/apt/archives"
@@ -224,19 +227,27 @@ Debootstrap ()
{
DIRECTORY="${1}"
+ INCLUDE="dbus"
+
+ if echo "${MIRROR}" | grep -qs '^https' || \
+ echo "{PARENT_MIRROR}" | grep -qs '^https'
+ then
+ INCLUDE="${INCLUDE},apt-transport-https,ca-certificates"
+ fi
+
# FIXME: trim down, debootstrap variants?
case "${MODE}" in
debian)
- INCLUDE="--include=ifupdown,locales,libui-dialog-perl,dialog,isc-dhcp-client,netbase,net-tools,iproute,wget,dbus,systemd-sysv"
+ INCLUDE="${INCLUDE},ifupdown,locales,libui-dialog-perl,dialog,isc-dhcp-client,netbase,net-tools,iproute,wget"
;;
progress-linux)
- INCLUDE="--include=apt-transport-https,ca-certificates,apt-utils,ifupdown,locales-all,libui-dialog-perl,dialog,isc-dhcp-client,netbase,net-tools,iproute,openssh-server,wget,dbus,libpam-systemd,systemd-sysv"
+ INCLUDE="${INCLUDE},apt-utils,ifupdown,locales-all,libui-dialog-perl,dialog,isc-dhcp-client,netbase,net-tools,iproute,openssh-server,wget"
;;
esac
mkdir -p "$(dirname ${DIRECTORY})"
- debootstrap --verbose --arch=${ARCHITECTURE} --components=${PARENT_ARCHIVE_AREAS} ${INCLUDE} \
+ debootstrap --verbose --arch=${ARCHITECTURE} --components=${PARENT_ARCHIVE_AREAS} --include=${INCLUDE} \
${PARENT_DISTRIBUTION} "${DIRECTORY}" ${PARENT_MIRROR}
}
@@ -319,15 +330,7 @@ EOF
esac
# Import archive keys
- case "${DISTRIBUTION}" in
- *-backports)
- KEYS="project/pgp/archive-key-${DIST}.asc project/pgp/archive-key-${DIST}-backports.asc"
- ;;
-
- *)
- KEYS="project/pgp/archive-key-${DIST}.asc"
- ;;
- esac
+ KEYS="project/pgp/archive-key-${DIST}.asc"
for KEY in ${KEYS}
do
@@ -335,7 +338,7 @@ EOF
echo "P: Fetching archive-key ${KEY_NAME}..."
wget -q "${MIRROR}/${KEY}" -O "${DIRECTORY}/key.asc"
- wget -q "${MIRROR}/${KEY}.sig" -O "${DIRECTORY}/key.asc.sig"
+ wget -q "${MIRROR}/${KEY}.gpg" -O "${DIRECTORY}/key.asc.gpg"
if [ -e /usr/bin/gpgv ]
then
@@ -350,7 +353,7 @@ EOF
echo -n "I: Verifying archive-key ${KEY_NAME} against $(basename ${KEYRING} .gpg | sed -e 's|-keyring||') keyring..."
# FIXME: doesn't work anymore when the template eventually be run with 'set -e'
- /usr/bin/gpgv --quiet --keyring ${KEYRING} "${DIRECTORY}/key.asc.sig" "${DIRECTORY}/key.asc" > /dev/null 2>&1 && KEY_VALID="true" && break
+ /usr/bin/gpgv --quiet --keyring ${KEYRING} "${DIRECTORY}/key.asc.gpg" "${DIRECTORY}/key.asc" > /dev/null 2>&1 && KEY_VALID="true" && break
fi
done
@@ -375,7 +378,7 @@ EOF
Chroot "${DIRECTORY}" "apt-key add key.asc"
rm -f "${DIRECTORY}/key.asc"
- rm -f "${DIRECTORY}/key.asc.sig"
+ rm -f "${DIRECTORY}/key.asc.gpg"
done
Chroot "${DIRECTORY}" "apt-get update"
@@ -536,11 +539,21 @@ Configure_system ()
;;
${DIST}-extras)
- echo "deb ${MIRROR} ${DIST}-extras ${AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
+ if echo "${AREA}" | grep -qs non-free
+ then
+ echo "deb ${MIRROR} ${DIST}-extras ${AREA} restricted" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
+ else
+ echo "deb ${MIRROR} ${DIST}-extras ${AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
+ fi
;;
${DIST}-extras-staging)
- echo "deb ${MIRROR} ${DIST}-extras-staging ${AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
+ if echo "${AREA}" | grep -qs non-free
+ then
+ echo "deb ${MIRROR} ${DIST}-extras-staging ${AREA} restricted" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
+ else
+ echo "deb ${MIRROR} ${DIST}-extras-staging ${AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
+ fi
;;
${DIST}-backports)
@@ -552,11 +565,21 @@ Configure_system ()
;;
${DIST}-backports-extras)
- echo "deb ${MIRROR} ${DIST}-backports-extras ${AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
+ if echo "${AREA}" | grep -qs non-free
+ then
+ echo "deb ${MIRROR} ${DIST}-backports-extras ${AREA} restricted" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
+ else
+ echo "deb ${MIRROR} ${DIST}-backports-extras ${AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
+ fi
;;
${DIST}-backports-extras-staging)
- echo "deb ${MIRROR} ${DIST}-backports-extras-staging ${AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
+ if echo "${AREA}" | grep -qs non-free
+ then
+ echo "deb ${MIRROR} ${DIST}-backports-extras-staging ${AREA} restricted" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
+ else
+ echo "deb ${MIRROR} ${DIST}-backports-extras-staging ${AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
+ fi
;;
esac
done
@@ -726,10 +749,8 @@ EOF
eval IPV4_COMMENT="$`echo NETWORK${NUMBER}_IPV4_COMMENT`"
eval IPV4_METHOD="$`echo NETWORK${NUMBER}_IPV4_METHOD`"
eval IPV4_ADDRESS="$`echo NETWORK${NUMBER}_IPV4_ADDRESS`"
- eval IPV4_BROADCAST="$`echo NETWORK${NUMBER}_IPV4_BROADCAST`"
eval IPV4_GATEWAY="$`echo NETWORK${NUMBER}_IPV4_GATEWAY`"
eval IPV4_NETMASK="$`echo NETWORK${NUMBER}_IPV4_NETMASK`"
- eval IPV4_NETWORK="$`echo NETWORK${NUMBER}_IPV4_NETWORK`"
eval IPV4_POST_UP="$`echo NETWORK${NUMBER}_IPV4_POST_UP`"
eval IPV4_POST_DOWN="$`echo NETWORK${NUMBER}_IPV4_POST_DOWN`"
@@ -771,11 +792,6 @@ iface eth${NUMBER} inet static
address ${IPV4_ADDRESS}
EOF
- if [ -n "${IPV4_BROADCAST}" ]
- then
- echo " broadcast ${IPV4_BROADCAST}" >> "${DIRECTORY}/etc/network/interfaces.tmp"
- fi
-
if [ -n "${IPV4_GATEWAY}" ]
then
echo " gateway ${IPV4_GATEWAY}" >> "${DIRECTORY}/etc/network/interfaces.tmp"
@@ -786,11 +802,6 @@ EOF
echo " netmask ${IPV4_NETMASK}" >> "${DIRECTORY}/etc/network/interfaces.tmp"
fi
- if [ -n "${IPV4_NETWORK}" ]
- then
- echo " network ${IPV4_NETWORK}" >> "${DIRECTORY}/etc/network/interfaces.tmp"
- fi
-
if [ -n "${IPV4_POST_UP}" ]
then
echo " post-up ${IPV4_POST_UP}" >> "${DIRECTORY}/etc/network/interfaces.tmp"
diff --git a/share/scripts/debconf.d/0001-preseed-file.templates b/share/scripts/debconf.d/0001-preseed-file.templates
index 98b07e9..707da95 100644
--- a/share/scripts/debconf.d/0001-preseed-file.templates
+++ b/share/scripts/debconf.d/0001-preseed-file.templates
@@ -12,6 +12,7 @@ Template: cnt-debconf/preseed-file
Type: string
Default:
Description: Enter (optional) preseed file to use:
- Preseed file anyone?
+ A preseed file can be used to automatically answer questions to this
+ container create script.
.
If you do not want to use a preseed file, leave this question empty.
diff --git a/share/scripts/debconf.d/0003-debconf b/share/scripts/debconf.d/0003-debconf
index 548fb07..c0944fa 100755
--- a/share/scripts/debconf.d/0003-debconf
+++ b/share/scripts/debconf.d/0003-debconf
@@ -35,15 +35,15 @@ Distribution ()
db_subst cnt-debconf/distribution CHOICES "Debian GNU/Linux 8 \"jessie\", Debian GNU/Linux 9 \"stretch\", Debian GNU/Linux unstable/sid"
db_subst cnt-debconf/distribution CHOICES_C "jessie, stretch, sid"
- db_set cnt-debconf/distribution jessie
+ db_set cnt-debconf/distribution stretch
db_fset cnt-debconf/distribution seen false
;;
progress-linux)
- db_subst cnt-debconf/distribution CHOICES "Progress Linux 3 (cairon), Progress Linux 3+ (cairon-backports)"
- db_subst cnt-debconf/distribution CHOICES_C "cairon, cairon-backports"
+ db_subst cnt-debconf/distribution CHOICES "Progress Linux 4 (dschinn), Progress Linux 4+ (dschinn-backports)"
+ db_subst cnt-debconf/distribution CHOICES_C "dschinn, dschinn-backports"
- db_set cnt-debconf/distribution cairon-backports
+ db_set cnt-debconf/distribution dschinn-backports
db_fset cnt-debconf/distribution seen false
;;
esac
@@ -70,8 +70,8 @@ Parent_distribution ()
case "${MODE}" in
progress-linux)
case "${DISTRIBUTION}" in
- cairon*)
- PARENT_DISTRIBUTION="jessie"
+ dschinn*)
+ PARENT_DISTRIBUTION="stretch"
;;
esac
;;
@@ -298,7 +298,7 @@ Mirror ()
then
case "${MODE}" in
debian)
- db_set cnt-debconf/mirror http://ftp.debian.org/debian
+ db_set cnt-debconf/mirror https://deb.debian.org/debian
db_fset cnt-debconf/mirror seen false
;;
@@ -319,7 +319,7 @@ Mirror ()
then
case "${MODE}" in
debian)
- MIRROR="http://ftp.debian.org/debian"
+ MIRROR="https://deb.debian.org/debian"
;;
progress-linux)
@@ -391,7 +391,7 @@ Parent_mirror ()
then
case "${MODE}" in
progress-linux)
- db_set cnt-debconf/parent-mirror http://ftp.debian.org/debian
+ db_set cnt-debconf/parent-mirror https://deb.debian.org/debian
db_fset cnt-debconf/parent-mirror seen false
db_settitle cnt-debconf/title
@@ -412,7 +412,7 @@ Parent_mirror ()
then
case "${MODE}" in
progress-linux)
- PARENT_MIRROR="http://ftp.debian.org/debian"
+ PARENT_MIRROR="https://deb.debian.org/debian"
;;
*)
@@ -711,18 +711,12 @@ Network ()
db_get cnt-debconf/network0/ipv4-address
NETWORK0_IPV4_ADDRESS="${RET}" # string (w/o empty)
- db_get cnt-debconf/network0/ipv4-broadcast
- NETWORK0_IPV4_BROADCAST="${RET}" # string (w/ empty)
-
db_get cnt-debconf/network0/ipv4-gateway
NETWORK0_IPV4_GATEWAY="${RET}" # string (w/ empty)
db_get cnt-debconf/network0/ipv4-netmask
NETWORK0_IPV4_NETMASK="${RET}" # string (w/o empty)
- db_get cnt-debconf/network0/ipv4-network
- NETWORK0_IPV4_NETWORK="${RET}" # string (w/ empty)
-
db_get cnt-debconf/network0/ipv4-post-up
NETWORK0_IPV4_POST_UP="${RET}" # string (w/ empty)
@@ -758,18 +752,12 @@ Network ()
db_set cnt-debconf/network0/ipv4-address "${NETWORK0_IPV4_ADDRESS}"
db_fset cnt-debconf/network0/ipv4-address seen false
- db_set cnt-debconf/network0/ipv4-broadcast "${NETWORK0_IPV4_BROADCAST}"
- db_fset cnt-debconf/network0/ipv4-broadcast seen false
-
db_set cnt-debconf/network0/ipv4-gateway "${NETWORK0_IPV4_GATEWAY}"
db_fset cnt-debconf/network0/ipv4-gateway seen false
db_set cnt-debconf/network0/ipv4-netmask "${NETWORK0_IPV4_NETMASK}"
db_fset cnt-debconf/network0/ipv4-netmask seen false
- db_set cnt-debconf/network0/ipv4-network "${NETWORK0_IPV4_NETWORK}"
- db_fset cnt-debconf/network0/ipv4-network seen false
-
db_set cnt-debconf/network0/ipv4-post-up "${NETWORK0_IPV4_POST_UP}"
db_fset cnt-debconf/network0/ipv4-post-up seen false
@@ -815,10 +803,6 @@ Network ()
db_go
db_settitle cnt-debconf/title
- db_input high cnt-debconf/network0/ipv4-broadcast || true
- db_go
-
- db_settitle cnt-debconf/title
db_input high cnt-debconf/network0/ipv4-gateway || true
db_go
@@ -827,10 +811,6 @@ Network ()
db_go
db_settitle cnt-debconf/title
- db_input high cnt-debconf/network0/ipv4-network || true
- db_go
-
- db_settitle cnt-debconf/title
db_input high cnt-debconf/network0/ipv4-post-up || true
db_go
@@ -873,11 +853,6 @@ Network ()
eval NETWORK${NUMBER}_IPV4_ADDRESS="\"${RET}\"" # string (w/o empty)
fi
- if db_get cnt-debconf/network${NUMBER}/ipv4-broadcast
- then
- eval NETWORK${NUMBER}_IPV4_BROADCAST="\"${RET}\"" # string (w/ empty)
- fi
-
if db_get cnt-debconf/network${NUMBER}/ipv4-gateway
then
eval NETWORK${NUMBER}_IPV4_GATEWAY="\"${RET}\"" # string (w/ empty)
@@ -888,11 +863,6 @@ Network ()
eval NETWORK${NUMBER}_IPV4_NETMASK="\"${RET}\"" # string (w/o empty)
fi
- if db_get cnt-debconf/network${NUMBER}/ipv4-network
- then
- eval NETWORK${NUMBER}_IPV4_NETWORK="\"${RET}\"" # string (w/ empty)
- fi
-
if db_get cnt-debconf/network${NUMBER}/ipv4-post-up
then
eval NETWORK${NUMBER}_IPV4_POST_UP="\"${RET}\"" # string (w/ empty)
@@ -941,18 +911,12 @@ Network ()
eval ADDRESS="$`echo NETWORK${NUMBER}_IPV4_ADDRESS`"
echo "NETWORK${NUMBER}_IPV4_ADDRESS=\"${ADDRESS}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
- eval BROADCAST="$`echo NETWORK${NUMBER}_IPV4_BROADCAST`"
- echo "NETWORK${NUMBER}_IPV4_BROADCAST=\"${BROADCAST}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
-
eval GATEWAY="$`echo NETWORK${NUMBER}_IPV4_GATEWAY`"
echo "NETWORK${NUMBER}_IPV4_GATEWAY=\"${GATEWAY}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
eval NETMASK="$`echo NETWORK${NUMBER}_IPV4_NETMASK`"
echo "NETWORK${NUMBER}_IPV4_NETMASK=\"${NETMASK}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
- eval NETWORK="$`echo NETWORK${NUMBER}_IPV4_NETWORK`"
- echo "NETWORK${NUMBER}_IPV4_NETWORK=\"${NETWORK}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
-
eval POST_UP="$`echo NETWORK${NUMBER}_IPV4_POST_UP`"
echo "NETWORK${NUMBER}_IPV4_POST_UP=\"${POST_UP}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
diff --git a/share/scripts/debconf.d/0003-debconf.templates b/share/scripts/debconf.d/0003-debconf.templates
index 82a7ca1..e46fa88 100644
--- a/share/scripts/debconf.d/0003-debconf.templates
+++ b/share/scripts/debconf.d/0003-debconf.templates
@@ -130,14 +130,6 @@ Description: Ethernet IP Address (IPv4)?
.
This defaults to 192.168.1.2.
-Template: cnt-debconf/network0/ipv4-broadcast
-Type: string
-Default:
-Description: Ethernet Broadcast Address (IPv4)?
- What should be the broadcast address of the current system?
- .
- This defaults to empty.
-
Template: cnt-debconf/network0/ipv4-gateway
Type: string
Default:
@@ -154,14 +146,6 @@ Description: Ethernet Network Mask (IPv4)?
.
This defaults to empty.
-Template: cnt-debconf/network0/ipv4-network
-Type: string
-Default:
-Description: Ethernet Network Address (IPv4)?
- What should be the network address of the current system?
- .
- This defaults to empty.
-
Template: cnt-debconf/network0/ipv4-post-up
Type: string
Default:
diff --git a/share/scripts/debootstrap b/share/scripts/debootstrap
index de9e501..1ead471 100755
--- a/share/scripts/debootstrap
+++ b/share/scripts/debootstrap
@@ -125,13 +125,21 @@ then
fi
ARCHITECTURE="${ARCHITECTURE:-$(dpkg --print-architecture)}"
-DISTRIBUTION="${DISTRIBUTION:-jessie}"
-MIRROR="${MIRROR:-http://ftp.debian.org/debian}"
+DISTRIBUTION="${DISTRIBUTION:-stretch}"
+MIRROR="${MIRROR:-https://deb.debian.org/debian}"
PASSWORD="${PASSWORD:-$(dd if=/dev/urandom bs=12 count=1 2> /dev/null | base64)}"
+INCLUDE="dbus"
+
+case "${MIRROR}" in
+ https*)
+ INCLUDE="${INCLUDE},apt-transport-https,ca-certificates"
+ ;;
+esac
+
mkdir -p "${MACHINES}"
-debootstrap --arch=${ARCHITECTURE} --include=dbus ${DISTRIBUTION} ${MACHINES}/${NAME} ${MIRROR}
+debootstrap --arch=${ARCHITECTURE} --include=${INCLUDE} ${DISTRIBUTION} ${MACHINES}/${NAME} ${MIRROR}
chroot "${MACHINES}/${NAME}" apt-get clean
# Setting hostname