Hi,

There is no documentation saying that but you may freely interpret as those things are NOT partitions in apple speaking, they are ALWAYS called just drivers.

El 10/08/2011, a las 16:23, William Hahne escribió:

On Wed, Aug 10, 2011 at 5:48 AM, Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> wrote:
On 09/08/11 22:54, William Hahne wrote:

BootX will only check the first few partitions from mac-parts to find
the Mac OS partition. So it must expect drivers and void partitions to
be ignored. This patch makes it so that if you specify the partition
cd:1 and partition 1 is a driver it will keep checking partitions until
reaching the first non-driver and non-void partition.

Index: packages/mac-parts.c
===================================================================
--- packages/mac-parts.c (revision 1041)
+++ packages/mac-parts.c (working copy)
@@ -200,15 +203,26 @@
} else {
/* Another partition was explicitly requested */
- SEEK( bs * parnum );
- READ( &par, sizeof(par) );
+
+ /* We have to find the first valid partition corresponding to the
given number.
+   This is because Apple sometimes includes a bunch of extra partitions
that
+   BootX expects to be ignored */
+ while (parnum < par.pmMapBlkCnt) {
+ SEEK( bs * parnum );
+ READ( &par, sizeof(par) );
- if( (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsValid) &&
-    (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsAllocated) &&
-    (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsReadable) ) {
+ /* Check if valid, also device driver partitions are expected to be
ignored */
+ if( (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsValid) &&
+    (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsAllocated) &&
+    (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsReadable) &&
+    !(__be32_to_cpu(par.pmPartStatus) & kPartitionIsRealDeviceDriver)) {
- offs = (long long)__be32_to_cpu(par.pmPyPartStart) * bs;
- size = (long long)__be32_to_cpu(par.pmPartBlkCnt) * bs;
+ offs = (long long)__be32_to_cpu(par.pmPyPartStart) * bs;
+ size = (long long)__be32_to_cpu(par.pmPartBlkCnt) * bs;
+ break;
+ }
+
+ parnum++;
}
}

I remember last time I reworked this, I had to spend a lot of time reading the Apple HFS documentation with regard to this. Could you add a link to the documentation on the Apple site into the commit message, and confirm whether this is something I missed which is documented or it's new behaviour that you have discoverd through testing.

This is something I discovered through testing and carefully looking through the BootX source code. I don't know if there is documentation on this or not.

William Hahne

 
ATB,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs

--
OpenBIOS                 http://openbios.org/
Mailinglist:  http://lists.openbios.org/mailman/listinfo
Free your System - May the Forth be with you

--
OpenBIOS                 http://openbios.org/
Mailinglist:  http://lists.openbios.org/mailman/listinfo
Free your System - May the Forth be with you