From d2183da3df124b4db58fa2b65453066758b2f388 Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Fri, 10 Apr 2015 11:55:48 +0200 Subject: [PATCH] MT#8883 Fix 43c9f159: CE Install CD missed pre-scripts/install-sipwise-key.sh During the refactoring in 43c9f159 we missed the point that /etc/debootstrap/pre-scripts/install-sipwise-key.sh should be executed on CE install CD too even if we do NOT download key. Otherwise we are getting: > Reading package lists... > W: GPG error: http://debian.sipwise.com wheezy Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB7765DA42C4F2A > W: GPG error: http://debian.sipwise.com wheezy-security Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB7765DA42C4F2A > W: GPG error: http://debian.sipwise.com wheezy-updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB7765DA42C4F2A and CE installation failed as unauthorized packages cannot be installed. Change-Id: I3ccc8b8801ba2be829c4eea84507f11c841b7658 (cherry picked from commit e5664d5850f5d78ad5b668a3fef301b8c29dbd25) --- deployment.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/deployment.sh b/deployment.sh index 17fcd21..8c04d22 100755 --- a/deployment.sh +++ b/deployment.sh @@ -152,10 +152,21 @@ loadNfsIpArray() { [ "$n" == "7" ] && return 0 || return 1 } +debootstrap_sipwise_key() { + mkdir -p /etc/debootstrap/pre-scripts/ + cat > /etc/debootstrap/pre-scripts/install-sipwise-key.sh << EOF +#!/bin/bash +# installed via deployment.sh +cp /etc/apt/trusted.gpg.d/sipwise.gpg "\${MNTPOINT}"/etc/apt/trusted.gpg.d/ +EOF + chmod 775 /etc/debootstrap/pre-scripts/install-sipwise-key.sh +} + install_sipwise_key() { if [ -f "/etc/apt/trusted.gpg.d/sipwise.gpg" ]; then md5sum_sipwise_key=$(md5sum /etc/apt/trusted.gpg.d/sipwise.gpg | awk '{print $1}') - echo "Sipwise keyring already installed (MD5: [${md5sum_sipwise_key}])" + echo "Sipwise keyring already installed (MD5: [${md5sum_sipwise_key}]), debootstrap sipwise key" + debootstrap_sipwise_key return else echo "Sipwise keyring not found, downloading." @@ -183,13 +194,7 @@ install_sipwise_key() { die "Error validating sipwise keyring for apt usage, aborting installation." fi - mkdir -p /etc/debootstrap/pre-scripts/ - cat > /etc/debootstrap/pre-scripts/install-sipwise-key.sh << EOF -#!/bin/bash -# installed via deployment.sh -cp /etc/apt/trusted.gpg.d/sipwise.gpg "\${MNTPOINT}"/etc/apt/trusted.gpg.d/ -EOF - chmod 775 /etc/debootstrap/pre-scripts/install-sipwise-key.sh + debootstrap_sipwise_key } # see MT#6253