From 22a4774cfe133734bab48bee758d161b98a0fbeb Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Sun, 23 Nov 2008 21:12:42 +0000 Subject: [PATCH] Updated to work with partitions --- etc/xm.tmpl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/etc/xm.tmpl b/etc/xm.tmpl index a0dc424..9754cd2 100644 --- a/etc/xm.tmpl +++ b/etc/xm.tmpl @@ -22,19 +22,22 @@ memory = '{$memory}' # Disk device(s). # { - for ( my $i = 0; $i <= $#PARTITIONS; $i++ ) + if ( !defined($image_vbd ) ) { + for ( my $i = 0; $i <= $#PARTITIONS; $i++ ) + { if ( $PARTITIONS[$i]{'mountpoint'} eq '/' ) { $OUT .= "root = '/dev/$device" . ($i + 1) . " ro'\n"; } - } - $OUT .= "disk = [\n"; - for ( my $i = 0; $i <= $#PARTITIONS; $i++ ) - { + } + $OUT .= "disk = [\n"; + for ( my $i = 0; $i <= $#PARTITIONS; $i++ ) + { $OUT .= " '$PARTITIONS[$i]{'imagetype'}$PARTITIONS[$i]{'image'},$device" . ( $i + 1 ) .",w',\n"; + } + $OUT .= " ]\n"; } - $OUT .= " ]\n"; } # @@ -43,14 +46,14 @@ memory = '{$memory}' { if ( $image_vbd ) { - $OUT .= "root = '/dev/$image-dev ro'\n"; + $OUT .= "root = '/dev/$device" . "1 ro'\n"; $OUT .= "disk = [ '$image_vbd,sda1,w' "; } if ( $swap_vbd ) { $OUT .= ", '$swap_vbd,sda2,w'"; } - if ( $imag_vbd ) + if ( $image_vbd ) { $OUT .= " ]\n"; }