Subject: Re: Problem with installer and mkfs.
To: Bob Nestor <rnestor@metronet.com>
From: Stephen C. Brown <sbrown@shellx.best.com>
List: port-mac68k
Date: 01/07/1997 15:55:06
Hi Bob,

Actually, looking at the kernel source I supped a couple of days ago, it
seems the NetBSD/Mac68k kernel still determines the partition type the
same way as the installer(The code that does this is buried in the
"whichType()" routine in /usr/src/sys/arch/mac68k/mac68k/disksubr.c).
I can only imagine that this structure is some carryover from the A/UX
code.  After checking, I do concur that this structure was never monkeyed
with in the original MacOS "mkfs" code.  My assumption is that this
structure is something that "A/UX-aware" disk formatters add in when
creating partitions of type "Apple_UNIX_SVR2".  I guess this means that
this was just overlooked when the additions were made to allow the
latest MacOS-side "mkfs" to convert HFS partitions into "A/UX" partitions.
It really is a truly understandable mistake as this is an esoteric little
A/UX-specific partition-map addition.  Trust Apple to do something strange
and unusual to make things work... :-)

Steve Brown,
sbrown@best.com

p.s. I'll be more than happy to test any changes that you make.

>>The partition name makes no difference to the installer.  The partition
>>type should be "Apple_UNIX_SVR2".  The way it figures out whether a
>>partition is a "Root", "Usr", or "Swap" partition is through a structure
>>called a "blockzeroblock" structure that was placed in the part of the part-
>>ition entry referred to (in MacOS land) as the "pmPad" field(In the installer
>>code it is referred to as "pmBootArgs").  The specific field that it
>>looks at in the "blockzeroblock" structure is the "bzbFlags" field.
>
>Mkfs and the code I found in the Kernel both determine partition types by
>the contents of the partition name field, so there does appear to be a
>mismatch here. Sorry, but I never dug very deep into the Installer code
>to find out how it determined partition types.  I had been told a couple
>of times about these bit definitions, but I never found them in my old
>version of CodeWarrior and didn't bother reloading an even older version
>of Think C.  I'll dig into mkfs and see if I can straighten this out.
>The original mkfs never looked a the pmPad field in the Partition Map
>entry, and I never changed that.  It would appear that this needs to be
>added to mkfs and possibly to the Kernel as well.  I'll make the changes
>to mkfs tonite.  If Steve is willing to test them maybe we can have an
>updated mkfs available in a few days.
>
>-bob