From 35cdfe7569749721e569647a4b135394f87f3215 Mon Sep 17 00:00:00 2001 From: steve Date: Sat, 24 Dec 2005 07:34:06 +0000 Subject: [PATCH] 2005-12-24 07:34:06 by steve Fixed a couple of typos. Extended hook example. Updated sample /etc/xen-tools/xen-tools.conf file. --- xen-create-image | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/xen-create-image b/xen-create-image index cbf0acc..47d1d9c 100755 --- a/xen-create-image +++ b/xen-create-image @@ -9,7 +9,7 @@ xen-create-image - Create a new virtual Debian installation for Xen. xen-create-image [options] Help Options: - --debug Show the commandss, and ouptut, which the script creates. + --debug Show useful debugging information. --help Show this scripts help information. --manual Read this scripts manual. --version Show the version number and exit. @@ -182,18 +182,24 @@ Show the version number and exit. =for example begin # - # General options. + # Output directory. Images are stored beneath this directory, one + # subdirectory per hostname. # - dir = /home/xen # Ouptut directory - memory = 128Mb # 128Mb for each new image. + dir = /home/xen # - # Images + # Disk and Sizing options. # - fs = ext3 # We like EXT3 - swap = 128mb # 128Mb of swap. - size = 2Gb # 2Gb images. - kernel = /boot/vmlinuz-2.6.12-xenU # domU kernl + size = 2Gb # Disk image size. + memory = 128Mb # Memory size + swap = 128Mb # Swap size + filesystem = ext3 # use EXT3 filesystems + dist = sarge # Default distribution to install. + + # + # Kernel options. + # + kernel = /boot/vmlinuz-2.6.12-xenU # # Networking options. @@ -239,6 +245,9 @@ Show the version number and exit. xen-create-image --debootstrap='--include=screen,sudo,less' + An alternative is to use the hook directory, described below, to + run a script which will install a package. + =head1 HOOKS @@ -253,7 +262,8 @@ Show the version number and exit. and the second is the hostname of the new image. - A script could copy some modules to the new system, for example: + A script could copy some the kernel modules to the new system, and + install a package, for example: =for example start @@ -262,9 +272,14 @@ Show the version number and exit. prefix=$1 hostname=$2 + # Copy modules mkdir -p ${prefix}/lib/modules cp -R /lib/modules/2.6.12.6-xen/ ${prefix}/lib/modules + # Install the package 'module-init-tools' + DEBIAN_FRONTEND=noninteractive chroot $prefix /usr/bin/apt-get --yes --force-yes install module-init-tools + + =for example cut =cut @@ -277,7 +292,7 @@ Show the version number and exit. -- http://www.steve.org.uk/ - $Id: xen-create-image,v 1.60 2005-12-24 07:29:10 steve Exp $ + $Id: xen-create-image,v 1.61 2005-12-24 07:34:06 steve Exp $ =cut @@ -932,7 +947,7 @@ sub parseCommandLineArguments if ( $VERSION ) { - my $REVISION = '$Id: xen-create-image,v 1.60 2005-12-24 07:29:10 steve Exp $'; + my $REVISION = '$Id: xen-create-image,v 1.61 2005-12-24 07:34:06 steve Exp $'; $VERSION = join (' ', (split (' ', $REVISION))[2]); $VERSION =~ s/,v\b//; $VERSION =~ s/(\S+)$/$1/;