diff --git a/xen-create-image b/xen-create-image index a582d6c..db334cb 100755 --- a/xen-create-image +++ b/xen-create-image @@ -242,22 +242,25 @@ Show the version number and exit. =head1 HOOKS - Once the image has been installed using debootstrap there is + After the image has been installed using debootstrap there is the chance for you to run some scripts before the image is unmounted. To do this place executable scripts inside the "hook directory" - /etc/xen-tools/xen-create-image.d. Each script there will be - executed in turn. + /etc/xen-tools/xen-create-image.d/. + + Each script will be executed in turn and given two parameters, + the first is the name of the mount point the image is available at, + and the second is the hostname of the new image. - The scripts will be passed a single argument which is the prefix - of the mounted filesystem. A script could copy some modules to the new system, for example: =for example start #!/bin/sh + prefix=$1 + hostname=$2 mkdir -p ${prefix}/lib/modules cp -R /lib/modules/2.6.12.6-xen/ ${prefix}/lib/modules @@ -274,7 +277,7 @@ Show the version number and exit. -- http://www.steve.org.uk/ - $Id: xen-create-image,v 1.58 2005-12-24 07:16:04 steve Exp $ + $Id: xen-create-image,v 1.59 2005-12-24 07:19:41 steve Exp $ =cut @@ -929,7 +932,7 @@ sub parseCommandLineArguments if ( $VERSION ) { - my $REVISION = '$Id: xen-create-image,v 1.58 2005-12-24 07:16:04 steve Exp $'; + my $REVISION = '$Id: xen-create-image,v 1.59 2005-12-24 07:19:41 steve Exp $'; $VERSION = join (' ', (split (' ', $REVISION))[2]); $VERSION =~ s/,v\b//; $VERSION =~ s/(\S+)$/$1/; @@ -1484,7 +1487,7 @@ sub runHooks if ( ( -x $file ) && ( -f $file ) ) { print "Running hook: $file\n"; - runCommand( $file . " " . $prefix ); + runCommand( $file . " " . $prefix . " " . $CONFIG{'hostname'} ); print "Done\n"; } }