Port-macppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Notes from installing on a G4 Mac Mini



Hi,

I recently installed NetBSD 5.0_RC2 on a macppc Mac Mini, in a
"NetBSD is alone on this system" mode.  Here are a few notes, jotted
down while I still remember the few important points, to possibly
save people from frustration if they have the same goal.  Please
note that these notes do not replace the installation instructions.

In my case I took out the original disk and replaced it with a brand
new 2.5" drive.  Opening the case can be fiddly, and something which
would certainly void your warranty.  But I'm guessing we're past the
point of worrying about that when we're considering installing
NetBSD as the only OS, right? :)

Of course, initially all boot attempts must be halted by holding
down Cmd-Opt-O-F until the screen lights up and OFW tells you to
release the keys.

First off, I started with the ISO image for 4.0.1.  This is because
I have a vague recollection that the newer macppc ISO images are un-
bootable.  I beleive/hope there is now a PR about the issue(?)

OFW has a "dir" command, and while it might be tempting to be
careful and look at what's on the 4.0.1 CD before trying to boot it,
don't bother.  The file you need to boot, netbsd.macppc, is marked
as "hidden", so it will not show up on the "dir" output in OFW.  I
have no idea why this is done, except to throw us poor unsuspecting
users a nasty curve-ball...

Boot with "boot cd:,\ofwboot.xcf netbsd.macppc".

For the hard drive to be bootable, I've found that it needs to have
a HFS partition.  This partition needs a copy of the ofwboot.xcf
file.  Also, macppc needs to use the Apple partitioning scheme, and
sysinst does not appear to have support for creating such
partitions(?).  Therefore, before starting the installation with
sysinst I partitioned the disk using the "pdisk" utility, as
described on

  http://www.netbsd.org/ports/macppc/partitioning.html#pdisk

Don't worry about the "only in -current" comment; this document
pre-dates the release of 4.0, and the install image contains pdisk
as /sbin/pdisk.

This is how I chose to set up my partitions with pdisk:

Partition map (with 512 byte blocks) on '/dev/wd0c'
 #:                type name           length   base      ( size )
 1: Apple_partition_map Apple              63 @ 1
 2:           Apple_HFS Boot            40960 @ 64        ( 20.0M)
 3:     Apple_UNIX_SVR2 NetBSD-root    409600 @ 41024     (200.0M) S0 RUFS k0  /
 4:     Apple_UNIX_SVR2 NetBSD-swap   2662400 @ 450624    (  1.3G) S1  SFS k0  
(swap)
 5:     Apple_UNIX_SVR2 NetBSD-var    8388608 @ 3113024   (  4.0G) S2  UFS k0
 6:     Apple_UNIX_SVR2 NetBSD-usr  301080176 @ 11501632  (143.6G) S2  UFS k0  
/usr

The Apple partitions will automatically show up in the NetBSD
disklabel, so you don't need to re-partition the drive using
sysinst.  With the above partitioning, my disklabel ended up like
this:

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:    409600     41024     4.2BSD   1024  8192     0  # (Cyl.     40*-    447*)
 b:   2662400    450624       swap                     # (Cyl.    447*-   3088*)
 c: 312581808         0     unused      0     0        # (Cyl.      0 - 310100)
 d:     40960        64        HFS                     # (Cyl.      0*-     40*)
 e: 301080176  11501632     4.2BSD   1024  8192     0  # (Cyl.  11410*- 310100)
 g:   8388608   3113024     4.2BSD   1024  8192     0  # (Cyl.   3088*-  11410*)

Note, when I set up the /var partition with "pdisk" on this disk,
it asked me for what I thought was a partition letter.  However,
that appears to not have been the case, so take care to match up
your partitions with the expected sizes -- in my case I ended up
with the contents of /usr installed on the partition which was
intended for /var, which didn't work out too well (it filled
up...), forcing me to re-do the installation.

I installed using sysinst in the normal manner, but as I already
partitioned the drive I chose "use existing label".  I needed to
fill in the file system parameters, to tell sysinst to newfs, and
tell it the mount points for the partitions.

There are no tools in our OS distribution for creating a HFS file
system or for copying files there.  However, the tools exist in
pkgsrc.  So after the installation with sysinst is done, you need to
do the last steps to make the disk bootable.  Briefly, you need to
mount the newly-created file systems and chroot to the installed
root, i.e. in my case

  mount /dev/wd0a /mnt
  mount /dev/wd0e /mnt/usr
  mount /dev/wd0g /mnt/var
  chroot /mnt

and fetch the two required packages:

  libhfs-3.2.6nb2.tgz
  hfsutils-3.2.6nb1.tgz

These can be fetched from the binary packages repository on
ftp.netbsd.org in

  ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/powerpc/4.0/All/

Add them with "pkg_add", and prepare the contents:

  hformat /dev/wd0d
  hmount /dev/wd0d
  hcopy /usr/mdec/ofwboot.xcf :
  humount

and halt the machine, only to power it up again in OFW.  Now, to
complete the setup, you need to do a few settings in OFW:

  setenv boot-device hd:,ofwboot.xcf
  setenv auto-boot? true

and to have the screen activated on reboot an additional setting
is required:

  setenv boot-command " screen" output boot

(note, the whitespace before 'screen' is significant.)

Now, to make these settings "stick", you apparently need to use the
somewhat counter-intuitive OFW command

  reset-all

This will save the settings to non-volatile storage and then reset
the machine.

You may then proceed to upgrade to 5.0_RC2 by either building
from source or using binaries from ftp.netbsd.org.

One note, though: I had an LCD screen at 1600x1200 connected via DVI
to the Mac Mini, and once 5.0_RC2 was booted, the radeonfb0 driver
attached, but managed to make an almost-unreadable mess on the
screen with yellow and blue bleeding horizontally off the black
characters in text mode.  In my case I worked around that by
building my own kernel with

------------------------------
# 
# Mostly GENERIC
#       

include "arch/macppc/conf/GENERIC"

no radeonfb*
------------------------------

as the kernel configuration file, which allowed genfb0 to attach in
radeonfb0's place.  I don't know whether this would have made any
difference to the ability to run graphics on the display -- for me
that was unimportant as I run this particular Mac in a head- and
keyboardless configuration.

However, with the above setup, I

1) Managed to install on the G4 Mac Mini without resorting to
   any OS/X tools
2) Managed to get it into a state where "power it on, and it
   goes" mode

With the hope that this might help others,

- Håvard


Home | Main Index | Thread Index | Old Index