diff --git a/xen-duplicate-image b/xen-duplicate-image index e15098c..111374d 100755 --- a/xen-duplicate-image +++ b/xen-duplicate-image @@ -100,7 +100,7 @@ Specify the virtual instance that we should copy. -- http://www.steve.org.uk/ - $Id: xen-duplicate-image,v 1.1 2005-12-19 11:23:05 steve Exp $ + $Id: xen-duplicate-image,v 1.2 2005-12-19 14:54:40 steve Exp $ =cut @@ -266,105 +266,12 @@ if ( ! $mount =~ /$image_out/) { } # -# Copy any local .deb files into the debootstrap archive as a potential -# speedup. -# -`mkdir -p $dir/var/cache/apt/archives`; -foreach my $file ( glob( "/var/cache/apt/archives/*.deb" ) ) -{ - File::Copy::cp( $file, "$dir/var/cache/apt/archives" ); -} - -# -# Install the base system. -# -print "Running debootstrap to install the system. This will take a while!\n"; -`debootstrap sarge $dir $CONFIG{'mirror'}`; -print "Done\n"; - -# -# Copy these files as a speed boost for the next run. -# -foreach my $file ( glob( "$dir/var/cache/apt/archives/*.deb" ) ) -{ - File::Copy::cp( $file, "/var/cache/apt/archives" ); -} - -# -# If the debootstrap failed then we'll setup the output directories -# for the configuration files here. +# Setup the output directories for the configuration files here - note +# that this should already exist. # `mkdir -p $dir/etc/apt`; `mkdir -p $dir/etc/network`; -# -# OK now we can do the basic setup. -# -print "Setting up APT sources .. "; -open( APT, ">", $dir . "/etc/apt/sources.list" ); -print APT<", $dir . "/etc/fstab" ); -print TAB< ) - { - chomp $line; - if ( $line =~ /:respawn:/ ) - { - if ( $line =~ /^1/ ) - { - # NOP - leave line unchanged. - } - else - { - # Otherwise comment out the line, we don't need multiple - # terminals since we can only access one. - $line = "#" . $line; - } - } - push @init, $line; - } - close( INITTAB ); - - - open( OUTPUT, ">", "$prefix/etc/inittab" ); - foreach my $line ( @init ) - { - print OUTPUT $line . "\n"; - } - close( OUTPUT ) -}