Compare commits
19 Commits
skx-debian
...
release-4.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ed66652ad | ||
|
|
7b29ec1bdf | ||
|
|
31719505f6 | ||
|
|
6338ba62c4 | ||
|
|
3c4e0160ae | ||
|
|
84ee1658d1 | ||
|
|
a28bced5e3 | ||
|
|
8965988439 | ||
|
|
1d6771c719 | ||
|
|
3cb87c09e9 | ||
|
|
a95d576a4e | ||
|
|
9d061fe5a6 | ||
|
|
22a4774cfe | ||
|
|
1b6d3dbdeb | ||
|
|
996e7d7e1f | ||
|
|
97d01456a3 | ||
|
|
aa7a2c4c5e | ||
|
|
3522a919ce | ||
|
|
ef3a15c16c |
10
Makefile
10
Makefile
@@ -12,8 +12,9 @@
|
||||
#
|
||||
# Only used to build distribution tarballs.
|
||||
#
|
||||
TMP ?= /tmp
|
||||
DIST_PREFIX = ${TMP}
|
||||
VERSION = 3.9
|
||||
VERSION = 4.1
|
||||
BASE = xen-tools
|
||||
|
||||
|
||||
@@ -56,7 +57,7 @@ clean:
|
||||
@find . -name '*.tmp' -exec rm \{\} \;
|
||||
@find . -name 'tags' -exec rm \{\} \;
|
||||
@find . -name '*.8.gz' -exec rm \{\} \;
|
||||
@find man -name '*.html' -exec rm \{\} \;
|
||||
@if [ -d man ]; then rm -rf man ; fi
|
||||
@if [ -e build-stamp ]; then rm -f build-stamp ; fi
|
||||
@if [ -e configure-stamp ]; then rm -f configure-stamp ; fi
|
||||
@if [ -d debian/xen-tools ]; then rm -rf ./debian/xen-tools; fi
|
||||
@@ -158,6 +159,8 @@ install-hooks:
|
||||
cp -R hooks/edgy/*-* ${prefix}/usr/lib/xen-tools/edgy.d/
|
||||
-cd ${prefix}/usr/lib/xen-tools/ && ln -s edgy.d feisty.d
|
||||
-cd ${prefix}/usr/lib/xen-tools/ && ln -s edgy.d gutsy.d
|
||||
-cd ${prefix}/usr/lib/xen-tools/ && ln -s edgy.d hardy.d
|
||||
-cd ${prefix}/usr/lib/xen-tools/ && ln -s edgy.d intrepid.d
|
||||
mkdir -p ${prefix}/usr/lib/xen-tools/dapper.d/
|
||||
cp -R hooks/dapper/*-* ${prefix}/usr/lib/xen-tools/dapper.d/
|
||||
mkdir -p ${prefix}/usr/lib/xen-tools/edgy.d/
|
||||
@@ -193,6 +196,7 @@ install: fixup-perms install-bin install-etc install-hooks install-libraries ins
|
||||
# Build our manpages via the `pod2man` command.
|
||||
#
|
||||
manpages:
|
||||
mkdir man
|
||||
cd bin; for i in *-*; do pod2man --release=${VERSION} --official --section=8 $$i ../man/$$i.8; done
|
||||
for i in man/*.8; do gzip --force -9 $$i; done
|
||||
|
||||
@@ -235,7 +239,7 @@ tidy:
|
||||
if [ -x /usr/bin/perltidy ]; then \
|
||||
for i in bin/*-*; do \
|
||||
echo "tidying $$i"; \
|
||||
perltidy -b -nt -bt=2 -sbt=1 -bl -mbl=3 -sbl -bbs -bbb -anl -lp $$i \
|
||||
perltidy $$i \
|
||||
; done \
|
||||
; fi
|
||||
|
||||
|
||||
@@ -73,6 +73,8 @@ xen-create-image - Easily create new Xen instances with networking and OpenSSH.
|
||||
|
||||
--hooks Specify whether to run hooks after the image is created.
|
||||
|
||||
--no-hosts Don't touch /etc/hosts on the dom0.
|
||||
|
||||
--partitions Use a specific partition layout configuration file.
|
||||
Not supported with the image-dev and swap-dev options.
|
||||
Parameters fs, size, swap and noswap are ignored when
|
||||
@@ -661,7 +663,7 @@ my $FAIL = 0;
|
||||
#
|
||||
# Release number.
|
||||
#
|
||||
my $RELEASE = '3.9';
|
||||
my $RELEASE = '4.1';
|
||||
|
||||
|
||||
|
||||
@@ -1336,7 +1338,7 @@ sub parseCommandLineArguments
|
||||
#
|
||||
# Parse options.
|
||||
#
|
||||
GetOptions(
|
||||
if ( !GetOptions(
|
||||
|
||||
# Mandatory
|
||||
"dist=s", \$CONFIG{'dist'},
|
||||
@@ -1359,6 +1361,9 @@ sub parseCommandLineArguments
|
||||
"image-dev=s", \$install{'image-dev'},
|
||||
"swap-dev=s", \$install{'swap-dev'},
|
||||
|
||||
# Host options
|
||||
"no-hosts", \$CONFIG{'nohosts'},
|
||||
|
||||
# Networking options
|
||||
"dhcp", \$CONFIG{'dhcp'},
|
||||
"gateway=s", \$CONFIG{'gateway'},
|
||||
@@ -1367,6 +1372,7 @@ sub parseCommandLineArguments
|
||||
"mac=s", \$CONFIG{'mac'},
|
||||
"netmask=s", \$CONFIG{'netmask'},
|
||||
"broadcast=s", \$CONFIG{'broadcast'},
|
||||
"vifname=s", \$CONFIG{'vifname'},
|
||||
"p2p=s", \$CONFIG{'p2p'},
|
||||
|
||||
# Exclusive
|
||||
@@ -1387,6 +1393,7 @@ sub parseCommandLineArguments
|
||||
"ide", \$CONFIG{'ide'},
|
||||
"install=i", \$CONFIG{'install'},
|
||||
"hooks=i", \$CONFIG{'hooks'},
|
||||
"pygrub", \$CONFIG{'pygrub'},
|
||||
"passwd", \$CONFIG{'passwd'},
|
||||
"partitions=s", \$CONFIG{'partitions'},
|
||||
"role=s", \$CONFIG{'role'},
|
||||
@@ -1404,7 +1411,10 @@ sub parseCommandLineArguments
|
||||
"manual", \$MANUAL,
|
||||
"verbose", \$CONFIG{'verbose'},
|
||||
"version", \$VERSION
|
||||
);
|
||||
) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
pod2usage(1) if $HELP;
|
||||
pod2usage( -verbose => 2 ) if $MANUAL;
|
||||
@@ -1809,9 +1819,17 @@ EOF
|
||||
$CONFIG{'output'} . "/" . $CONFIG{'hostname'} . $CONFIG{'extension'};
|
||||
if ( -e $cfg )
|
||||
{
|
||||
print "Configuration file already exists; $cfg\n";
|
||||
print "Aborting\n";
|
||||
exit 127;
|
||||
if ( $CONFIG{'force'} )
|
||||
{
|
||||
$CONFIG{'verbose'} && print "Removing existing file: $cfg\n";
|
||||
unlink( $cfg );
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Configuration file already exists; $cfg\n";
|
||||
print "Aborting\n";
|
||||
exit 127;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2255,6 +2273,7 @@ sub showSummary
|
||||
logprint("Partitions : ");
|
||||
foreach my $partition (@PARTITIONS)
|
||||
{
|
||||
next if ( !$partition );
|
||||
$info = sprintf( '%-15s %-5s (%s)',
|
||||
( $partition->{'type'} ne 'swap' )
|
||||
? $partition->{'mountpoint'}
|
||||
|
||||
@@ -130,7 +130,7 @@ $CONFIG{'template'} = '/etc/xen-tools/xm-nfs.tmpl';
|
||||
#
|
||||
# Release number.
|
||||
#
|
||||
my $RELEASE = '3.9';
|
||||
my $RELEASE = '4.1';
|
||||
|
||||
|
||||
# store version number away.
|
||||
|
||||
@@ -169,7 +169,7 @@ my %CONFIG;
|
||||
#
|
||||
# Release number.
|
||||
#
|
||||
my $RELEASE = '3.9';
|
||||
my $RELEASE = '4.1';
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ $CONFIG{'prefix'} = "/etc/xen";
|
||||
#
|
||||
# Release number.
|
||||
#
|
||||
my $RELEASE = '3.9';
|
||||
my $RELEASE = '4.1';
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ my %CONFIG;
|
||||
#
|
||||
# Release number.
|
||||
#
|
||||
my $RELEASE = '3.9';
|
||||
my $RELEASE = '4.1';
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ my %CONFIG;
|
||||
#
|
||||
# Release number.
|
||||
#
|
||||
my $RELEASE = '3.9';
|
||||
my $RELEASE = '4.1';
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -156,7 +156,7 @@ $CONFIG{'template'} = '/etc/xen-tools/xm.tmpl';
|
||||
#
|
||||
# Release number.
|
||||
#
|
||||
my $RELEASE = '3.9';
|
||||
my $RELEASE = '4.1';
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ my %CONFIG;
|
||||
#
|
||||
# Release number.
|
||||
#
|
||||
my $RELEASE = '3.9';
|
||||
my $RELEASE = '4.1';
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ my %CONFIG;
|
||||
#
|
||||
# Release number.
|
||||
#
|
||||
my $RELEASE = '3.9';
|
||||
my $RELEASE = '4.1';
|
||||
|
||||
|
||||
#
|
||||
|
||||
19
debian/changelog
vendored
19
debian/changelog
vendored
@@ -1,3 +1,22 @@
|
||||
xen-tools (4.1-1) unstable; urgency=low
|
||||
|
||||
- New command line argument '--no-hosts' to avoid touching /etc/hosts
|
||||
on dom0
|
||||
- New command line argument '--pygrub' to setup a guest for pygrub use.
|
||||
- Generated configuration file should work for --image-dev + --swap-dev
|
||||
again.
|
||||
- Always use /dev/pts for new images.
|
||||
|
||||
-- Steve Kemp <skx@debian.org> Sun, 23 Nov 2008 13:06:01 +0000
|
||||
|
||||
xen-tools (3.9-6) unstable; urgency=low
|
||||
|
||||
- Allow command line flags to be unset.
|
||||
Thanks to Ruud Koolen for the patch.
|
||||
(Closes: #484338)
|
||||
|
||||
-- Steve Kemp <skx@debian.org> Tue, 14 Oct 2008 22:00:22 +0000
|
||||
|
||||
xen-tools (3.9-5) unstable; urgency=medium
|
||||
|
||||
- Record the ARCH for RPM-based distros.
|
||||
|
||||
2
debian/control
vendored
2
debian/control
vendored
@@ -4,7 +4,7 @@ Priority: extra
|
||||
Maintainer: Roland Stigge <stigge@antcom.de>
|
||||
Uploaders: Radu Spineanu <radu@debian.org>, Steve Kemp <skx@debian.org>
|
||||
Build-Depends: debhelper (>= 4.0.0), libtest-pod-perl, libtext-template-perl
|
||||
Standards-Version: 3.7.3
|
||||
Standards-Version: 3.8.0
|
||||
Homepage: http://xen-tools.org/software/xen-tools
|
||||
|
||||
Package: xen-tools
|
||||
|
||||
75
etc/xm.tmpl
75
etc/xm.tmpl
@@ -6,37 +6,76 @@
|
||||
#
|
||||
# Kernel + memory size
|
||||
#
|
||||
{ if ( $kernel )
|
||||
{ if ( ( $kernel ) && ( !defined($pygrub)) )
|
||||
{
|
||||
$OUT.= "kernel = '$kernel'";
|
||||
}
|
||||
}
|
||||
{ if ( $initrd )
|
||||
{ if ( ( $initrd ) && ( !defined($pygrub)) )
|
||||
{
|
||||
$OUT.= "ramdisk = '$initrd'";
|
||||
}
|
||||
}
|
||||
{
|
||||
if ( $pygrub )
|
||||
{
|
||||
$OUT .= "bootloader = '/usr/bin/pygrub'\n";
|
||||
}
|
||||
}
|
||||
memory = '{$memory}'
|
||||
|
||||
#
|
||||
# Disk device(s).
|
||||
#
|
||||
{
|
||||
for ( my $i = 0; $i <= $#PARTITIONS; $i++ )
|
||||
{
|
||||
if ( !defined($image_vbd ) )
|
||||
{
|
||||
for ( my $i = $#PARTITIONS; $i >= 0 ; $i-- )
|
||||
{
|
||||
if ( $PARTITIONS[$i]{'mountpoint'} eq '/' )
|
||||
{
|
||||
$OUT .= "root = '/dev/$device" . ($i + 1) . " ro'\n";
|
||||
}
|
||||
}
|
||||
$OUT .= "disk = [\n";
|
||||
for ( my $i = 0; $i <= $#PARTITIONS; $i++ )
|
||||
{
|
||||
}
|
||||
$OUT .= "disk = [\n";
|
||||
for ( my $i = $#PARTITIONS; $i >= 0 ; $i-- )
|
||||
{
|
||||
$OUT .= " '$PARTITIONS[$i]{'imagetype'}$PARTITIONS[$i]{'image'},$device" . ( $i + 1 ) .",w',\n";
|
||||
}
|
||||
$OUT .= " ]\n";
|
||||
}
|
||||
$OUT .= " ]\n";
|
||||
}
|
||||
|
||||
#
|
||||
# Physical volumes
|
||||
#
|
||||
{
|
||||
if ( ( $swap_vbd ) && ( $image_vbd ) )
|
||||
{
|
||||
$OUT .= "root = '/dev/$device" . "2 ro'\n";
|
||||
|
||||
$OUT .= "disk = [ ";
|
||||
|
||||
if ( $image_vbd )
|
||||
{
|
||||
$OUT .= "'$image_vbd," . $device . "2,w'";
|
||||
|
||||
}
|
||||
|
||||
if ( $swap_vbd )
|
||||
{
|
||||
if ( $image_vbd )
|
||||
{
|
||||
$OUT .= ",";
|
||||
}
|
||||
|
||||
$OUT .= "'$swap_vbd," . $device . "1,w'";
|
||||
}
|
||||
$OUT .= " ]\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Hostname
|
||||
#
|
||||
@@ -52,12 +91,12 @@ name = '{$hostname}'
|
||||
# Setup the mac address, if present.
|
||||
my $m = '';
|
||||
if ( $mac )
|
||||
{
|
||||
{
|
||||
$m = "mac=$mac"
|
||||
}
|
||||
|
||||
$OUT .= "vif = [ '$m' ]";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#
|
||||
@@ -65,12 +104,20 @@ name = '{$hostname}'
|
||||
#
|
||||
my $m = '';
|
||||
if ( $mac )
|
||||
{
|
||||
{
|
||||
$m = ",mac=$mac"
|
||||
}
|
||||
|
||||
$OUT .= "vif = [ 'ip=$ip1";
|
||||
$OUT .= "$m' ]";
|
||||
my $vn = '';
|
||||
if ( $vifname )
|
||||
{
|
||||
$vn = ",vifname=$vifname";
|
||||
}
|
||||
|
||||
$OUT .= "vif = [ 'ip=$ip1";
|
||||
$OUT .= "$m";
|
||||
$OUT .= "$vn";
|
||||
$OUT .= "' ]";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,23 +89,27 @@ if [ -z "${dhcp}" ]; then
|
||||
#
|
||||
name=`echo ${hostname} | awk -F. '{print $1}'`
|
||||
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
if [ -z "${nohosts}" ]; then
|
||||
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
|
||||
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -64,6 +64,7 @@ cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
#
|
||||
# <file system> <mount point> <type> <options> <dump> <pass>
|
||||
proc /proc proc defaults 0 0
|
||||
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
|
||||
E_O_FSTAB
|
||||
for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
eval "PARTITION=\"\${PARTITION${part}}\""
|
||||
@@ -75,7 +76,7 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
x=$(( $x+1 ))
|
||||
done
|
||||
IFS="${OLDIFS}"
|
||||
|
||||
|
||||
case "${partdata2}" in
|
||||
xfs)
|
||||
has_xfs=1
|
||||
@@ -84,7 +85,7 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
has_reiserfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
echo "/dev/${device}${part} none swap sw 0 0" >> ${prefix}/etc/fstab
|
||||
else
|
||||
|
||||
@@ -89,22 +89,24 @@ if [ -z "${dhcp}" ]; then
|
||||
#
|
||||
name=`echo ${hostname} | awk -F. '{print $1}'`
|
||||
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
if [ -z "${nohosts}" ]; then
|
||||
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -89,24 +89,25 @@ if [ -z "${dhcp}" ]; then
|
||||
#
|
||||
name=`echo ${hostname} | awk -F. '{print $1}'`
|
||||
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
if [ -z "${nohosts}" ]; then
|
||||
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
|
||||
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -61,6 +61,7 @@ cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
#
|
||||
# <file system> <mount point> <type> <options> <dump> <pass>
|
||||
proc /proc proc defaults 0 0
|
||||
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
|
||||
E_O_FSTAB
|
||||
for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
eval "PARTITION=\"\${PARTITION${part}}\""
|
||||
@@ -72,7 +73,7 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
x=$(( $x+1 ))
|
||||
done
|
||||
IFS="${OLDIFS}"
|
||||
|
||||
|
||||
case "${partdata2}" in
|
||||
xfs)
|
||||
has_xfs=1
|
||||
@@ -81,7 +82,7 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
has_reiserfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
echo "/dev/${device}${part} none swap sw 0 0" >> ${prefix}/etc/fstab
|
||||
else
|
||||
|
||||
@@ -89,23 +89,24 @@ if [ -z "${dhcp}" ]; then
|
||||
#
|
||||
name=`echo ${hostname} | awk -F. '{print $1}'`
|
||||
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
if [ -z "${nohosts}" ]; then
|
||||
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -60,6 +60,7 @@ cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
#
|
||||
# <file system> <mount point> <type> <options> <dump> <pass>
|
||||
proc /proc proc defaults 0 0
|
||||
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
|
||||
E_O_FSTAB
|
||||
for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
eval "PARTITION=\"\${PARTITION${part}}\""
|
||||
@@ -71,7 +72,7 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
x=$(( $x+1 ))
|
||||
done
|
||||
IFS="${OLDIFS}"
|
||||
|
||||
|
||||
case "${partdata2}" in
|
||||
xfs)
|
||||
has_xfs=1
|
||||
@@ -80,7 +81,7 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
has_reiserfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
echo "/dev/${device}${part} none swap sw 0 0" >> ${prefix}/etc/fstab
|
||||
else
|
||||
|
||||
@@ -41,7 +41,8 @@ cp /etc/resolv.conf ${prefix}/etc
|
||||
#
|
||||
# Process any of the present apt-conf setup lines.
|
||||
#
|
||||
for i in /etc/apt/apt.conf /etc/apt/apt.conf.d/* ; do
|
||||
for i in /etc/apt/apt.conf $(run-parts --list /etc/apt/apt.conf.d) ; do
|
||||
|
||||
|
||||
#
|
||||
# If the file exists. (Need this in case the literal glob fails.)
|
||||
@@ -52,7 +53,8 @@ for i in /etc/apt/apt.conf /etc/apt/apt.conf.d/* ; do
|
||||
# Save the matching line(s) to the proxy guess file.
|
||||
#
|
||||
logMessage The use of a proxy detected.
|
||||
grep -i HTTP::Proxy $i >> ${prefix}/etc/apt/apt.conf.d/proxy-guess
|
||||
|
||||
grep -v '^//' $i | grep -i HTTP::Proxy >>${prefix}/etc/apt/apt.conf.d/proxy-guess
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -42,7 +42,10 @@ if [ ! -z "${serial_device}" ]; then
|
||||
|
||||
# replace existing device.
|
||||
mv ${prefix}/etc/event.d/tty1 ${prefix}/etc/event.d/${serial_device}
|
||||
sed -i -e s/tty1/${serial_device}/ ${prefix}/etc/inittab
|
||||
sed -i -e s/tty1/${serial_device}/ ${prefix}/etc/event.d/${serial_device}
|
||||
[ -f ${prefix}/etc/inittab ] && sed -i -e s/tty1/${serial_device}/ ${prefix}/etc/inittab
|
||||
|
||||
|
||||
|
||||
# make sure that it is allowed to login.
|
||||
echo $serial_device >> ${prefix}/etc/securetty
|
||||
|
||||
@@ -88,23 +88,24 @@ if [ -z "${dhcp}" ]; then
|
||||
#
|
||||
name=`echo ${hostname} | awk -F. '{print $1}'`
|
||||
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
if [ -z "${nohosts}" ]; then
|
||||
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -61,6 +61,7 @@ cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
#
|
||||
# <file system> <mount point> <type> <options> <dump> <pass>
|
||||
proc /proc proc defaults 0 0
|
||||
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
|
||||
E_O_FSTAB
|
||||
for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
eval "PARTITION=\"\${PARTITION${part}}\""
|
||||
@@ -72,7 +73,7 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
x=$(( $x+1 ))
|
||||
done
|
||||
IFS="${OLDIFS}"
|
||||
|
||||
|
||||
case "${partdata2}" in
|
||||
xfs)
|
||||
has_xfs=1
|
||||
@@ -81,7 +82,7 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
has_reiserfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
echo "/dev/${device}${part} none swap sw 0 0" >> ${prefix}/etc/fstab
|
||||
else
|
||||
|
||||
@@ -89,23 +89,25 @@ if [ -z "${dhcp}" ]; then
|
||||
#
|
||||
name=`echo ${hostname} | awk -F. '{print $1}'`
|
||||
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
if [ -z "${nohosts}" ]; then
|
||||
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
|
||||
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -96,23 +96,24 @@ if [ -z "${dhcp}" ]; then
|
||||
#
|
||||
name=`echo ${hostname} | awk -F. '{print $1}'`
|
||||
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
if [ -z "${nohosts}" ]; then
|
||||
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
logMessage Adding ${hostname} and ${name} to /etc/hosts on the host
|
||||
echo "${ip1} ${hostname} ${name}" >> /etc/hosts
|
||||
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
# and there is an installation of dnsmasq installed then
|
||||
# reload it.
|
||||
#
|
||||
# This will let the local LAN clients lookup the new address.
|
||||
#
|
||||
if [ -x /usr/sbin/dnsmasq ] ; then
|
||||
if [ -e /var/run/dnsmasq.pid ]; then
|
||||
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
logMessage Allowing DNSMasq to restart.
|
||||
kill -HUP `cat /var/run/dnsmasq.pid`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -61,6 +61,7 @@ cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
#
|
||||
# <file system> <mount point> <type> <options> <dump> <pass>
|
||||
proc /proc proc defaults 0 0
|
||||
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
|
||||
E_O_FSTAB
|
||||
for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
eval "PARTITION=\"\${PARTITION${part}}\""
|
||||
@@ -72,7 +73,7 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
x=$(( $x+1 ))
|
||||
done
|
||||
IFS="${OLDIFS}"
|
||||
|
||||
|
||||
case "${partdata2}" in
|
||||
xfs)
|
||||
has_xfs=1
|
||||
@@ -81,7 +82,7 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
has_reiserfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
echo "/dev/${device}${part} none swap sw 0 0" >> ${prefix}/etc/fstab
|
||||
else
|
||||
|
||||
41
roles/puppet
Executable file
41
roles/puppet
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This role installs Puppet upon the new guest system.
|
||||
#
|
||||
# It must make sure that the server is not running before it exits
|
||||
# otherwise the temporary mounted directory will not be unmountable.
|
||||
#
|
||||
|
||||
prefix=$1
|
||||
|
||||
#
|
||||
# Source our common functions - this will let us install a Debian package.
|
||||
#
|
||||
if [ -e /usr/lib/xen-tools/common.sh ]; then
|
||||
. /usr/lib/xen-tools/common.sh
|
||||
else
|
||||
echo "Installation problem"
|
||||
fi
|
||||
|
||||
#
|
||||
# Log our start
|
||||
#
|
||||
logMessage Script $0 starting
|
||||
|
||||
|
||||
#
|
||||
# Install ssh
|
||||
#
|
||||
installDebianPackage ${prefix} puppet
|
||||
|
||||
|
||||
#
|
||||
# Make sure sshd isn't running, this will cause our unmounting of the
|
||||
# disk image to fail..
|
||||
#
|
||||
chroot ${prefix} /etc/init.d/puppet stop
|
||||
|
||||
#
|
||||
# Log our finish
|
||||
#
|
||||
logMessage Script $0 finished
|
||||
Reference in New Issue
Block a user