1
0
mirror of synced 2026-01-28 20:31:03 +00:00
Files
xen-tools.xen-tools/etc/hook.d/55-create-dev
radu 2b23f342d5 2006-05-26 15:31:25 by radu
Do not run MAKEDEV if the system is using udev
2006-05-26 15:31:25 +00:00

63 lines
849 B
Bash
Executable File

#!/bin/sh
#
# This script ensures that the new guest images have a nicely
# populated /dev directory.
#
# Steve
# --
# http://www.steve.org.uk/
prefix=$1
dist=$2
#
# Exit if the system uses udev
#
if [[ -d /dev/.udev ]]; then
exit
fi
#
# This routine sets up /dev on a Debian GNU/Linux system.
#
function setupDebian
{
cd ${prefix}/dev
./MAKEDEV generic
}
#
# This routine sets up /dev on a CentOS4 system.
#
function setupCentOS4
{
chroot ${prefix} /bin/sh -c 'cd /dev && ./MAKEDEV console'
chroot ${prefix} /bin/sh -c 'cd /dev && ./MAKEDEV null'
chroot ${prefix} /bin/sh -c 'cd /dev && ./MAKEDEV zero'
}
#
# Entry point to the script.
#
case "${dist}" in
sarge|etch|sid)
setupDebian
;;
centos4)
setupCentOS4
;;
*)
echo "Unknown distribution '${dist}'. Fixme";
exit;
;;
esac