Subject: Re: handling NetBSD partitions in the Apple Partition Map [was
To: Neil Ludban <nludban@columbus.rr.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: port-macppc
Date: 10/08/2002 14:44:13
On Tue, 8 Oct 2002, Neil Ludban wrote:

> Bill Studenmund wrote:
> >
> > Well, where else do we encode it? If we're trying to make Apple tools work
> > with our partitions, as I understand it, the partition type is all we have
> > to play with. Or could we get Apple's tools to add the root vs usr flags?
>
> This is my current understanding of the available bits (picked up from
> working with NetBSD, take with a large grain of salt):
>
>   pmPartName ( "Extra", "MacOS", "A/UX Root", "A/UX User", "Swap" )
>   pmPartType ( "Apple_Free", "Apple_HFS", "Apple_UNIX_SVR2" )
>   bzbFlags ( FS, SWAP )
>   bzbType ( ROOT, USER ) // if bzbFlags==FS

Correct, except that the bzb stuff only matters if it's an Apple_UNIX_SVR2
partition.

We were discussing what we might shove in that area if we had NetBSD*
partitions, but we all agree that it would be fine to have empty contents.
i.e. you can have the formatter make a "NetBSD_foo" partition and thigns
will work.

> pmPartName is never referenced by NetBSD (1.6-RELEASE), but looks like
> the proper place for partition letter (implied by root, swap, usr, ...
> or explicitly a-h).

I think it's better to leave the name alone. I think it's the domain of
human naming. Also, we will be adding APM partitioning tools, so we'll be
able to see "/dev/sd0f" and its APM name. Something like "News spool" is
more useful (to me) than "f". :-)

Also, we need to be compatabile with current instalations, and they ignore
the name now.

> pmPartType is the kind of filesystem (NetBSD_4.2BSD, NetBSD_4.4LFS, ...)
> and not what it's used for (unless being mounted on / makes some change
> to the on-disk structure ???).

Technically, if it starts with "NetBSD", then we can make the pmPartType
whatever we want. If we want to put a "root" or "user" designation in
there, we can. Because at one point of the disklabel groveling code, they
are treated differently.

> The use of USER means non-swap and non-root, not /usr.  NetBSD assigns
> the first USER partition as /usr (g).  Do Mac utilities allow unsetting
> the user bit on all but the real /usr?

Uhm, I think you'll have a hard time arguing the term isn't "usr" as
that's what Apple called it with A/UX back in like 1987 or so (whenever
they came out w/ it). It's just that we take "usr" to mean, if you're
the first one, become partition g. If not, become some other parition.

The only bits in the bzbflags we look at are the root ones, so unsetting
us{,e}r bits won't make a difference to us. Also, we only keep root and
usr concepts, not root, usr, and other for our file system partitions.

> Can the Mac utilities be used to create partitions with arbitrary NetBSD
> compatible pmPartNames and pmPartTypes, and use NetBSD kernel/utilities
> to set pmBootArgs overlay (replace bzb, for block/frags/cpg)?

That is exactly what we want to make happen. :-)

Take care,m

Bill