Port-macppc archive

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

Successful story Mac Mini PPC G4 with NetBSD-6.1.1 (repeated)



Hello,

I'm reposting my mail from 2013-08-24, the original message was rejected
by the mail-list server, and so hidden under the sands of time.

Out of the original questions, the pdisk one is solved - it's already ported
against 64-bit systems and made Machine Independent. However, the wiki is
misguiding with an old unportable version. I haven't been touching the
bisect task so far, before getting some support from you - I was
developing my knowledge of the system with the amd64 and i386 port in
the meantime.

Also, I'm a happy owner of an old Macintosh body of PowerPC 6100 (it
doesn't look to be cannibalized at all), I miss all the peripherals:
cables and external components (keyboard, mouse, monitor). I know this
is Nubus and it's unsupported with NetBSD, however I would like to give
it a try and try to run MKLinux, to verify the hardware is still working.
The *bay prices are unfortunately doubled or tripled for me, because the
shipping to Poland costs - and so, the collection may take a few months.
Another question: can I use standard-PC  power-supply-cable with
the PPC/Nubus Macintosh?

...

Here is the original posting:

I've just installed NetBSD on the macppc port. This was my first PowerPC
and Mac hardware ever and the first installation of any system onto it.

The ultimate steps were presented on the blog by Julio Merino (jmmv) -
http://julipedia.meroh.net/2010/01/installing-netbsdmacppc-on-mac-mini-g4.html

I'm copying the verbatim copy of the original post at the bottom [1], in
case of future unknown events and lost the guide for others. And to have
the all resources in the same place.

