MT#13637 Install apt-transport-https in GRML if not available (using http)

1) we should install apt-transport-https to allow debootstrap through https

2) We should not delete ca-certificates openssl otherwise wget
failed to download ngcp-installer:

> (spce)root@spce:/# wget -4 https://deb.sipwise.com/autobuild/pool/main/n/ngcp-installer//ngcp-installer-ce_0.20.0.0+0~mr4.0.0.0+0~20150626143251.879+wheezy~1.gbp292e36_all.deb
> --2015-06-26 22:02:45--  https://deb.sipwise.com/autobuild/pool/main/n/ngcp-installer//ngcp-installer-ce_0.20.0.0+0~mr4.0.0.0+0~20150626143251.879+wheezy~1.gbp292e36_all.deb
> Resolving deb.sipwise.com (deb.sipwise.com)... 77.244.249.93
> Connecting to deb.sipwise.com (deb.sipwise.com)|77.244.249.93|:443... connected.
> ERROR: The certificate of `deb.sipwise.com' is not trusted.
> ERROR: The certificate of `deb.sipwise.com' hasn't got a known issuer.

Change-Id: I2838edf7b7ea1e9c3ee38d1db6ae2b7f40ae82d7
changes/02/2002/2
Alexander Lutay 10 years ago
parent 81900e059c
commit 364a434d04

@ -200,6 +200,31 @@ install_sipwise_key() {
debootstrap_sipwise_key
}
install_apt_transport_https () {
echo "Installing apt-transport-https"
if dpkg -s apt-transport-https 2>&1 | grep -qE "^Installed" ; then
echo "apt-transport-https is already installed, nothing to do about it."
return 0
fi
# use temporary apt database for speed reasons
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" > \
"${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 apt-transport-https
}
# see MT#6253
fai_upgrade() {
upgrade=false # upgrade only if needed
@ -726,6 +751,9 @@ fi
set_deploy_status "installing_sipwise_keys"
install_sipwise_key
set_deploy_status "installing_apt_transport_https"
install_apt_transport_https
set_deploy_status "grml_debootstrap_upgrade"
grml_debootstrap_upgrade
@ -1306,7 +1334,7 @@ EOF
case "$DEBIAN_RELEASE" in
lenny|squeeze|wheezy)
echo "Removing packages which debootstrap installs but d-i doesn't"
chroot $TARGET apt-get --purge -y remove ca-certificates openssl tcpd xauth
chroot $TARGET apt-get --purge -y remove tcpd xauth
;;
esac

Loading…
Cancel
Save