1
0
mirror of synced 2026-02-20 05:45:15 +00:00

Compare commits

..

32 Commits

Author SHA1 Message Date
Steve Kemp
5ed66652ad Use perltidy with no args 2009-01-11 23:22:03 +00:00
Steve Kemp
7b29ec1bdf Fixed tab vs. space 2009-01-11 23:21:25 +00:00
Steve Kemp
31719505f6 Updated. 2009-01-06 21:01:51 +00:00
Steve Kemp
6338ba62c4 Added. 2009-01-06 20:59:55 +00:00
Steve Kemp
3c4e0160ae Updated. 2008-12-10 21:39:59 +00:00
Steve Kemp
84ee1658d1 Another fixup 2008-12-10 21:35:35 +00:00
Steve Kemp
a28bced5e3 Last juggle. 2008-12-09 14:02:04 +00:00
Steve Kemp
8965988439 Hardy + Intrepid now work 2008-12-08 22:56:55 +00:00
Steve Kemp
1d6771c719 Reverse order. 2008-12-08 22:56:28 +00:00
Steve Kemp
3cb87c09e9 Updated. 2008-12-08 20:35:13 +00:00
Steve Kemp
a95d576a4e 1. Work with partitions.
2.  Allow pygrub
2008-11-24 14:37:34 +00:00
Steve Kemp
9d061fe5a6 Always make /dev/pts available 2008-11-24 14:37:14 +00:00
Steve Kemp
22a4774cfe Updated to work with partitions 2008-11-23 21:12:42 +00:00
Steve Kemp
1b6d3dbdeb Delete the file if it exists 2008-11-23 21:12:36 +00:00
Steve Kemp
996e7d7e1f Don't abort if the file exists 2008-11-23 21:11:43 +00:00
Steve Kemp
97d01456a3 Attempt to fixup image-dev 2008-11-23 13:13:38 +00:00
Steve Kemp
aa7a2c4c5e New command line argument --no-hosts 2008-11-23 13:06:24 +00:00
Steve Kemp
3522a919ce Allow command line flags to be unset. 2008-10-14 22:04:40 +01:00
Steve Kemp
ef3a15c16c Updated standards version 2008-10-13 19:24:01 +01:00
Steve Kemp
c85144de0f Sync 2008-10-13 19:23:15 +01:00
Steve Kemp
455c16cefe Abort if the generated configuration file already exists.
(Closes: #499475)
2008-10-13 19:18:05 +01:00
Steve Kemp
290a30b1b1 Record the arch for rpm-based distros. Closes: 475125 2008-10-13 19:14:47 +01:00
Steve Kemp
8e2f1236fb Don't test for the POSIX module; per http://www.perlmonks.org/?node_id=689911 2008-06-03 21:49:44 +01:00
Steve Kemp
15436cc018 Correctly sort custom partitions.
#477334
2008-04-30 19:06:36 +01:00
Steve Kemp
3717d0cc15 Correctly force purging of packages in the role script(s).
#477629
2008-04-30 19:05:54 +01:00
Steve Kemp
5d11b820b7 Add the hostname to dom0's /etc/hosts in the correct order.
#477775
2008-04-30 19:05:21 +01:00
Steve Kemp
161ee94632 Add /dev/pts to the fedora guests. #474919 2008-04-30 19:04:04 +01:00
Steve Kemp
9ff14a400e Updated with the debian release 2008-04-30 19:02:51 +01:00
Steve Kemp
cb77db18b9 added perltidy rule 2008-04-01 20:52:15 +01:00
Steve Kemp
8be8f39add Ran through perltidy 2008-04-01 20:52:08 +01:00
Steve Kemp
be30692061 Only show the install source if there is one. 2008-03-14 12:12:28 +00:00
Steve Kemp
7a6c7f17c9 Fixed bug where quote characters prevented interpolation.
Added naive test case to catch the error next time round..
2008-02-20 11:55:32 +00:00
35 changed files with 293 additions and 145 deletions

4
.hgignore Normal file
View File

@@ -0,0 +1,4 @@
(^|/)CVS($|/)
(^|/)\.hg($|/)
(^|/)\.hgtags($|/)
ChangeLog

View File

@@ -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

View File

@@ -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,14 +1361,18 @@ 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'},
"dhcp", \$CONFIG{'dhcp'},
"gateway=s", \$CONFIG{'gateway'},
"hostname=s", \$CONFIG{'hostname'},
"ip=s@", \$CONFIG{'ip'},
"mac=s", \$CONFIG{'mac'},
"netmask=s", \$CONFIG{'netmask'},
"broadcast=s", \$CONFIG{'broadcast'},
"vifname=s", \$CONFIG{'vifname'},
"p2p=s", \$CONFIG{'p2p'},
# Exclusive
@@ -1377,34 +1383,38 @@ sub parseCommandLineArguments
"install-source=s", \$CONFIG{'install-source'},
# Misc. options
"accounts!", \$CONFIG{'accounts'},
"accounts", \$CONFIG{'accounts'},
"admins=s", \$CONFIG{'admins'},
"arch=s", \$CONFIG{'arch'},
"fs=s", \$CONFIG{'fs'},
"boot!", \$CONFIG{'boot'},
"boot", \$CONFIG{'boot'},
"cache=s", \$CONFIG{'cache'},
"config=s", \$CONFIG{'config'},
"ide!", \$CONFIG{'ide'},
"ide", \$CONFIG{'ide'},
"install=i", \$CONFIG{'install'},
"hooks=i", \$CONFIG{'hooks'},
"passwd!", \$CONFIG{'passwd'},
"pygrub", \$CONFIG{'pygrub'},
"passwd", \$CONFIG{'passwd'},
"partitions=s", \$CONFIG{'partitions'},
"role=s", \$CONFIG{'role'},
"role-args=s", \$CONFIG{'role-args'},
"roledir=s", \$CONFIG{'roledir'},
"force!", \$CONFIG{'force'},
"keep!", \$CONFIG{'keep'},
"force", \$CONFIG{'force'},
"keep", \$CONFIG{'keep'},
"template=s", \$CONFIG{'template'},
"output=s", \$CONFIG{'output'},
"extension=s", \$CONFIG{'extension'},
# Help options
"debug!", \$CONFIG{'debug'},
"debug", \$CONFIG{'debug'},
"help", \$HELP,
"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'}

View File

@@ -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.

View File

@@ -169,7 +169,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '3.9';
my $RELEASE = '4.1';

View File

@@ -102,7 +102,7 @@ $CONFIG{'prefix'} = "/etc/xen";
#
# Release number.
#
my $RELEASE = '3.9';
my $RELEASE = '4.1';

View File

@@ -116,7 +116,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '3.9';
my $RELEASE = '4.1';

View File

@@ -120,7 +120,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '3.9';
my $RELEASE = '4.1';
#

View File

@@ -156,7 +156,7 @@ $CONFIG{'template'} = '/etc/xen-tools/xm.tmpl';
#
# Release number.
#
my $RELEASE = '3.9';
my $RELEASE = '4.1';

View File

@@ -97,7 +97,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '3.9';
my $RELEASE = '4.1';

View File

@@ -113,7 +113,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '3.9';
my $RELEASE = '4.1';
#

11
debian/changelog vendored
View File

@@ -1,3 +1,14 @@
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.

0
debian/examples/setup-kernel-initrd vendored Normal file → Executable file
View File

0
debian/examples/update-modules vendored Normal file → Executable file
View File

0
debian/preinst vendored Normal file → Executable file
View File

View File

@@ -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 .= "' ]";
}
}

0
hooks/centos-4/15-setup-arch Normal file → Executable file
View File

View File

@@ -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

View File

@@ -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

0
hooks/centos-5/15-setup-arch Normal file → Executable file
View File

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

0
hooks/fedora-core-6/15-setup-arch Normal file → Executable file
View File

View File

@@ -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

View File

@@ -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

View File

@@ -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
View 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

0
t/quoted-strings.t Normal file → Executable file
View File