1
0
mirror of synced 2026-01-19 01:07:28 +00:00

2006-05-24 19:35:16 by steve

More updates.
This commit is contained in:
steve 2006-05-24 19:35:16 +00:00
parent dcee5ac308
commit 2862fb995d
6 changed files with 126 additions and 51 deletions

View File

@ -15,7 +15,7 @@ dist=$2
# This function will setup the sources.list file for new installations
# of Debian GNU/Linux.
#
function setupDebianSources
function setupDebian
{
cat <<E_O_APT > ${prefix}/etc/apt/sources.list
#
@ -76,7 +76,7 @@ function setupCentOS4
#
case "${dist}" in
sarge|etch|sid)
setupDebianSources
setupDebian
;;
centos4)
setupCentOS4

View File

@ -6,6 +6,14 @@
prefix=$1
dist=$2
#
# This script doesn't do anything different on a per-distribution basis
#
if [ -d /etc/xen-tools/skel ]; then

View File

@ -10,45 +10,52 @@
prefix=$1
dist=$2
if [ "${rpmstrap}" ]; then
#
# Use yum to install openssh if we can.
#
if [[ -x ${prefix}/usr/bin/yum ]]; then
chroot ${prefix}/usr/bin/yum -y install openssh-server
chroot ${prefix}/usr/bin/yum -y install openssh-server
else
echo "I don't know how to install OpenSSH for your distro."
fi
#
# Finished.
#
exit
fi
#
# This function installs a package upon the guest image.
# Sets up the installation of OpenSSH on a Debian GNU/Linux system.
#
function install_package
function setupDebian
{
package=$1
DEBIAN_FRONTEND=noninteractive chroot ${prefix} /usr/bin/apt-get --yes --force-yes install $package
DEBIAN_FRONTEND=noninteractive chroot ${prefix} /usr/bin/apt-get --yes --force-yes install ssh
#
# Make sure sshd isn't running, this will cause our unmounting of the
# disk image to fail..
#
chroot ${prefix} /etc/init.d/ssh stop
}
#
# Install the package.
# Sets up the installation of OpenSSH on a CentOS4 installation.
#
install_package ssh
function setupCentOS4
{
chroot ${prefix}/usr/bin/yum -y install openssh-server
chroot ${prefix}/usr/bin/yum -y install openssh-server
}
#
# Make sure sshd isn't running, this will cause our unmounting of the
# disk image to fail..
# Entry point to the script.
#
chroot ${prefix} /etc/init.d/ssh stop
case "${dist}" in
sarge|etch|sid)
setupDebianSources
;;
centos4)
setupCentOS4
;;
*)
echo "Unknown distribution '${dist}'. Fixme";
exit;
;;
esac

View File

@ -12,22 +12,52 @@
# http://www.steve.org.uk/
#
# The virtual image is mounted here.
#
prefix=$1
dist=$2
#
# Copy the modules from the host to the new system - we should only
# really copy the *correct* modules, but we don't know what they are.
#
mkdir -p ${prefix}/lib/modules
cp -R /lib/modules/*/ ${prefix}/lib/modules
function copyModules
{
mkdir -p ${prefix}/lib/modules
cp -R /lib/modules/*/ ${prefix}/lib/modules
}
#
# Now install the 'module-init-tools', unless running under rpmstrap.
# Setup the modules on a Debian GNU/Linux system.
#
if [ -z "${rpmstrap}" ]; then
function setupDebian
{
copyModules
DEBIAN_FRONTEND=noninteractive chroot ${prefix} /usr/bin/apt-get --yes --force-yes install module-init-tools
fi
}
function setupCentOS4
{
copyModules
}
#
# Entry point to the script.
#
case "${dist}" in
sarge|etch|sid)
setupDebian
;;
centos4)
setupCentOS4
;;
*)
echo "Unknown distribution '${dist}'. Fixme";
exit;
;;
esac

View File

@ -8,6 +8,13 @@
prefix=$1
dist=$2
#
# This script doesn't do anything different on a per-distribution basis
#
#
# Useful hook for testing.

View File

@ -7,22 +7,45 @@
# --
# http://www.steve.org.uk/
prefix=$1
dist=$2
if [ "${rpmstrap}" ]; then
#
# Clean the crazy RPM scattered files.
#
find ${prefix}/etc -name '*.rpmorig' -exec rm -f \{\} \;
find ${prefix}/etc -name '*.rpmnew' -exec rm -f \{\} \;
else
#
# Clean APT cache
#
#
# Clean the APT package cache for Debian GNU/Linux.
#
function setupDebian
{
chroot ${prefix} /usr/bin/apt-get clean
}
fi
#
# Clean a new image of CentOS4.
#
function setupCentOS4
{
find ${prefix}/ -name '*.rpmorig' -exec rm -f \{\} \;
find ${prefix}/ -name '*.rpmnew' -exec rm -f \{\} \;
chroot ${prefix}/usr/bin/yum clean all
}
#
# Entry point to the script.
#
case "${dist}" in
sarge|etch|sid)
setupDebianSources
;;
centos4)
setupCentOS4
;;
*)
echo "Unknown distribution '${dist}'. Fixme";
exit;
;;
esac