From a79d89ad3339f2efa5b57cf6b7fcab6eaea8ff2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Jourdois?= Date: Sat, 30 Oct 2010 16:37:03 +0200 Subject: [PATCH] Mount partitions by "shortest mountpoint" order. Partitions were mounted in config file order, so you could not see all mounted partitions. This (at least temporarily) fixes it. --- KNOWN_BUGS | 15 +++++++++++++++ bin/xen-create-image | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/KNOWN_BUGS b/KNOWN_BUGS index 41b4acb..1f91804 100644 --- a/KNOWN_BUGS +++ b/KNOWN_BUGS @@ -11,3 +11,18 @@ Bugs to fix before a 4.3 release http://xen-tools.org/pipermail/xen-tools-discuss/2010-May/000757.html * xen-delete-image ignores extension setting + +* partitions were mounted in config file order, not in mountpoint order. + That implies that if you specified : + /boot + / + in that order, / was mounted _over_ /boot, and you would not _see_ /boot. + Xen-Tools would then install boot on your / partition, and your boot device + was just empty and unbootable. + + Workaround for 4.2 is to write your partition file such as mounts overlap + correctly when mounted in specified order. + + Current (unreleased) fix is to sort by mountpoint length. + + Fix would be to reproduce what mount does with mount -a. diff --git a/bin/xen-create-image b/bin/xen-create-image index 5c4b74b..99d6c2c 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -3451,7 +3451,7 @@ sub mountImage # $MOUNT_POINT = tempdir( CLEANUP => 1 ); - foreach my $partition (@PARTITIONS) + foreach my $partition (sort { length($a->{'mountpoint'}) <=> length($b->{'mountpoint'}) } @PARTITIONS) { if ( $partition->{ 'type' } ne 'swap' ) {