Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] PowerPC Mac G5: problem setting yaboot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
stamasd
n00b
n00b


Joined: 08 Apr 2003
Posts: 28

PostPosted: Thu Jan 28, 2016 2:44 pm    Post subject: [Solved] PowerPC Mac G5: problem setting yaboot Reply with quote

Let me start by saying that I am an experienced Funtoo user; but there is no PPC port of Funtoo, so I'm trying to install Gentoo on this Macintosh G5.

Everything went well until the last step, installing yaboot. This is my first time trying to use yaboot, and I've run into problems.

The hardware setup in this system is as follows: Gentoo and OSX 10.5 are installed on the second SATA drive, /dev/sdb.
The partitions are:
/dev/sdb3: OSX
/dev/sdb4: bootstrap (formatted HFS, and created with 'mkofboot -v')
/dev/sdb5: swap
/dev/sdb6: boot (ext2)
/dev/sdb7: root (ext4)

I tried at first with the kernel in /boot on the root partition (sdb7) then when I encountered problems I made a separate boot partition sdb6 formatted ext2 to eliminate the possibility that ext4 causes problems with yaboot (even though I have read that the current yaboot supports ext4 just fine). It still doesn't work.

Here is my fstab:
Code:

#/dev/sdb6   /boot              ext2      noauto,noatime   1 2
/dev/sdb7      /              ext4      noatime      0 1
/dev/sdb5      none              swap      sw              0 0
/dev/cdrom   /mnt/cdrom   auto      noauto,user   0 0
/dev/fd0      /mnt/floppy   auto      noauto      0 0



And here's yaboot.conf:

Code:

boot=/dev/sdb4
device=/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@1/disk@0:
partition=7
delay=10
timeout=40
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot

image=/boot/linux-4.1.12-gentoo
   label=Linux.4.1.12
   root=/dev/sdb7
   read-only

macosx=/dev/sdb3
defaultos=macosx


The files above are the latest versions, where I reverted to the kernel being on the root partition instead of the separate boot partition. But the same thing happens in both cases, so I don't think this is the issue.
I obtained the string in "device=" by running 'ofpath /dev/sdb' then copied and pasted it into yaboot.conf to avoid any typos.

Yaboot installed correctly, and at boot I get the boot menu. If I type 'x' or just let it timeout, it will boot OSX as it should.
However if I type 'l' to boot Gentoo, I get an OpenFirmware error:
Code:

Decrementer exception at %SRR0: 00000000.001109ec %SRR1: 10000000.00003030



Can anyone help please?

(edit)
I've added the following to yaboot.conf and updated with 'ybin -v':
Code:

ofboot=/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@1/disk@0:4
enablecdboot
enableofboot
fstype=hfs

just in case. I still can't boot Gentoo, but the error message has changed slightly:
Code:

Invalid memory access at at %SRR0: 00000000.001109ec %SRR1: 10000000.00003030


This, again, happens either if the kernel is on sdb6 (ext2) mounted at /boot, or with the kernel on sdb7 (ext4) in the /boot directory.
_________________
I/O, I/O, it's off to disk I go, with a bit and a byte and a read and a write, I/O, I/O...


Last edited by stamasd on Thu Feb 04, 2016 12:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
DBoyCache
n00b
n00b


Joined: 03 Dec 2015
Posts: 5

PostPosted: Thu Jan 28, 2016 3:12 pm    Post subject: Reply with quote

Hmm, I've installed Gentoo on a lot of G3/G4/G5 and never seen that come up.

For one thing you didn't mention what the problems were when you tried to boot with the kernel in your root partition (that's what I do), and it's not clear whether you've just made the bootstrap partition or set it up with the bootloader.
Back to top
View user's profile Send private message
stamasd
n00b
n00b


Joined: 08 Apr 2003
Posts: 28

PostPosted: Thu Jan 28, 2016 3:45 pm    Post subject: Reply with quote

