<div class="gmail_quote">On Wed, Aug 10, 2011 at 5:48 AM, Mark Cave-Ayland <span dir="ltr"><<a href="mailto:mark.cave-ayland@siriusit.co.uk">mark.cave-ayland@siriusit.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On 09/08/11 22:54, William Hahne wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
BootX will only check the first few partitions from mac-parts to find<br>
the Mac OS partition. So it must expect drivers and void partitions to<br>
be ignored. This patch makes it so that if you specify the partition<br>
cd:1 and partition 1 is a driver it will keep checking partitions until<br>
reaching the first non-driver and non-void partition.<br>
<br>
Index: packages/mac-parts.c<br>
==============================<u></u>==============================<u></u>=======<br>
--- packages/mac-parts.c (revision 1041)<br>
+++ packages/mac-parts.c (working copy)<br>
@@ -200,15 +203,26 @@<br>
} else {<br>
/* Another partition was explicitly requested */<br>
- SEEK( bs * parnum );<br>
- READ( &par, sizeof(par) );<br>
+<br>
+ /* We have to find the first valid partition corresponding to the<br>
given number.<br>
+   This is because Apple sometimes includes a bunch of extra partitions<br>
that<br>
+   BootX expects to be ignored */<br>
+ while (parnum < par.pmMapBlkCnt) {<br>
+ SEEK( bs * parnum );<br>
+ READ( &par, sizeof(par) );<br>
- if( (__be32_to_cpu(par.<u></u>pmPartStatus) & kPartitionAUXIsValid) &&<br>
-    (__be32_to_cpu(par.<u></u>pmPartStatus) & kPartitionAUXIsAllocated) &&<br>
-    (__be32_to_cpu(par.<u></u>pmPartStatus) & kPartitionAUXIsReadable) ) {<br>
+ /* Check if valid, also device driver partitions are expected to be<br>
ignored */<br>
+ if( (__be32_to_cpu(par.<u></u>pmPartStatus) & kPartitionAUXIsValid) &&<br>
+    (__be32_to_cpu(par.<u></u>pmPartStatus) & kPartitionAUXIsAllocated) &&<br>
+    (__be32_to_cpu(par.<u></u>pmPartStatus) & kPartitionAUXIsReadable) &&<br>
+    !(__be32_to_cpu(par.<u></u>pmPartStatus) & kPartitionIsRealDeviceDriver)) {<br>
- offs = (long long)__be32_to_cpu(par.<u></u>pmPyPartStart) * bs;<br>
- size = (long long)__be32_to_cpu(par.<u></u>pmPartBlkCnt) * bs;<br>
+ offs = (long long)__be32_to_cpu(par.<u></u>pmPyPartStart) * bs;<br>
+ size = (long long)__be32_to_cpu(par.<u></u>pmPartBlkCnt) * bs;<br>
+ break;<br>
+ }<br>
+<br>
+ parnum++;<br>
}<br>
}<br>
</blockquote>
<br></div></div>
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.<br>
</blockquote><div><br></div><div>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.</div><div><br></div><div>William Hahne</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
ATB,<br>
<br>
Mark.<br>
<br>
-- <br>
Mark Cave-Ayland - Senior Technical Architect<br>
PostgreSQL - PostGIS<br>
Sirius Corporation plc - control through freedom<br>
<a href="http://www.siriusit.co.uk" target="_blank">http://www.siriusit.co.uk</a><br>
t: <a href="tel:%2B44%20870%20608%200063" value="+448706080063" target="_blank">+44 870 608 0063</a><br>
<br>
Sirius Labs: <a href="http://www.siriusit.co.uk/labs" target="_blank">http://www.siriusit.co.uk/labs</a><br><font color="#888888">
<br>
-- <br>
OpenBIOS                 <a href="http://openbios.org/" target="_blank">http://openbios.org/</a><br>
Mailinglist:  <a href="http://lists.openbios.org/mailman/listinfo" target="_blank">http://lists.openbios.org/<u></u>mailman/listinfo</a><br>
Free your System - May the Forth be with you<br>
</font></blockquote></div><br>