1
0
mirror of synced 2026-01-27 12:12:07 +00:00
Files
xen-tools.xen-tools/etc/hook.d/80-install-modules
steve 2862fb995d 2006-05-24 19:35:16 by steve
More updates.
2006-05-24 19:35:16 +00:00

64 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
#
# Install modules from the host system into the new image, and
# ensure that 'module-init-tools' is setup.
#
# This is most likely required if you're using a custom kernel
# for your Xen system. But even if it isn't required it can't
# really do anything bad; just waste a bit of space.
#
# Steve
# --
# http://www.steve.org.uk/
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.
#
function copyModules
{
mkdir -p ${prefix}/lib/modules
cp -R /lib/modules/*/ ${prefix}/lib/modules
}
#
# Setup the modules on a Debian GNU/Linux system.
#
function setupDebian
{
copyModules
DEBIAN_FRONTEND=noninteractive chroot ${prefix} /usr/bin/apt-get --yes --force-yes install module-init-tools
}
function setupCentOS4
{
copyModules
}
#
# Entry point to the script.
#
case "${dist}" in
sarge|etch|sid)
setupDebian
;;
centos4)
setupCentOS4
;;
*)
echo "Unknown distribution '${dist}'. Fixme";
exit;
;;
esac