diff --git a/etc/hook.d/.cvsignore b/etc/hook.d/.cvsignore deleted file mode 100644 index 72e8ffc..0000000 --- a/etc/hook.d/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/etc/hook.d/10-disable-tls b/etc/hook.d/10-disable-tls index 33c97cf..1b3c247 100755 --- a/etc/hook.d/10-disable-tls +++ b/etc/hook.d/10-disable-tls @@ -4,6 +4,5 @@ # prefix=$1 -hostname=$2 mv ${prefix}/lib/tls ${prefix}/lib/tls.disabled diff --git a/etc/hook.d/20-setup-apt b/etc/hook.d/20-setup-apt index 90cd0fe..0f8d7e4 100755 --- a/etc/hook.d/20-setup-apt +++ b/etc/hook.d/20-setup-apt @@ -4,7 +4,6 @@ # prefix=$1 -hostname=$2 cat < ${prefix}/etc/apt/sources.list # diff --git a/etc/hook.d/30-fix-inittab b/etc/hook.d/30-fix-inittab index afe546b..d62a536 100755 --- a/etc/hook.d/30-fix-inittab +++ b/etc/hook.d/30-fix-inittab @@ -7,7 +7,6 @@ # prefix=$1 -hostname=$2 cat /etc/inittab | \ sed "s/tty1$/console/g" | \ diff --git a/etc/hook.d/40-setup-networking b/etc/hook.d/40-setup-networking index 434458d..32127bf 100755 --- a/etc/hook.d/40-setup-networking +++ b/etc/hook.d/40-setup-networking @@ -5,7 +5,6 @@ # prefix=$1 -hostname=$2 if [[ -z "${dhcp}" ]]; then diff --git a/etc/hook.d/50-setup-hostname b/etc/hook.d/50-setup-hostname index dd4bb0a..fe5a976 100755 --- a/etc/hook.d/50-setup-hostname +++ b/etc/hook.d/50-setup-hostname @@ -6,8 +6,6 @@ prefix=$1 -hostname=$2 - echo ${hostname} > ${prefix}/etc/hostname echo ${hostname} > ${prefix}/etc/mailname diff --git a/etc/hook.d/60-copy-host-files b/etc/hook.d/60-copy-host-files index e1343da..a0c3ed6 100755 --- a/etc/hook.d/60-copy-host-files +++ b/etc/hook.d/60-copy-host-files @@ -6,7 +6,6 @@ prefix=$1 -hostname=$2 cp /etc/resolv.conf ${prefix}/etc/ cp /etc/hosts ${prefix}/etc/ diff --git a/etc/hook.d/70-install-ssh b/etc/hook.d/70-install-ssh index 9e4a70b..27d0c9e 100755 --- a/etc/hook.d/70-install-ssh +++ b/etc/hook.d/70-install-ssh @@ -4,7 +4,6 @@ # prefix=$1 -hostname=$2 chroot ${prefix} /usr/bin/apt-get update DEBIAN_FRONTEND=noninteractive chroot ${prefix} /usr/bin/apt-get --yes --force-yes install ssh diff --git a/etc/hook.d/80-install-modules b/etc/hook.d/80-install-modules index e21b7c9..51e9cc8 100755 --- a/etc/hook.d/80-install-modules +++ b/etc/hook.d/80-install-modules @@ -10,7 +10,6 @@ # The virtual image is mounted here. # prefix=$1 -hostname=$2 # # Copy the modules from the host to the new system - we should only diff --git a/etc/hook.d/90-make-fstab b/etc/hook.d/90-make-fstab index c170d27..e883ac1 100755 --- a/etc/hook.d/90-make-fstab +++ b/etc/hook.d/90-make-fstab @@ -9,11 +9,10 @@ # # Steve # -- -# $Id: 90-make-fstab,v 1.1 2005-12-24 20:05:46 steve Exp $ +# $Id: 90-make-fstab,v 1.2 2005-12-24 20:34:44 steve Exp $ prefix=$1 -hostname=$2 # diff --git a/etc/hook.d/99-clean-image b/etc/hook.d/99-clean-image index 8c8bdc1..81941cd 100755 --- a/etc/hook.d/99-clean-image +++ b/etc/hook.d/99-clean-image @@ -6,7 +6,6 @@ prefix=$1 -hostname=$2 chroot $prefix /usr/bin/apt-get clean diff --git a/xen-create-image b/xen-create-image index e56891f..8b77110 100755 --- a/xen-create-image +++ b/xen-create-image @@ -258,9 +258,9 @@ Show the version number and exit. To do this place executable scripts inside the "hook directory" /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. + Each executable script in this directory will be executed in turn + and given the name of the mount point the image is available at as + its single argument. The scripts will also have a complete copy of the configuration options set in its environment. For example the IP address would @@ -274,7 +274,6 @@ Show the version number and exit. #!/bin/sh prefix=$1 - hostname=$2 # Copy modules mkdir -p ${prefix}/lib/modules @@ -300,7 +299,7 @@ Show the version number and exit. -- http://www.steve.org.uk/ - $Id: xen-create-image,v 1.66 2005-12-24 20:05:46 steve Exp $ + $Id: xen-create-image,v 1.67 2005-12-24 20:34:44 steve Exp $ =cut @@ -835,7 +834,7 @@ sub parseCommandLineArguments if ( $VERSION ) { - my $REVISION = '$Id: xen-create-image,v 1.66 2005-12-24 20:05:46 steve Exp $'; + my $REVISION = '$Id: xen-create-image,v 1.67 2005-12-24 20:34:44 steve Exp $'; $VERSION = join (' ', (split (' ', $REVISION))[2]); $VERSION =~ s/,v\b//; $VERSION =~ s/(\S+)$/$1/; @@ -1177,19 +1176,16 @@ sub getTerminalSize =head2 runHooks When the image has been created, but before the temporary image - is unmounted there is the opportunity for a number of hooks to be - run. + is unmounted each executable script inside the hook directory will + be executed. (The scripts are executed "in order" which might + be useful for users who wish to ensure some actions occur before + others.) - Every script inside the directory /etc/xen-tools/xen-create-image.d/ - which is executable will be run in order. + The scripts will be given single argument: the name of the directory + within which the image is mounted. - The scripts will be given a pair of arguments: - - 1. The directory name upon which the image is currently mounted. - 2. The hostname of the new image. - - The rest of the configuration variables will be passed via the - environment. + (The rest of the configuration variables will be passed via + environmental variables.) =cut @@ -1230,7 +1226,7 @@ sub runHooks } print " Running hook: $name"; - runCommand( $file . " " . $prefix . " " . $CONFIG{'hostname'} ); + runCommand( $file . " " . $prefix ); print " - done.\n"; } }