1
0
mirror of synced 2026-02-14 11:24:10 +00:00

Merge commit 'refs/merge-requests/2' of git://gitorious.org/xen-tools/xen-tools into merge-requests/2

This commit is contained in:
Axel Beckert
2012-05-08 00:30:36 +02:00
8 changed files with 61 additions and 16 deletions

View File

@@ -204,6 +204,10 @@ xen-create-image - Easily create new Xen instances with networking and OpenSSH.
to choose a more or less close Debian mirror. See
http://wiki.debian.org/DebianGeoMirror for details.
--apt_proxy=url
Specify a proxy to be used by debootstrap, and within
the guest.
--template=tmpl
Specify which template file to use when creating the
Xen configuration file.
@@ -1364,6 +1368,7 @@ sub setupDefaultOptions
foreach my $ubuntudist (qw(edgy feisty gutsy intrepid jaunty karmic maverick)) {
$CONFIG{ 'mirror_'.$ubuntudist } = 'http://old-releases.ubuntu.com/ubuntu';
}
$CONFIG{ 'apt_proxy' } = '';
$CONFIG{ 'arch' } = '';
$CONFIG{ 'fs' } = 'ext3';
$CONFIG{ 'force' } = 0;
@@ -1710,6 +1715,7 @@ sub parseCommandLineArguments
"kernel=s", \&checkOption,
"initrd=s", \&checkOption,
"mirror=s", \&checkOption,
"apt_proxy=s", \&checkOption,
"modules=s", \&checkOption,
"lvm=s", \$install{ 'lvm' },
"image-dev=s", \$install{ 'image-dev' },
@@ -3576,6 +3582,15 @@ sub installSystem
}
#
# Propagate --apt_proxy
#
if ( $CONFIG{ 'apt_proxy' } )
{
$cmd .= " --apt_proxy=$CONFIG{'apt_proxy'}";
}
#
# Show the user what they are installing
#

View File

@@ -27,6 +27,7 @@ xt-install-image - Install a fresh copy of GNU/Linux into a directory
--config Read the specified config file in addition to the global
configuration file.
--mirror The mirror to use when installing with 'debootstrap'.
--apt_proxy The proxy to use when installing with 'debootstrap'.
Installation Options:
--install-method Specify the installation method to use.
@@ -395,6 +396,7 @@ sub parseCommandLineArguments
"cachedir=s", \$CONFIG{ 'cachedir' },
"config=s", \$CONFIG{ 'config' },
"mirror=s", \$CONFIG{ 'mirror' },
"apt_proxy=s", \$CONFIG{ 'apt_proxy' },
# Help.
"verbose", \$CONFIG{ 'verbose' },
@@ -757,12 +759,21 @@ sub do_debootstrap
$EXTRA .= " --arch $CONFIG{'arch'}";
}
#
# Setup http_proxy so that debootstrap pulls files through the apt-proxy
#
my $PROXY = '';
if ( $CONFIG{ 'apt_proxy' } )
{
print("Using apt_proxy: $CONFIG{'apt_proxy'}\n");
$PROXY = "http_proxy=\"$CONFIG{'apt_proxy'}\"";
}
#
# This is the command we'll run
#
my $command =
"$cmd $EXTRA $CONFIG{'dist'} $CONFIG{'location'} $CONFIG{'mirror'}";
"$PROXY $cmd $EXTRA $CONFIG{'dist'} $CONFIG{'location'} $CONFIG{'mirror'}";
#
# Run the command.

View File

@@ -282,6 +282,10 @@ mirror = `xt-guess-suite-and-mirror --mirror`
# mirror_precise = http://archive.ubuntu.com/ubuntu
# mirror_quantal = http://archive.ubuntu.com/ubuntu
# If this is defined it will be used by debootstrap, and configured as the
# proxy for the guest
#
# apt_proxy =
#
# Filesystem options for the different filesystems we support.

View File

@@ -33,9 +33,12 @@ logMessage Script $0 starting
# replicate that setup in our new guest via apt-config dump and save
# the setting to the proxy guess file.
#
logMessage The use of a proxy detected.
apt-config dump | grep -i Acquire::HTTP::Proxy \
> ${prefix}/etc/apt/apt.conf.d/proxy-guess
if [ ${apt_proxy} ]; then
echo "Acquire::http::Proxy \"${apt_proxy}\";" > ${prefix}/etc/apt/apt.conf.d/01proxy
else
logMessage The use of a proxy detected.
apt-config dump | grep -i Acquire::HTTP::Proxy > ${prefix}/etc/apt/apt.conf.d/01proxy
fi
#

View File

@@ -32,9 +32,12 @@ logMessage Script $0 starting
# replicate that setup in our new guest via apt-config dump and save
# the setting to the proxy guess file.
#
logMessage The use of a proxy detected.
apt-config dump | grep -i Acquire::HTTP::Proxy \
> ${prefix}/etc/apt/apt.conf.d/proxy-guess
if [ ${apt_proxy} ]; then
echo "Acquire::http::Proxy \"${apt_proxy}\";" > ${prefix}/etc/apt/apt.conf.d/01proxy
else
logMessage The use of a proxy detected.
apt-config dump | grep -i Acquire::HTTP::Proxy > ${prefix}/etc/apt/apt.conf.d/01proxy
fi
#

View File

@@ -33,9 +33,12 @@ logMessage Script $0 starting
# replicate that setup in our new guest via apt-config dump and save
# the setting to the proxy guess file.
#
logMessage The use of a proxy detected.
apt-config dump | grep -i Acquire::HTTP::Proxy \
> ${prefix}/etc/apt/apt.conf.d/proxy-guess
if [ ${apt_proxy} ]; then
echo "Acquire::http::Proxy \"${apt_proxy}\";" > ${prefix}/etc/apt/apt.conf.d/01proxy
else
logMessage The use of a proxy detected.
apt-config dump | grep -i Acquire::HTTP::Proxy > ${prefix}/etc/apt/apt.conf.d/01proxy
fi
#

View File

@@ -33,9 +33,12 @@ logMessage Script $0 starting
# replicate that setup in our new guest via apt-config dump and save
# the setting to the proxy guess file.
#
logMessage The use of a proxy detected.
apt-config dump | grep -i Acquire::HTTP::Proxy \
> ${prefix}/etc/apt/apt.conf.d/proxy-guess
if [ ${apt_proxy} ]; then
echo "Acquire::http::Proxy \"${apt_proxy}\";" > ${prefix}/etc/apt/apt.conf.d/01proxy
else
logMessage The use of a proxy detected.
apt-config dump | grep -i Acquire::HTTP::Proxy > ${prefix}/etc/apt/apt.conf.d/01proxy
fi
#

View File

@@ -33,9 +33,12 @@ logMessage Script $0 starting
# replicate that setup in our new guest via apt-config dump and save
# the setting to the proxy guess file.
#
logMessage The use of a proxy detected.
apt-config dump | grep -i Acquire::HTTP::Proxy \
> ${prefix}/etc/apt/apt.conf.d/proxy-guess
if [ ${apt_proxy} ]; then
echo "Acquire::http::Proxy \"${apt_proxy}\";" > ${prefix}/etc/apt/apt.conf.d/01proxy
else
logMessage The use of a proxy detected.
apt-config dump | grep -i Acquire::HTTP::Proxy > ${prefix}/etc/apt/apt.conf.d/01proxy
fi
#