I'm writing here my steps (it took me two days!) for myself and others,
who will search the web for help. I'm writing everything from my memory
(so be prepared to see possible mistakes of the commands, however you will
get the big picture):
(1) I wasn't able to boot from CD (trying cd, dvd, different vendors).
At that time I hadn't succeeded in either booting from USB or CDROM drive
over USB. I wasn't trying out with PXE. The solution for me was to copy
ofwboot.xcf and the netbsd kernel onto the first partition from a
preinstalled MacOSX. There is a need to restart the computer and
immediately push 4 keys COMMAND (apple/swedish) + ALT (OPTION?) + O +
F, until the load into OpenFirmware. Then to boot into NetBSD type (IIRC
it was the _MD kernel):
> boot hd:0,\ofwboot.xcf hd:0,\netbsd-GENERIC_MD.gz
(2) Then OF will boot into NetBSD. Jump to shell.
(3) Use pdisk to format your hard-drive. There is a need to read dmesg
(there is `more' to help to follow it). In my case my hard-disk was
under /dev/wd0c
# pdisk /dev/rwd0c
Remember to use the disk in the raw mode, not the block one!
Inside it, I had to recreate the partition-table (i) and delete all the
partitions that were present (d).
Add new partitions (C). The first one Apple_HFS for the netbsd
bootloader, for start point of the slice use magic '2p' (and later 3p,
4p) -- this will start from the empty space at partitions 2, 3, 4.
My size of the boot partition is '25m', and the partition type is
'Apple_HFS'.
Add swap and use partition type 'Apple_UNIX_SVR2' and choose 'swap'. The
same for the root partition, choose 'Apple_UNIX_SVR2'.
(4) Now there is the tricky problem: mounting USB disks, network and internal
CD device are broken! I've found another (bez "one") solution to transfer
datasets with the distribution... through external CD - and it worked
(unfortunately, I had to use a few disks, one of them was eaten by the
internal device -- and eject wasn't accessible)!
(5) Run installation
# sysinst
Use existing partitioning schema, install sets.
(6) BEFORE reboot go back to the shell
Mount the installed system and chroot. Fortunately, dhcpclient from
inside the chroot worked (before figuring out I used another one CD for
this task). Fetch pkgsrc and install sysutils/hfsutils. With disklabel
keep track where your HFS partition is:
# disklabel /dev/wd0
and hformat it (IIRC for me it was wd0d):
# hformat /dev/rwd0d
Mount (I don't remember if we need the raw mode here):
# hmount /dev/rwd0d
Copy ofwboot.xcf onto HFS partition. ATTENTION OFWBOOT.XCF from NETBSD-6
IS BROKEN, USE 5.1 AS REPORTED ON THE PR DATABASE [2].
# hcopy ./ofwboot.xcf :
Make sure it's there (other useful commands: hdel, hvol)
# hls
And umount it
# humount
(7) Reboot into Open Firmware (COMMAND + ALT + O + F)
Here, I made a mistake and I have got broken ./ofwboot.xcf on the first
partition (the NetBSD-6+ issue is still valid in 6.1.1). I succeeded in
formatting (pdisk and hfsutils) a USB pendrive from another machine. Copy
there ofwboot.xcf and boot from OF.
I succeeded in booting from the USB bootloader of NetBSD-5.1 and the
installed system with the following command:
> boot usb1/disk2:2,\ofwboot.xcf hd:4,/netbsd

Use 'dev / ls' and 'devalias' commands to help figure out the devices.
(8) Boot into NetBSD and have fun :-)

Other problems that I have seen so far:
A. pdisk as noted on the NetBSD site is accessible from here
^/pub/NetBSD/arch/macppc/netbsd-pdisk/ It's not buildable anymore (the
build problem is easily solvable - remove a redundant, clashing with
system libraries function definition from the sources) and it's broken
on 64-bit architecture (tested with the current Mageia Cauldron x86_64
and NetBSD/amd64 -- it worked with NetBSD/i386).
B. pdisk isn't in ports or in the default installation (!) WHY ?
C. sysinst can't partition disk against Apple_HFS. Neither GPT
(different story, different architecture!)
D. hfsutils *must* be available in the installer (or reimplemented.
integrated into disklabel, fdisk, kernel) - am I missing something?

There are still things to figure out:
I. auto-boot, I need to put current ofwboot.xcf onto the first partition
and research this 'hello screen'
II. After booting I can't switch TTY?

I haven't tested X Window so far (I'm not sure I want to do it :-), as
it's not that well supported on other ports as well).

Next time I would partition my pendrive, put there ofwboot.xcf, kernel,
pkgsrc.tar.xz, subset of distuitils (dependencies of hfsutils).. and
maybe dhcpcd just to try-fail.

An open question: is mini-mac-ppc G4 a good solution as a home-server
(serving shell) and simple content through nginx? I'm focused mainly on
this if it doesn't die against long idle uptime. The current consumption
is acceptable.

I'm open to suggestions (I know this is accessible on-line, but to help
me figure out quicker and the right way the things - now I need to rest and
to celebrate the success :) ):
a. How to research the ofwboot.xcf? I want to Take NetBSD-5.1 and
NetBSD-6.0 versions of ofwboot.xcf, and bisect the problem (before
squashing it out).
b. pdisk - where is it developed? I want to contribute fixes against
64-arch. Are we upstream of it?

Regards,
Kamil Rytarowski


[1] Julio Merino (jmmv) -
http://julipedia.meroh.net/2010/01/installing-netbsdmacppc-on-mac-mini-g4.html
Monday, January 11, 2010
Installing NetBSD/macppc on a Mac Mini G4
Yesterday, I spent a while installing NetBSD/macppc 5.0.1 on a Mac Mini
G4. The process wasn't easy, as it involved the following steps. I'm
omitting many details, as they are "common knowledge" to Mac users (or
otherwise can be easily found on the net):

After booting the installer from the CD image, drop into the shell.
Use pdisk to create an Apple_HFS partition for the boot loader and
two Apple_UNIX_SVR2 partitions, one for the root file system and another
for swap.
Run sysinst and install the system. When asked to repartition the
disk, just say Use existing partition sizes.
Once the system is installed, drop again into the shell before
rebooting.
Mount your hard disk into /mnt and chroot into it.
Fetch a copy of pkgsrc.
Install the sysutils/hfsutils package.
Use hformat to create a new HFS file system in the Apple_HFS
partition we created.
Mount the installation CD.
Copy, using hcopy, the ofwboot.xcf file from the CD to the boot
partition.
Reboot.
Drop into the OpenFirmware setup (Command+Option+P+R).
Set boot-device to hd:,\ofwboot.xcf.
Set boot-file to netbsd.
And here is the tricky thing to get the machine to auto-boot: Set
boot-command to ." hello" cr " screen" output boot, not mac-boot.

I found the last command somewhere on the Internet (dunno where now),
but, supposedly, a regular mac-boot should have worked. In fact, it
works if you call this command from the prompt, but not during automatic
boot. (It turns out to be a problem with the version of OpenFirmware I
have.)

Just writing down the steps in case I need them later on. Installing
Debian stable was much, much easier, but the installer for testing
crashes every day with a different error, so I gave up.

(Oh, by the way, I did the same installation into an old PowerMac G3 and
that was really painful. The machine refused to boot from any of the CDs
I tried and the prebuilt kernels hang during initialization due to a
bogus driver. In the end: netbooting and using custom kernels.)

[2] http://gnats.netbsd.org/44895



Home | Main Index | Thread Index | Old Index