Subject: Re: Installer and root partition roulette
To: JP Montagnet <jope@n2h2.com>
From: Bob Nestor <rnestor@metronet.com>
List: port-mac68k
Date: 07/24/1998 06:51:47
El JoPe Magnifico <jope@n2h2.com> wrote:

>On Thu, 23 Jul 1998, Bill Studenmund wrote:
>>>> The reason I ask, is that I'm experimenting with both Linux and NetBSD
>>>> on my Mac, which naturally involves installing a filesystem for each.
>>>> But my Linux root partition comes earlier than my NetBSD root partition,
>>>> and is being picked up by the Installer as the root partition it should
>>>> try to mount, which of course bombs the Installer.  Also, dunno if the
>>>> Booter has this same problem, since it can't get any farther than it
>>>> currently does without something installed.
>>> 
>>> Yep - you'll have the same problem in the booter.
>> 
>> I thought the reason for having the "root partition name" field in the
>> booter was so that the booter and netbsd would look at a specific partition
>> for the root partition. The idea being that you could have a root, and an
>> alternate root, partition. You could also boot from either one.
>
>That was exactly the answer I was looking for.  I know the Mkfs tool names
>that partition "NetBSD Root", so don't see why the Booter doesn't look for
>that first, then roll over into the first Unix-type root partition.

It's possible to use 3rd party disk formatters to create and initialize 
A/UX partitions that NetBSD can use, and many users choose to do their 
installations this way.  So making the Kernel depend on the name "NetBSD 
Root" would break a lot of user installations. As far as I know, only 
Mkfs renames the partition to "NetBSD Root", and I really only did that 
as a way of telling that Mkfs had munged up the partition map entry.  
It's been a long time, but as I recall, the Kernel searches for the 
string "root" in the partition name.  I'm not sure why it doesn't also 
check the partition flags to determine if it's really a NetBSD Root 
partition.  The Installer checks the flags when looking for a "Usr" type 
partition though.

One possible solution would be to modify the Kernel and possibly the 
Installer to always validate partition type using the partition type and 
flags rather than partition type and name field.  This assumes that Linux 
isn't using them which I believe is true for MacLinux on the PPC judging 
from the comments I saw in the pdisk code.

If the Kernel is currently using the flags to valid partition type, then 
JP's Linux solution might be to re-initialize his Linux partitions into 
HFS ones.  This should wipe out the partition flags. Then use Mkfs to 
convert them to AU/X types rather than NetBSD types.  I think in this 
case Mkfs doesn't set the partition flags.  You can use Mkfs to check for 
the presence of the flags in a partition by checking to see if it shows 
up as an "Apple Free" type partition.  Any partition that can't be 
classified is dumped into this category. This is also a good way to check 
to see if a 3rd party formatter has really build NetBSD compatible A/UX 
partitions.  If they show up as NetBSD partitions then have the flags 
properly set. The flags are used by Mkfs to determine the type of BSD 
partition (Root, SWAP, Usr, Root&Usr).

Hope this helps,
-bob