From 7c2c003f9118e411e04f6f62287d1771fdad9f8b Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Mon, 7 Feb 2011 18:37:02 +0000 Subject: [PATCH] Boot partition is not a valid target either, at least not until installing on it don't leads to warranted crash... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40371 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/installer/WorkerThread.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/apps/installer/WorkerThread.cpp b/src/apps/installer/WorkerThread.cpp index 32026f03ef..5c88f5b917 100644 --- a/src/apps/installer/WorkerThread.cpp +++ b/src/apps/installer/WorkerThread.cpp @@ -643,14 +643,28 @@ TargetVisitor::Visit(BPartition *partition, int32 level) // TODO: After running DriveSetup and doing another scan, it would // be great to pick the partition which just appeared! - // Only BFS partitions are valid targets, but we want to display the + bool isBootPartition = false; + if (partition->IsMounted()) { + BPath mountPoint; + partition->GetMountPoint(&mountPoint); + isBootPartition = strcmp(BOOT_PATH, mountPoint.Path()) == 0; + } + + // Only non-boot BFS partitions are valid targets, but we want to display the // other partitions as well, in order not to irritate the user. - bool isValidTarget = partition->ContentType() != NULL + bool isValidTarget = isBootPartition == false + && partition->ContentType() != NULL && strcmp(partition->ContentType(), kPartitionTypeBFS) == 0; char label[255]; char menuLabel[255]; make_partition_label(partition, label, menuLabel, !isValidTarget); + + printf("Partion: \"%s\" : isValidTarget = %s isBootPartition = %s\n", + menuLabel, isValidTarget ? "true" : "false", + isBootPartition ? "true" : "false"); + + PartitionMenuItem* item = new PartitionMenuItem(partition->ContentName(), label, menuLabel, new BMessage(TARGET_PARTITION), partition->ID());