1
0
mirror of synced 2026-01-15 15:56:10 +00:00
steve b973784e6e 2006-12-25 22:36:18 by steve
Actually terminate early if we've got a populated /dev directory - rather than just reporting that we will terminate and not actually doing so.
2006-12-25 22:36:18 +00:00

52 lines
747 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
#
# Source our common functions
#
if [ -e /usr/lib/xen-tools/common.sh ]; then
. /usr/lib/xen-tools/common.sh
else
. ./hooks/common.sh
fi
#
# Log our start
#
logMessage Script $0 starting
#
# Early termination if we have a couple of common devices present
# should speed up installs which use --copy/--tar
#
if ( test `ls -1 ${prefix}/dev | wc -l` -gt 10 ); then
logMessage "Terminating because there appear to be files in /dev already"
exit
fi
#
# Make the device nodes.
#
cd ${prefix}/dev
./MAKEDEV generic
#
# Log our finish
#
logMessage Script $0 finished