MT#17673 Switch deployment.sh self-updates to available repositories

Noticed the following errors during Carrier mr4.3 installation:
> Installing apt-transport-https
> ...
> Err http://web01:9998 wheezy/main amd64 Packages
>   404  Not Found
> Err http://web01:9998 wheezy/contrib amd64 Packages
>  404  Not Found
> Err http://web01:9998 wheezy/non-free amd64 Packages
>   404  Not Found
> WReading package lists...: Failed to fetch http://web01:9998/debian/dists/wheezy/main/binary-amd64/Packages  404  Not Found
> W: Failed to fetch http://web01:9998/debian/dists/wheezy/contrib/binary-amd64/Packages  404  Not Found
> W: Failed to fetch http://web01:9998/debian/dists/wheezy/non-free/binary-amd64/Packages  404  Not Found

Which is correct as there is no wheezy repository in Approx.
We should use appropriate ${DEBIAN_RELEASE} repository.

Notes:
 * apt-transport-https from jessie repo is good enough,
   switch from wheezy to jessie
 * fai-setup-storage liblinux-lvm-perl from jessie repo is good enough,
   cleanup the update code here
 * virtualbox-guest-additions-iso from jessie repo is good enough,
   switch from wheezy-backports to jessie
 * augeas-tools from jessie is good enough,
   switch from wheezy to jessie

Change-Id: I0de23b673da61b332af9fd9cfbcb36fb9b99d0d6
(cherry picked from commit 9835b801e0)
mr4.2
Alexander Lutay 9 years ago
parent e4009be1c0
commit 5a733b04d2

@ -212,7 +212,7 @@ install_apt_transport_https () {
local TMPDIR=$(mktemp -d)
mkdir -p "${TMPDIR}/etc/preferences.d" "${TMPDIR}/statedir/lists/partial" \
"${TMPDIR}/cachedir/archives/partial"
echo "deb http://${DEBIAN_REPO_HOST}/debian/ wheezy main contrib non-free" > \
echo "deb http://${DEBIAN_REPO_HOST}/debian/ ${DEBIAN_RELEASE} main contrib non-free" > \
"${TMPDIR}/etc/sources.list"
DEBIAN_FRONTEND='noninteractive' apt-get -o dir::cache="${TMPDIR}/cachedir" \
@ -225,46 +225,6 @@ install_apt_transport_https () {
-y --no-install-recommends install apt-transport-https
}
# see MT#6253
fai_upgrade() {
upgrade=false # upgrade only if needed
local required_version=4.2.4+0
local present_version=$(dpkg-query --show --showformat='${Version}' fai-setup-storage)
if dpkg --compare-versions $present_version lt $required_version ; then
echo "fai-setup-storage version $present_version is older than minimum required version $required_version - upgrading."
upgrade=true
fi
local required_version=0.17-2
local present_version=$(dpkg-query --show --showformat='${Version}' liblinux-lvm-perl)
if dpkg --compare-versions $present_version lt $required_version ; then
echo "liblinux-lvm-perl version $present_version is older than minimum required version $required_version - upgrading."
upgrade=true
fi
if ! "$upgrade" ; then
echo "fai-setup-storage and liblinux-lvm-perl are OK already, nothing to do about it."
return 0
fi
# use temporary apt database for speed reasons
local TMPDIR=$(mktemp -d)
mkdir -p "${TMPDIR}/statedir/lists/partial" "${TMPDIR}/cachedir/archives/partial"
local debsrcfile=$(mktemp)
echo "deb ${SIPWISE_REPO_TRANSPORT}://${SIPWISE_REPO_HOST}/wheezy-backports wheezy-backports main" >> "$debsrcfile"
DEBIAN_FRONTEND='noninteractive' apt-get -o dir::cache="${TMPDIR}/cachedir" \
-o dir::state="${TMPDIR}/statedir" -o dir::etc::sourcelist="$debsrcfile" \
-o Dir::Etc::sourceparts=/dev/null update
DEBIAN_FRONTEND='noninteractive' apt-get -o dir::cache="${TMPDIR}/cachedir" \
-o dir::state="${TMPDIR}/statedir" -o dir::etc::sourcelist="$debsrcfile" \
-o Dir::Etc::sourceparts=/dev/null -y install fai-setup-storage liblinux-lvm-perl
}
grml_debootstrap_upgrade() {
local required_version=0.67
local present_version=$(dpkg-query --show --showformat='${Version}' grml-debootstrap)
@ -296,7 +256,7 @@ install_vbox_package() {
local TMPDIR=$(mktemp -d)
mkdir -p "${TMPDIR}/etc/preferences.d" "${TMPDIR}/statedir/lists/partial" \
"${TMPDIR}/cachedir/archives/partial"
echo "deb ${SIPWISE_REPO_TRANSPORT}://${DEBIAN_REPO_HOST}/debian/ wheezy-backports non-free" > \
echo "deb ${SIPWISE_REPO_TRANSPORT}://${DEBIAN_REPO_HOST}/debian/ ${DEBIAN_RELEASE} non-free" > \
"${TMPDIR}/etc/sources.list"
DEBIAN_FRONTEND='noninteractive' apt-get -o dir::cache="${TMPDIR}/cachedir" \
@ -315,21 +275,7 @@ ensure_augtool_present() {
return 0
fi
echo "augtool isn't present, installing augeas-tools package:"
local TMPDIR=$(mktemp -d)
mkdir -p "${TMPDIR}/etc/preferences.d" "${TMPDIR}/statedir/lists/partial" \
"${TMPDIR}/cachedir/archives/partial"
echo "deb ${SIPWISE_REPO_TRANSPORT}://${DEBIAN_REPO_HOST}/debian/ wheezy main" > \
"${TMPDIR}/etc/sources.list"
DEBIAN_FRONTEND='noninteractive' apt-get -o dir::cache="${TMPDIR}/cachedir" \
-o dir::state="${TMPDIR}/statedir" -o dir::etc="${TMPDIR}/etc" \
-o dir::etc::trustedparts="/etc/apt/trusted.gpg.d/" update
DEBIAN_FRONTEND='noninteractive' apt-get -o dir::cache="${TMPDIR}/cachedir" \
-o dir::etc="${TMPDIR}/etc" -o dir::state="${TMPDIR}/statedir" \
-o dir::etc::trustedparts="/etc/apt/trusted.gpg.d/" \
-y --no-install-recommends install augeas-tools
apt-get -y --no-install-recommends install augeas-tools
}
### }}}
@ -757,9 +703,6 @@ install_apt_transport_https
set_deploy_status "grml_debootstrap_upgrade"
grml_debootstrap_upgrade
set_deploy_status "fai_upgrade"
fai_upgrade
if "$NGCP_INSTALLER" ; then
set_deploy_status "ensure_augtool_present"
ensure_augtool_present

Loading…
Cancel
Save