From d0f85802bde041580961592491a497160b66073d Mon Sep 17 00:00:00 2001 From: John Hughes Date: Wed, 30 May 2012 19:40:12 +0200 Subject: [PATCH] Always write down root partition as first physical device Otherwise pygrub fails. Closes Debian bug report #609673 --- etc/xm.tmpl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/etc/xm.tmpl b/etc/xm.tmpl index e023560..c53970f 100644 --- a/etc/xm.tmpl +++ b/etc/xm.tmpl @@ -53,7 +53,17 @@ memory = '{$memory}' $OUT .= "disk = [\n"; for ( my $i = $#PARTITIONS; $i >= 0 ; $i-- ) { - $OUT .= " '$PARTITIONS[$i]{'imagetype'}$PARTITIONS[$i]{'image'},$device" . ( $i + 1 ) .",w',\n"; + if ( $PARTITIONS[$i]{'mountpoint'} eq '/' ) + { + $OUT .= " '$PARTITIONS[$i]{'imagetype'}$PARTITIONS[$i]{'image'},$device" . ( $i + 1 ) .",w',\n"; + } + } + for ( my $i = $#PARTITIONS; $i >= 0 ; $i-- ) + { + if ( $PARTITIONS[$i]{'mountpoint'} ne '/' ) + { + $OUT .= " '$PARTITIONS[$i]{'imagetype'}$PARTITIONS[$i]{'image'},$device" . ( $i + 1 ) .",w',\n"; + } } $OUT .= " ]\n"; }