Thanks for the reply.

Same error message occurs whether the kernel is on a separate boot partition, or on the root partition.
I made the bootstrap partition using mac-fdisk together with the other partitions, then installed yaboot on it with "mkofboot -v" which formatted it HFS and installed yaboot. Each time I change yaboot.conf I update it with "ybin -v"
I think yaboot is installed correctly on it, as the boot menu comes up and I can use it to boot OSX fine. I only get this error when I try to boot linux.

What I'm trying now is to compile a new kernel, this time 32-bit only (my original one is ppc64). I don't think that's what the problem is because the kernel "G5" on the minimal boot CD is 64-bit and it boots fine.
_________________
I/O, I/O, it's off to disk I go, with a bit and a byte and a read and a write, I/O, I/O...
Back to top
View user's profile Send private message
stamasd
n00b
n00b


Joined: 08 Apr 2003
Posts: 28

PostPosted: Thu Jan 28, 2016 5:20 pm    Post subject: Reply with quote

The 32-bit kernel gives me the same error.

Just to add a bit of information, after I press 'l' at the "stage 1 boot" prompt, I see a message "stage 2 boot" flashing briefly on the screen before the openfirmware error occurs.
_________________
I/O, I/O, it's off to disk I go, with a bit and a byte and a read and a write, I/O, I/O...
Back to top
View user's profile Send private message
stamasd
n00b
n00b


Joined: 08 Apr 2003
Posts: 28

PostPosted: Fri Jan 29, 2016 5:58 pm    Post subject: Reply with quote

FWIW, I removed the first hard disk /dev/sda, moved sdb in its place so it's now sda (there is now no other disk in the system), wiped it completely and restarted installing from scratch - this time Gentoo only, no OSX.

I end up with the exact same error after installing yaboot.

I'm completely out of ideas.
_________________
I/O, I/O, it's off to disk I go, with a bit and a byte and a read and a write, I/O, I/O...
Back to top
View user's profile Send private message
DBoyCache
n00b
n00b


Joined: 03 Dec 2015
Posts: 5

PostPosted: Fri Jan 29, 2016 6:14 pm    Post subject: Reply with quote

Yeah, the other drive wouldn't have been the issue. Can you run Apple Hardware Test on this machine? The error you're getting seems like a hardware one but regardless try using the open firmware path to the kernel.

Would be something like...
boot: hd:3,/vmlinux root=/dev/sda1 ro

obviously have the hd:# and sda1 to your needs.
Back to top
View user's profile Send private message
HystericalLich
n00b
n00b


Joined: 05 Oct 2015
Posts: 12
Location: United States

PostPosted: Fri Jan 29, 2016 9:12 pm    Post subject: Grub? Reply with quote

I have had a lot of issues with yaboot, on a G4 mac mini, and eventually, I figured out you can install grub in ppc gentoo.
So if you use OSX it probably won't work, however, if you boot only linux, I feel grub is way more powerful than yaboot, and far less prone towards breaking during world updates. (It may seem a bit scary as it has you use the "**" accept keyword.)

https://www.senmut.net/~thomas/Wiki/index.php?n=Thomas.Gentoo#toc6

Things to note about this guide:
1) The grub version to install is not 9999
2) It does all of this stuff to work around only having an 800kb boot partition, but with hfsutils and manual partitioning, I was able to just create a bootstrap partition large enough. Though it has been a while as I gave my mac mini away, so I couldn't give a specific process.


Overall, the process isn't the most user friendly, but it works very well, and I really don't think ease of use is Gentoo's main design goal.
Back to top
View user's profile Send private message
stamasd
n00b
n00b


Joined: 08 Apr 2003
Posts: 28

PostPosted: Fri Jan 29, 2016 9:40 pm    Post subject: Reply with quote

