Replace tabs with spaces
This makes t/no-tabs.t pass. I'm responsible for some tabs in previous patches, so this fixes mine also :) Note that I find this test silly, but "dura lex, sed lex"...
This commit is contained in:
parent
c5b4f4bc73
commit
bd840ba071
@ -1339,17 +1339,17 @@ sub setupDefaultOptions
|
||||
|
||||
# Initialize per distribution mirror defaults: Debian
|
||||
foreach my $debdist (qw(etch lenny squeeze sid testing stable unstable)) {
|
||||
$CONFIG{ 'mirror_'.$debdist } = $CONFIG{ 'mirror' }
|
||||
$CONFIG{ 'mirror_'.$debdist } = $CONFIG{ 'mirror' }
|
||||
}
|
||||
foreach my $debdist (qw(sarge)) {
|
||||
$CONFIG{ 'mirror_'.$debdist } = 'http://archive.debian.org/debian';
|
||||
$CONFIG{ 'mirror_'.$debdist } = 'http://archive.debian.org/debian';
|
||||
}
|
||||
# Initialize per distribution mirror defaults: Ubuntu
|
||||
foreach my $ubuntudist (qw(dapper hardy intrepid jaunty karmic lucid maverick)) {
|
||||
$CONFIG{ 'mirror_'.$ubuntudist } = 'http://archive.ubuntu.com/ubuntu';
|
||||
$CONFIG{ 'mirror_'.$ubuntudist } = 'http://archive.ubuntu.com/ubuntu';
|
||||
}
|
||||
foreach my $ubuntudist (qw(edgy feisty gutsy)) {
|
||||
$CONFIG{ 'mirror_'.$ubuntudist } = 'http://old-releases.ubuntu.com/ubuntu';
|
||||
$CONFIG{ 'mirror_'.$ubuntudist } = 'http://old-releases.ubuntu.com/ubuntu';
|
||||
}
|
||||
$CONFIG{ 'arch' } = '';
|
||||
$CONFIG{ 'fs' } = 'ext3';
|
||||
@ -1757,7 +1757,7 @@ sub checkArguments
|
||||
# Sarge amd64 needs different default mirror
|
||||
#
|
||||
if ( $CONFIG{ 'dist' } =~ /sarge/ and
|
||||
$CONFIG{ 'mirror_sarge' } eq 'http://archive.debian.org/debian' )
|
||||
$CONFIG{ 'mirror_sarge' } eq 'http://archive.debian.org/debian' )
|
||||
{
|
||||
$CONFIG{ 'mirror_sarge' } = 'http://amd64.debian.net/debian';
|
||||
}
|
||||
@ -1767,8 +1767,8 @@ sub checkArguments
|
||||
#
|
||||
my $distMirror = "mirror_" . $CONFIG{ 'dist' };
|
||||
if ( !$CONFIG{ 'mirror' } and
|
||||
$CONFIG{ $distMirror } and
|
||||
length( $CONFIG{ $distMirror } ) )
|
||||
$CONFIG{ $distMirror } and
|
||||
length( $CONFIG{ $distMirror } ) )
|
||||
{
|
||||
$CONFIG{ 'mirror' } = $CONFIG{ $distMirror };
|
||||
}
|
||||
@ -3402,7 +3402,7 @@ sub installSystem
|
||||
# Propagate --debootstrap-cmd if install-method is debootstrap
|
||||
#
|
||||
if ( $CONFIG{ 'install-method' } eq 'debootstrap' and
|
||||
$CONFIG{ 'debootstrap-cmd' } )
|
||||
$CONFIG{ 'debootstrap-cmd' } )
|
||||
{
|
||||
$cmd .= " --debootstrap-cmd=$CONFIG{'debootstrap-cmd'}";
|
||||
}
|
||||
@ -3554,9 +3554,9 @@ sub runCustomisationHooks
|
||||
# Restore domU's resolv.conf if needed
|
||||
#
|
||||
if (-f "$MOUNT_POINT/etc/resolv.conf") {
|
||||
mv("$MOUNT_POINT/etc/resolv.conf.old", "$MOUNT_POINT/etc/resolv.conf");
|
||||
mv("$MOUNT_POINT/etc/resolv.conf.old", "$MOUNT_POINT/etc/resolv.conf");
|
||||
} else {
|
||||
unlink "$MOUNT_POINT/etc/resolv.conf";
|
||||
unlink "$MOUNT_POINT/etc/resolv.conf";
|
||||
}
|
||||
|
||||
#
|
||||
@ -4028,13 +4028,13 @@ sub runCommand
|
||||
if (!defined($rcopen)) {
|
||||
logprint("Starting command '$cmd' failed: $!\n");
|
||||
logprint("Aborting\n");
|
||||
print "See /var/log/xen-tools/$CONFIG{'hostname'}.log for details\n";
|
||||
print "See /var/log/xen-tools/$CONFIG{'hostname'}.log for details\n";
|
||||
$FAIL = 1;
|
||||
exit 127;
|
||||
}
|
||||
|
||||
while (my $line = <CMD>) {
|
||||
logonly $line;
|
||||
logonly $line;
|
||||
}
|
||||
|
||||
my $rcclose = close(CMD);
|
||||
@ -4045,7 +4045,7 @@ sub runCommand
|
||||
{
|
||||
logprint("Running command '$cmd' failed with exit code $?.\n");
|
||||
logprint("Aborting\n");
|
||||
print "See /var/log/xen-tools/$CONFIG{'hostname'}.log for details\n";
|
||||
print "See /var/log/xen-tools/$CONFIG{'hostname'}.log for details\n";
|
||||
$FAIL = 1;
|
||||
exit 127;
|
||||
}
|
||||
|
||||
@ -240,8 +240,8 @@ sub parseCommandLineArguments
|
||||
#
|
||||
GetOptions( "test=s", \$CONFIG{ 'prefix' },
|
||||
"help", \$HELP,
|
||||
"manual", \$MANUAL,
|
||||
"version", \$VERSION );
|
||||
"manual", \$MANUAL,
|
||||
"version", \$VERSION );
|
||||
|
||||
pod2usage(1) if $HELP;
|
||||
pod2usage( -verbose => 2 ) if $MANUAL;
|
||||
|
||||
@ -288,11 +288,11 @@ sub updateXenImage
|
||||
if ( ( -e $tmp . "/usr/bin/apt-get" ) &&
|
||||
( -x $tmp . "/usr/bin/apt-get" ) )
|
||||
{
|
||||
#
|
||||
# Copy dom0's resolv.conf to domU
|
||||
#
|
||||
mv("$tmp/etc/resolv.conf", "$tmp/etc/resolv.conf.old") if -f "$tmp/etc/resolv.conf";
|
||||
cp("/etc/resolv.conf", "$tmp/etc/resolv.conf");
|
||||
#
|
||||
# Copy dom0's resolv.conf to domU
|
||||
#
|
||||
mv("$tmp/etc/resolv.conf", "$tmp/etc/resolv.conf.old") if -f "$tmp/etc/resolv.conf";
|
||||
cp("/etc/resolv.conf", "$tmp/etc/resolv.conf");
|
||||
|
||||
#
|
||||
# Now run the update command.
|
||||
@ -307,9 +307,9 @@ sub updateXenImage
|
||||
"DEBIAN_FRONTEND=noninteractive chroot $tmp /usr/bin/apt-get upgrade --yes --force-yes"
|
||||
);
|
||||
|
||||
#
|
||||
# Restore domU's resolv.conf if needed
|
||||
#
|
||||
#
|
||||
# Restore domU's resolv.conf if needed
|
||||
#
|
||||
if (-f "$tmp/etc/resolv.conf") {
|
||||
mv("$tmp/etc/resolv.conf.old", "$tmp/etc/resolv.conf");
|
||||
} else {
|
||||
@ -453,11 +453,11 @@ sub parseCommandLineArguments
|
||||
# Parse options.
|
||||
#
|
||||
GetOptions( "dir=s", \$CONFIG{ 'dir' },
|
||||
"lvm=s", \$CONFIG{ 'lvm' },
|
||||
"lvm=s", \$CONFIG{ 'lvm' },
|
||||
"evms=s", \$CONFIG{ 'evms' },
|
||||
"help", \$HELP,
|
||||
"help", \$HELP,
|
||||
"manual", \$MANUAL,
|
||||
"version", \$VERSION );
|
||||
"version", \$VERSION );
|
||||
|
||||
pod2usage(1) if $HELP;
|
||||
pod2usage( -verbose => 2 ) if $MANUAL;
|
||||
|
||||
@ -322,9 +322,9 @@ sub runDistributionHooks
|
||||
print "--\n";
|
||||
my $rc = system($cmd);
|
||||
if ($rc != 0) {
|
||||
print "hook $name failed: $?\n";
|
||||
exit 1;
|
||||
}
|
||||
print "hook $name failed: $?\n";
|
||||
exit 1;
|
||||
}
|
||||
print "--\n";
|
||||
print "Done\n\n";
|
||||
}
|
||||
@ -333,9 +333,9 @@ sub runDistributionHooks
|
||||
print "Running hook $name\n";
|
||||
my $rc = system($cmd);
|
||||
if ($rc != 0) {
|
||||
print "hook $name failed: $?\n";
|
||||
exit 1;
|
||||
}
|
||||
print "hook $name failed: $?\n";
|
||||
exit 1;
|
||||
}
|
||||
print "hook $name: done.\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,8 +9,8 @@ mirror for DomUs on Debian and Ubuntu Dom0s.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
--suite Show suite
|
||||
--mirror Show mirror
|
||||
--suite Show suite
|
||||
--mirror Show mirror
|
||||
|
||||
Shows both if no parameter is given.
|
||||
|
||||
|
||||
@ -256,8 +256,8 @@ if ( defined( $CONFIG{ 'install-method' } ) &&
|
||||
# Test that we have some "standard" files present.
|
||||
#
|
||||
|
||||
checkForCommonFilesInChroot($CONFIG{ 'location' },
|
||||
"installed system");
|
||||
checkForCommonFilesInChroot($CONFIG{ 'location' },
|
||||
"installed system");
|
||||
|
||||
#
|
||||
# All done.
|
||||
@ -538,13 +538,13 @@ sub checkForCommonFilesInChroot {
|
||||
my ($chroot, $what) = @_;
|
||||
foreach my $file (qw( /bin/ls /bin/cp ))
|
||||
{
|
||||
if ( !-x $chroot.$file )
|
||||
{
|
||||
print STDERR <<EOT;
|
||||
if ( !-x $chroot.$file )
|
||||
{
|
||||
print STDERR <<EOT;
|
||||
WARNING ($0): The $what at $chroot doesn\'t seem to be a full system.
|
||||
WARNING ($0): The $what is missing the common file: $file.
|
||||
EOT
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -661,7 +661,7 @@ sub do_copy
|
||||
# Check if the copy source has at least some "standard" files present.
|
||||
#
|
||||
checkForCommonFilesInChroot($CONFIG{ 'install-source' },
|
||||
"installation source");
|
||||
"installation source");
|
||||
|
||||
#
|
||||
# Find the copy command to run from the configuration file.
|
||||
@ -706,15 +706,15 @@ sub do_debootstrap
|
||||
my $cachedir = $CONFIG{ 'cachedir' };
|
||||
if ( !$cmd )
|
||||
{
|
||||
if (-x '/usr/sbin/debootstrap') {
|
||||
$cmd = '/usr/sbin/debootstrap';
|
||||
} elsif (-x '/usr/sbin/cdebootstrap') {
|
||||
$cmd = '/usr/sbin/cdebootstrap';
|
||||
} else {
|
||||
print STDERR "Found neither debootstrap nor cdebootstrap and no --debootstrap-cmd given\n";
|
||||
exit 1;
|
||||
}
|
||||
print "Using $cmd as debootstrap command\n";
|
||||
if (-x '/usr/sbin/debootstrap') {
|
||||
$cmd = '/usr/sbin/debootstrap';
|
||||
} elsif (-x '/usr/sbin/cdebootstrap') {
|
||||
$cmd = '/usr/sbin/cdebootstrap';
|
||||
} else {
|
||||
print STDERR "Found neither debootstrap nor cdebootstrap and no --debootstrap-cmd given\n";
|
||||
exit 1;
|
||||
}
|
||||
print "Using $cmd as debootstrap command\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -226,18 +226,18 @@ installCentOS4Package ()
|
||||
#
|
||||
installPackage ()
|
||||
{
|
||||
prefix=$1
|
||||
package=$2
|
||||
prefix=$1
|
||||
package=$2
|
||||
|
||||
if [ -x ${prefix}/usr/bin/apt-get ] ; then
|
||||
installDebianPackage "$@"
|
||||
if [ -x ${prefix}/usr/bin/apt-get ] ; then
|
||||
installDebianPackage "$@"
|
||||
|
||||
elif [ -x ${prefix}/usr/bin/yum ] ; then
|
||||
installCentOS4Package "$@"
|
||||
elif [ -x ${prefix}/usr/bin/yum ] ; then
|
||||
installCentOS4Package "$@"
|
||||
|
||||
else
|
||||
logMessage "Unable to install package ${package}; no package manager found"
|
||||
fi
|
||||
else
|
||||
logMessage "Unable to install package ${package}; no package manager found"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ if [ -z "${copyhosts}" ]; then
|
||||
# Copy localhost
|
||||
#
|
||||
cat > ${prefix}/etc/hosts <<EOF
|
||||
127.0.0.1 localhost
|
||||
127.0.0.1 localhost
|
||||
EOF
|
||||
#
|
||||
# Make sure our hostname and FQDN is resolvable
|
||||
@ -59,11 +59,11 @@ EOF
|
||||
# If dhcp is diabled, FQDN should resolve to our IP
|
||||
#
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
EOF
|
||||
else
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
EOF
|
||||
fi
|
||||
|
||||
@ -86,12 +86,12 @@ else
|
||||
# New entry.
|
||||
if [ -z "${dhcp}" ]; then
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
|
||||
EOF
|
||||
else
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
|
||||
EOF
|
||||
fi
|
||||
@ -114,7 +114,7 @@ if [ -z "${dhcp}" ]; then
|
||||
if [ -z "${nohosts}" ]; then
|
||||
|
||||
logMessage Adding $GUEST_FQDN and $GUEST_HOSTNAME to /etc/hosts on the host
|
||||
echo "${ip1} $GUEST_FQDN $GUEST_HOSTNAME" >> /etc/hosts
|
||||
echo "${ip1} $GUEST_FQDN $GUEST_HOSTNAME" >> /etc/hosts
|
||||
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
|
||||
@ -48,4 +48,4 @@ fi
|
||||
#
|
||||
# Log our finish
|
||||
#
|
||||
logMessage Script $0 finished.
|
||||
logMessage Script $0 finished.
|
||||
|
||||
@ -49,7 +49,7 @@ if [ -z "${copyhosts}" ]; then
|
||||
# Copy localhost
|
||||
#
|
||||
cat > ${prefix}/etc/hosts <<EOF
|
||||
127.0.0.1 localhost
|
||||
127.0.0.1 localhost
|
||||
EOF
|
||||
#
|
||||
# Make sure our hostname and FQDN is resolvable
|
||||
@ -59,11 +59,11 @@ EOF
|
||||
# If dhcp is diabled, FQDN should resolve to our IP
|
||||
#
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
EOF
|
||||
else
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
EOF
|
||||
fi
|
||||
|
||||
@ -86,12 +86,12 @@ else
|
||||
# New entry.
|
||||
if [ -z "${dhcp}" ]; then
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
|
||||
EOF
|
||||
else
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
|
||||
EOF
|
||||
fi
|
||||
@ -114,7 +114,7 @@ if [ -z "${dhcp}" ]; then
|
||||
if [ -z "${nohosts}" ]; then
|
||||
|
||||
logMessage Adding $GUEST_FQDN and $GUEST_HOSTNAME to /etc/hosts on the host
|
||||
echo "${ip1} $GUEST_FQDN $GUEST_HOSTNAME" >> /etc/hosts
|
||||
echo "${ip1} $GUEST_FQDN $GUEST_HOSTNAME" >> /etc/hosts
|
||||
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
|
||||
@ -33,8 +33,8 @@ MAKEDEV=''
|
||||
MAKEDEV_PATHS="/sbin/MAKEDEV /dev/MAKEDEV"
|
||||
for MAKEDEV_PATH in ${MAKEDEV_PATHS}; do
|
||||
if [ -x "${prefix}${MAKEDEV_PATH}" ]; then
|
||||
MAKEDEV="${prefix}${MAKEDEV_PATH}"
|
||||
break
|
||||
MAKEDEV="${prefix}${MAKEDEV_PATH}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@ -33,25 +33,25 @@ logMessage Script $0 starting
|
||||
#
|
||||
|
||||
if [ "${arch}" = "i386" ]; then
|
||||
XEN_ARCH="686"
|
||||
XEN_ARCH="686"
|
||||
elif [ "${arch}" = "amd64" ]; then
|
||||
XEN_ARCH="amd64"
|
||||
XEN_ARCH="amd64"
|
||||
elif [ -z "${arch}" ]; then
|
||||
UNAME_ARCH=`uname -m`
|
||||
if [ "${UNAME_ARCH}" = "i686" ]; then
|
||||
XEN_ARCH="686"
|
||||
elif [ "${UNAME_ARCH}" = "x86_64" ]; then
|
||||
XEN_ARCH="amd64"
|
||||
else
|
||||
logMessage Unknown kernel architecture ${UNAME_ARCH}.
|
||||
logMessage Please report this as bug to xen-tools-dev@xen-tools.org.
|
||||
logMessage Script $0 failed
|
||||
exit 1
|
||||
fi
|
||||
UNAME_ARCH=`uname -m`
|
||||
if [ "${UNAME_ARCH}" = "i686" ]; then
|
||||
XEN_ARCH="686"
|
||||
elif [ "${UNAME_ARCH}" = "x86_64" ]; then
|
||||
XEN_ARCH="amd64"
|
||||
else
|
||||
logMessage Unknown kernel architecture ${UNAME_ARCH}.
|
||||
logMessage Please report this as bug to xen-tools-dev@xen-tools.org.
|
||||
logMessage Script $0 failed
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
logMessage Unknown kernel architecture ${arch}
|
||||
logMessage Script $0 failed
|
||||
exit 1
|
||||
logMessage Unknown kernel architecture ${arch}
|
||||
logMessage Script $0 failed
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
@ -68,19 +68,19 @@ if chroot ${prefix} /usr/bin/apt-cache show $KERNEL_XEN_PKG > /dev/null 2>&1; th
|
||||
installDebianPackage ${prefix} $KERNEL_XEN_PKG
|
||||
|
||||
else
|
||||
logMessage Package $KERNEL_XEN_PKG is not available
|
||||
logMessage Attempting to install the $KERNEL_PKG kernel image
|
||||
logMessage WARNING: This kernel may not have pvops
|
||||
if chroot ${prefix} /usr/bin/apt-cache show $KERNEL_PKG > /dev/null 2>&1; then
|
||||
logMessage Package $KERNEL_PKG is available - installing
|
||||
installDebianPackage ${prefix} initramfs-tools
|
||||
installDebianPackage ${prefix} $KERNEL_PKG
|
||||
else
|
||||
logMessage Package $KERNEL_PKG is not available
|
||||
logMessage pygrub set, but kernel could not be installed
|
||||
logMessage Script $0 failed
|
||||
exit 1
|
||||
fi
|
||||
logMessage Package $KERNEL_XEN_PKG is not available
|
||||
logMessage Attempting to install the $KERNEL_PKG kernel image
|
||||
logMessage WARNING: This kernel may not have pvops
|
||||
if chroot ${prefix} /usr/bin/apt-cache show $KERNEL_PKG > /dev/null 2>&1; then
|
||||
logMessage Package $KERNEL_PKG is available - installing
|
||||
installDebianPackage ${prefix} initramfs-tools
|
||||
installDebianPackage ${prefix} $KERNEL_PKG
|
||||
else
|
||||
logMessage Package $KERNEL_PKG is not available
|
||||
logMessage pygrub set, but kernel could not be installed
|
||||
logMessage Script $0 failed
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
DOMU_KERNEL=$(basename $(ls -1 ${prefix}/boot/vmlinuz* | tail -n 1))
|
||||
@ -93,10 +93,10 @@ DOMU_ISSUE=$(sed -re "s/ *\\\.*//g" -e1q < ${prefix}/etc/issue)
|
||||
#
|
||||
|
||||
if [ -f ${prefix}/boot/$DOMU_RAMDISK ]; then
|
||||
logMessage initrd exists, skipping generation
|
||||
logMessage initrd exists, skipping generation
|
||||
else
|
||||
logMessage initrd missing, generating
|
||||
chroot ${prefix} update-initramfs -c -k $KERNEL_REV
|
||||
logMessage initrd missing, generating
|
||||
chroot ${prefix} update-initramfs -c -k $KERNEL_REV
|
||||
fi
|
||||
|
||||
#
|
||||
|
||||
@ -43,4 +43,4 @@ installDebianPackage ${prefix} util-linux-locales
|
||||
#
|
||||
# Log our finish
|
||||
#
|
||||
logMessage Script $0 finished.
|
||||
logMessage Script $0 finished.
|
||||
|
||||
@ -49,7 +49,7 @@ if [ -z "${copyhosts}" ]; then
|
||||
# Copy localhost
|
||||
#
|
||||
cat > ${prefix}/etc/hosts <<EOF
|
||||
127.0.0.1 localhost
|
||||
127.0.0.1 localhost
|
||||
EOF
|
||||
#
|
||||
# Make sure our hostname and FQDN is resolvable
|
||||
@ -59,11 +59,11 @@ EOF
|
||||
# If dhcp is diabled, FQDN should resolve to our IP
|
||||
#
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
EOF
|
||||
else
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
EOF
|
||||
fi
|
||||
|
||||
@ -86,12 +86,12 @@ else
|
||||
# New entry.
|
||||
if [ -z "${dhcp}" ]; then
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
|
||||
EOF
|
||||
else
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
|
||||
EOF
|
||||
fi
|
||||
@ -114,7 +114,7 @@ if [ -z "${dhcp}" ]; then
|
||||
if [ -z "${nohosts}" ]; then
|
||||
|
||||
logMessage Adding $GUEST_FQDN and $GUEST_HOSTNAME to /etc/hosts on the host
|
||||
echo "${ip1} $GUEST_FQDN $GUEST_HOSTNAME" >> /etc/hosts
|
||||
echo "${ip1} $GUEST_FQDN $GUEST_HOSTNAME" >> /etc/hosts
|
||||
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
|
||||
@ -43,19 +43,19 @@ if chroot ${prefix} /usr/bin/apt-cache show $KERNEL_XEN_PKG > /dev/null 2>&1; th
|
||||
installDebianPackage ${prefix} $KERNEL_XEN_PKG
|
||||
|
||||
else
|
||||
logMessage Package $KERNEL_XEN_PKG is not available
|
||||
logMessage Attempting to install the $KERNEL_PKG kernel image
|
||||
logMessage WARNING: This kernel may not have pvops
|
||||
if chroot ${prefix} /usr/bin/apt-cache show $KERNEL_PKG > /dev/null 2>&1; then
|
||||
logMessage Package $KERNEL_PKG is available - installing
|
||||
installDebianPackage ${prefix} initramfs-tools
|
||||
installDebianPackage ${prefix} $KERNEL_PKG
|
||||
else
|
||||
logMessage Package $KERNEL_PKG is not available
|
||||
logMessage pygrub set, but kernel could not be installed
|
||||
logMessage Script $0 failed
|
||||
exit 1
|
||||
fi
|
||||
logMessage Package $KERNEL_XEN_PKG is not available
|
||||
logMessage Attempting to install the $KERNEL_PKG kernel image
|
||||
logMessage WARNING: This kernel may not have pvops
|
||||
if chroot ${prefix} /usr/bin/apt-cache show $KERNEL_PKG > /dev/null 2>&1; then
|
||||
logMessage Package $KERNEL_PKG is available - installing
|
||||
installDebianPackage ${prefix} initramfs-tools
|
||||
installDebianPackage ${prefix} $KERNEL_PKG
|
||||
else
|
||||
logMessage Package $KERNEL_PKG is not available
|
||||
logMessage pygrub set, but kernel could not be installed
|
||||
logMessage Script $0 failed
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
DOMU_KERNEL=$(basename $(ls -1 ${prefix}/boot/vmlinuz* | tail -n 1))
|
||||
@ -68,10 +68,10 @@ DOMU_ISSUE=$(sed -re "s/ *\\\.*//g" -e1q < ${prefix}/etc/issue)
|
||||
#
|
||||
|
||||
if [ -f ${prefix}/boot/$DOMU_RAMDISK ]; then
|
||||
logMessage initrd exists, skipping generation
|
||||
logMessage initrd exists, skipping generation
|
||||
else
|
||||
logMessage initrd missing, generating
|
||||
chroot ${prefix} update-initramfs -c -k $KERNEL_REV
|
||||
logMessage initrd missing, generating
|
||||
chroot ${prefix} update-initramfs -c -k $KERNEL_REV
|
||||
fi
|
||||
|
||||
#
|
||||
|
||||
@ -29,8 +29,8 @@ logMessage Script $0 starting
|
||||
#
|
||||
rm -f ${prefix}/etc/event.d/tty[!1]
|
||||
[ -f ${prefix}/etc/event.d/tty1 ] && {
|
||||
sed -i -e s/tty1/hvc0/ ${prefix}/etc/event.d/tty1
|
||||
mv ${prefix}/etc/event.d/tty1 ${prefix}/etc/event.d/hvc0
|
||||
sed -i -e s/tty1/hvc0/ ${prefix}/etc/event.d/tty1
|
||||
mv ${prefix}/etc/event.d/tty1 ${prefix}/etc/event.d/hvc0
|
||||
}
|
||||
[ -f ${prefix}/etc/inittab ] && sed -i -e 's/^\([2-6].*:respawn*\)/#\1/' -e 's/^T/#\t/' -e 's/tty1$/hvc0/' ${prefix}/etc/inittab
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ if [ -z "${copyhosts}" ]; then
|
||||
# Copy localhost
|
||||
#
|
||||
cat > ${prefix}/etc/hosts <<EOF
|
||||
127.0.0.1 localhost
|
||||
127.0.0.1 localhost
|
||||
EOF
|
||||
#
|
||||
# Make sure our hostname and FQDN is resolvable
|
||||
@ -59,11 +59,11 @@ EOF
|
||||
# If dhcp is diabled, FQDN should resolve to our IP
|
||||
#
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
EOF
|
||||
else
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
EOF
|
||||
fi
|
||||
|
||||
@ -86,12 +86,12 @@ else
|
||||
# New entry.
|
||||
if [ -z "${dhcp}" ]; then
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
|
||||
EOF
|
||||
else
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
|
||||
EOF
|
||||
fi
|
||||
@ -114,7 +114,7 @@ if [ -z "${dhcp}" ]; then
|
||||
if [ -z "${nohosts}" ]; then
|
||||
|
||||
logMessage Adding $GUEST_FQDN and $GUEST_HOSTNAME to /etc/hosts on the host
|
||||
echo "${ip1} $GUEST_FQDN $GUEST_HOSTNAME" >> /etc/hosts
|
||||
echo "${ip1} $GUEST_FQDN $GUEST_HOSTNAME" >> /etc/hosts
|
||||
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
|
||||
@ -38,14 +38,14 @@ KERNEL_PKG="linux-image-server"
|
||||
logMessage Attempting to install the $KERNEL_PKG kernel image
|
||||
logMessage WARNING: This kernel may not have pvops
|
||||
if chroot ${prefix} /usr/bin/apt-cache show $KERNEL_PKG > /dev/null 2>&1; then
|
||||
logMessage Package $KERNEL_PKG is available - installing
|
||||
logMessage Package $KERNEL_PKG is available - installing
|
||||
installDebianPackage ${prefix} initramfs-tools
|
||||
installDebianPackage ${prefix} $KERNEL_PKG
|
||||
else
|
||||
logMessage Package $KERNEL_PKG is not available
|
||||
logMessage pygrub set, but kernel could not be installed
|
||||
logMessage Script $0 failed
|
||||
exit 1
|
||||
logMessage Package $KERNEL_PKG is not available
|
||||
logMessage pygrub set, but kernel could not be installed
|
||||
logMessage Script $0 failed
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOMU_KERNEL=$(basename $(ls -1 ${prefix}/boot/vmlinuz* | tail -n 1))
|
||||
@ -58,10 +58,10 @@ DOMU_ISSUE=$(sed -re "s/ *\\\.*//g" -e1q < ${prefix}/etc/issue)
|
||||
#
|
||||
|
||||
if [ -f ${prefix}/boot/$DOMU_RAMDISK ]; then
|
||||
logMessage initrd exists, skipping generation
|
||||
logMessage initrd exists, skipping generation
|
||||
else
|
||||
logMessage initrd missing, generating
|
||||
chroot ${prefix} update-initramfs -c -k $KERNEL_REV
|
||||
logMessage initrd missing, generating
|
||||
chroot ${prefix} update-initramfs -c -k $KERNEL_REV
|
||||
fi
|
||||
|
||||
#
|
||||
|
||||
@ -29,8 +29,8 @@ logMessage Script $0 starting
|
||||
#
|
||||
rm -f ${prefix}/etc/init/tty[!1].conf
|
||||
[ -f ${prefix}/etc/event.d/tty1 ] && {
|
||||
sed -i -e s/tty1/hvc0/ ${prefix}/etc/init/tty1.conf
|
||||
mv ${prefix}/etc/init/tty1.conf ${prefix}/etc/init/hvc0.conf
|
||||
sed -i -e s/tty1/hvc0/ ${prefix}/etc/init/tty1.conf
|
||||
mv ${prefix}/etc/init/tty1.conf ${prefix}/etc/init/hvc0.conf
|
||||
}
|
||||
[ -f ${prefix}/etc/inittab ] && sed -i -e 's/^\([2-6].*:respawn*\)/#\1/' -e 's/^T/#\t/' -e 's/tty1$/hvc0/' ${prefix}/etc/inittab
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ if [ -z "${copyhosts}" ]; then
|
||||
# Copy localhost
|
||||
#
|
||||
cat > ${prefix}/etc/hosts <<EOF
|
||||
127.0.0.1 localhost
|
||||
127.0.0.1 localhost
|
||||
EOF
|
||||
#
|
||||
# Make sure our hostname and FQDN is resolvable
|
||||
@ -59,11 +59,11 @@ EOF
|
||||
# If dhcp is diabled, FQDN should resolve to our IP
|
||||
#
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
EOF
|
||||
else
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
EOF
|
||||
fi
|
||||
|
||||
@ -86,12 +86,12 @@ else
|
||||
# New entry.
|
||||
if [ -z "${dhcp}" ]; then
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
${ip1} $GUEST_FQDN $GUEST_HOSTNAME
|
||||
|
||||
EOF
|
||||
else
|
||||
cat >> ${prefix}/etc/hosts <<EOF
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
127.0.1.1 $GUEST_FQDN $GUEST_HOSTNAME
|
||||
|
||||
EOF
|
||||
fi
|
||||
@ -114,7 +114,7 @@ if [ -z "${dhcp}" ]; then
|
||||
if [ -z "${nohosts}" ]; then
|
||||
|
||||
logMessage Adding $GUEST_FQDN and $GUEST_HOSTNAME to /etc/hosts on the host
|
||||
echo "${ip1} $GUEST_FQDN $GUEST_HOSTNAME" >> /etc/hosts
|
||||
echo "${ip1} $GUEST_FQDN $GUEST_HOSTNAME" >> /etc/hosts
|
||||
|
||||
#
|
||||
# If we've updated the /etc/hosts file on the host machine
|
||||
|
||||
@ -87,9 +87,9 @@ sub checkFile
|
||||
is( $result, 0, "Shell script passes our portability check: $file" );
|
||||
|
||||
if (-x "/usr/bin/checkbashisms") {
|
||||
# Check for bashisms
|
||||
$result = `/usr/bin/checkbashisms '$file'`;
|
||||
is( $result, '', "Shell script passes check for bashisms: $file" );
|
||||
# Check for bashisms
|
||||
$result = `/usr/bin/checkbashisms '$file'`;
|
||||
is( $result, '', "Shell script passes check for bashisms: $file" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -8,13 +8,13 @@ use File::Temp;
|
||||
use Xen::Tools::Log;
|
||||
|
||||
SKIP: {
|
||||
skip "Xen::Tools::Log is not used for now", 1;
|
||||
skip "Xen::Tools::Log is not used for now", 1;
|
||||
|
||||
my $dir = File::Temp::tempdir( CLEANUP => 1 );
|
||||
my $dir = File::Temp::tempdir( CLEANUP => 1 );
|
||||
|
||||
my $xtl = Xen::Tools::Log->new( hostname => 'xen-tools-log-test',
|
||||
logpath => $dir,
|
||||
);
|
||||
my $xtl = Xen::Tools::Log->new( hostname => 'xen-tools-log-test',
|
||||
logpath => $dir,
|
||||
);
|
||||
|
||||
ok( $xtl->isa('Xen::Tools::Log') );
|
||||
ok( $xtl->isa('Xen::Tools::Log') );
|
||||
}
|
||||
|
||||
@ -11,8 +11,8 @@ use Test::More tests => 1;
|
||||
use Xen::Tools;
|
||||
|
||||
SKIP: {
|
||||
skip "Xen::Tools is not used for now", 1;
|
||||
skip "Xen::Tools is not used for now", 1;
|
||||
|
||||
my $xt = Xen::Tools->new( hostname => 'xen-tools-test' );
|
||||
ok( $xt->isa('Xen::Tools') );
|
||||
my $xt = Xen::Tools->new( hostname => 'xen-tools-test' );
|
||||
ok( $xt->isa('Xen::Tools') );
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user