Anyboot CD detection, remove nr of partitions check

When booting from floppy image (BOOT_VOLUME_BOOTED_FROM_IMAGE)
we don't know the partition offset, and the number of partitions
are different for 32 bit and 64 bit anyboot cds. So don't check
for number of partitions.

This should only happen when BOOT_VOLUME_BOOTED_FROM_IMAGE
is set. Its intention is to signal if boot was from a floppy
image, so most boot platforms should not set it. It seems they
do, that probably needs a fix of its own.

Change-Id: I6b60a997b72b9928555840358257e15ff417fd42
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3819
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
Fredrik Holmqvist 2021-03-22 17:29:56 +01:00
parent 10ff9c6a14
commit 99806fe3d6

View File

@ -275,11 +275,11 @@ DiskBootMethod::IsBootPartition(KPartition* partition, bool& foundForSure)
if (fMethod == BOOT_METHOD_CD) {
// Check for the boot partition of an anyboot CD. We identify it as
// such, if it is the only primary partition on the CD, has type
// BFS, and the boot partition offset is 0.
// such if it is a partition on the CD, has type BFS, and the boot
// partition offset is 0
KDiskDevice* device = partition->Device();
if (IsBootDevice(device, false) && bootPartitionOffset == 0
&& partition->Parent() == device && device->CountChildren() == 1
if (IsBootDevice(device, false)
&& bootPartitionOffset == 0 && partition->Parent() == device
&& device->ContentType() != NULL
&& strcmp(device->ContentType(), kPartitionTypeIntel) == 0
&& partition->ContentType() != NULL