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());