Thanks for the suggestions. I will try the hardware test, and also will try the openfirmware way - as soon as I get around reinstalling Gentoo. I have nuked the partition again in the meantime. :(

I have seen grub mentioned in ppc discussions before, however... my experience with grub (especially grub2) is less than favorable, and I would like the machine to eventually dual-boot with OSX...

Ease of use is not my goal either. Otherwise I'd have stuck with OSX. Or Ubuntu. :) But having built and used Slackware machines since about 1997 gives me a bit of an upper hand here.

No, my goal is to use this G5 to teach my 9-year-old to use and administer a Linux box - and have a bit of OSX on the side...
_________________
I/O, I/O, it's off to disk I go, with a bit and a byte and a read and a write, I/O, I/O...
Back to top
View user's profile Send private message
stamasd
n00b
n00b


Joined: 08 Apr 2003
Posts: 28

PostPosted: Sat Jan 30, 2016 1:52 am    Post subject: Reply with quote

The G5 passed the Apple hardware test, including the extended one (which took over 3h to run, because of the 6GB of memory).
The hardware is good.
That doesn't explain why I'm getting the same openfirmware error when I try to boot Linux.
_________________
I/O, I/O, it's off to disk I go, with a bit and a byte and a read and a write, I/O, I/O...
Back to top
View user's profile Send private message
stamasd
n00b
n00b


Joined: 08 Apr 2003
Posts: 28

PostPosted: Sat Jan 30, 2016 7:32 pm    Post subject: Reply with quote

As a test, I tried other versions of Linux/PPC on this machine. None installed correctly.

Lubuntu 14.04 and 14.04.3: the CD boots, the installer starts then the whole machine freezes. Needs hard reboot. Happens every time, with several versions of the install CD.
Ubuntu 14.04 server PPC: CD boots but keyboard doesn't work at all after boot. No way to fix without a working input method.
Debian 8.3.0 PPC: installs but yaboot is broken; the version it installs can't boot either Linux nor OSX, even after manually fixing yaboot.conf. Also, the openfirmware paths that it sees the devices at are strange and completely different from Gentoo.
_________________
I/O, I/O, it's off to disk I go, with a bit and a byte and a read and a write, I/O, I/O...
Back to top
View user's profile Send private message
stamasd
n00b
n00b


Joined: 08 Apr 2003
Posts: 28

PostPosted: Sun Jan 31, 2016 12:06 am    Post subject: Reply with quote

Aaand another update on my failures.

I managed to get around and get Gentoo installed again (I think it;s the 4th time in 3 days). Yaboot of course does the same decrementer error as before.

I tried booting the kernel from openfirmware. Since my root partition is /dev/sda4, and the kernel on that partition is /boot/vmlinux, I used at the OF prompt:
Code:
boot: hd:4,/boot/vmlinux root=/dev/sda4 ro


All that this does is clear the screen and drop me back to the OF prompt. And if entered again, again clears screen and back to OF prompt.

What is going on?
_________________
I/O, I/O, it's off to disk I go, with a bit and a byte and a read and a write, I/O, I/O...
Back to top
View user's profile Send private message
stamasd
n00b
n00b


Joined: 08 Apr 2003
Posts: 28

PostPosted: Sun Jan 31, 2016 7:26 pm    Post subject: Reply with quote

Still no progress.

I noticed that the version of yaboot from the CD is 1.3.13 (and it boots fine) whereas the one installed by the stage3 is 1.3.17 (and it doesn't boot).

So I tried downgrading yaboot to an earlier version. I have found posts on this forum (from many years ago) where people had success with booting with older versions, such as 1.3.10.

However, the only versions available in portage right now are 1.3.17-r2, 1.3.16 and 1.3.14-r2.

I tried downgrading to 1.3.14-r2 and to 1.3.16, but they don't compile. So I'm stuck with 1.3.17 unless I do something radical and get+install an older yaboot out of sync with portage.

I'm getting pretty fed-up with this.
_________________
I/O, I/O, it's off to disk I go, with a bit and a byte and a read and a write, I/O, I/O...
Back to top
View user's profile Send private message
radio head
n00b
n00b


Joined: 01 Feb 2016
Posts: 2

PostPosted: Mon Feb 01, 2016 11:45 pm    Post subject: Reply with quote

i've been having this same issue on my G4 MDD and it was driving me nuts, especially since i've had linux on this system in the past.

the solution I came up with isn't exactly scientific, but it works. I downloaded a yaboot binary from http://yaboot.ozlabs.org/releases/archived/, extracted usr/local/lib/yaboot from it and simply copied it to my apple_bootstrap partition manually. rebooted and it worked right away.

I knew the issue had to the yaboot executable since I could boot the livecd without issue and could even boot my system using the livecd boot: prompt.
Back to top
View user's profile Send private message
stamasd
n00b
n00b


Joined: 08 Apr 2003
Posts: 28

PostPosted: Wed Feb 03, 2016 1:34 am    Post subject: Reply with quote

Thanks for the reply. Sounds sensible to me, will try that when I have time to tinker again (probably not until next week, I've entered crunch time at work and barely make it home anymore). It's along the lines of what I was going to try next anyway.

That site doesn't have the version of yaboot I was looking for (1.3.13) but I can extract that from the minimal boot CD if it comes to that. I will try first 1.3.10 as I've seen it reported to work in similar circumstances by a G4 owner. Or I may try to compile my own, assuming software from 2004 still compiles correctly with a recent gcc.

I assume the apple_bootstrap partition is just a regular, mountable HFS volume that can be treated like any other partition, correct (within the limits of its size, of course)?

(edit) Hmm, a yaboot that old may not know what to do with an ext4 partition, I may have to move the kernel to an ext2 /boot
_________________
I/O, I/O, it's off to disk I go, with a bit and a byte and a read and a write, I/O, I/O...
Back to top
View user's profile Send private message
radio head
n00b
n00b


Joined: 01 Feb 2016
Posts: 2

PostPosted: Wed Feb 03, 2016 4:12 pm    Post subject: Reply with quote

yes, you can mount the apple_bootstrap partition as you would any other.

for the record, i'm using a separate ext2 /boot partition with an ext4 /.
Back to top
View user's profile Send private message
stamasd
n00b
n00b


Joined: 08 Apr 2003
Posts: 28

PostPosted: Thu Feb 04, 2016 1:38 am    Post subject: Reply with quote

So here's the final word on this saga.

I extracted the yaboot binary (version 1.3.13) from the minimal boot CD for PPC from /boot/yaboot; since the boot CD doesn't have the ability to mount HFS partitions (I guess the kernel is built without HFS support) I then had to do the following:

renamed the yaboot installed on the target partition at /usr/lib/yaboot/yaboot to yaboot-1.3.17 just in case I will ever need it;

copied the older yaboot binary at /usr/lib/yaboot/yaboot, and also made a copy as /usr/lib/yaboot/yaboot-1.3.13 just in case it ever gets overwritten during an update (unlikely since yaboot seems not have been developed further since about 2011, but you never know)

made again a /boot partition formatted ext2, copied my kernel there and updated fstab and yaboot.conf accordingly (I had to split a chunk of my swap partition, and this changed the names of all the subsequent partitions)

overcame the absence of HFS support in the CD kernel by using (while chrooted of course) 'mkofboot -v' again to recreate from scratch the bootstrap partition and copy the older yaboot binary there

Result: the system now boots both Gentoo and OSX without any trouble.

So the take home lesson is: if you have difficulty booting a G5 Mac with Linux, downgrade your yaboot binary to 1.3.13. Other versions may work, but I haven't tested them. Definitely version 1.3.17 doesn't work in my experience, and unfortunately that's the current one in portage.

Thank you to all who helped.

Please mark this one as 'solved'
_________________
I/O, I/O, it's off to disk I go, with a bit and a byte and a read and a write, I/O, I/O...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum