Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Power Mac G5 - unable to boot into completed installl
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
lukezenoob
n00b
n00b


Joined: 29 Jun 2022
Posts: 4
Location: Ontario, Canada

PostPosted: Sat Sep 03, 2022 7:58 am    Post subject: Power Mac G5 - unable to boot into completed installl Reply with quote

It has come to my attention that this G5 will not boot from external devices, so i sacrificed the 2nd hard drive on this as the root filesystem, sure, no problem, spend another 9 hours compiling kernel, this is expected.

The best thing is that Yaboot shows up in the boot menu when holding down ALT, so we're getting somewhere, only issue is that when i do select that second hard drive, the graphics gets weird and then kicks me back into the boot menu.

Here is my current yaboot.conf. fstab doesn't include a boot partition.

Code:
boot=/dev/sdb2
device=/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@2/disk@0:
partition=4
root=/dev/sdb4
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot

image=/boot/vmlinux-5.15.59-gentoo-ppc64be
        label=Linux
        initrd=/boot/initramfs-5.15.59-gentoo-ppc64be.img
        initrd-size=8192

_________________
Humans were made to sit on the desk and sync portage, then stare at compiler output.
Back to top
View user's profile Send private message
exuberantmonkey
n00b
n00b


Joined: 09 Apr 2023
Posts: 19

PostPosted: Thu May 18, 2023 10:40 pm    Post subject: Reply with quote

You probably either gave up or have it working by now, but just in case - I ran into the same problems using the PPC64 handbook instructions which appear to be out of date.

Firstly, I could not get yaboot to work, even after reformatting my root partition as ext3 (I read something about yaboot not supporting on ext4). I tried all sorts of things. For one configuration I got as far as a black screen with messages from yaboot, but then it could not find my root partion, no matter what.

Then I found this link via the forums:
[url]https://wiki.gentoo.org/wiki/GRUB_on_Open_Firmware_(PowerPC)[/url]

Grub was able to find my boot partition with the kernel, once I used "boot hd:3,\grub\grub.img" instead of "boot &device;,\grub\grub.img" in the CHRP script (the latter did not work for me). I should probably update "hd:3" to the full open firmware path at some point (i.e., path reported by "ofpath /dev/sda3").

To use grub with PPC64 you need an ext2 boot partition, and of course the handbook tells you not to create one (since it is written to use yaboot). Rather than start from scratch I deleted my swap partition, created a 500 Mb boot partition and then a new smaller swap partition (root now being sda5, so update fstab accordingly).

The next problem is the kernel generated by genkernel on PPC64. Grub finds it but then boot fails with something like "cannot boot a kdump kernel from of" and a memory access violation. Forums to the rescue again -- build the kernel manually, first using "make g5_defconfig" and then the manual kernel build instructions and initramfs etc. Re-run grub-mkconfig and set boot device with nvram tool and voila. She finally boots!

Now if only those fans would stop blowing full on ...
Back to top
View user's profile Send private message
Atha
Apprentice
Apprentice


Joined: 22 Sep 2004
Posts: 240

PostPosted: Sat Jul 08, 2023 10:10 am    Post subject: Reply with quote

exuberantmonkey wrote:
Grub was able to find my boot partition with the kernel, once I used "boot hd:3,\grub\grub.img" instead of "boot &device;,\grub\grub.img" in the CHRP script (the latter did not work for me). I should probably update "hd:3" to the full open firmware path at some point (i.e., path reported by "ofpath /dev/sda3").


You may want to give "&device;:&partition;" a try, i.e. "boot &device;:&partition;,\grub\grub.img"... The GRUB on Open Firmware (PowerPC) Gentoo Wiki page might be wrong there...

exuberantmonkey wrote:
The next problem is the kernel generated by genkernel on PPC64. Grub finds it but then boot fails with something like "cannot boot a kdump kernel from of" and a memory access violation. Forums to the rescue again -- build the kernel manually, first using "make g5_defconfig" and then the manual kernel build instructions and initramfs etc. Re-run grub-mkconfig and set boot device with nvram tool and voila. She finally boots!

Now if only those fans would stop blowing full on ...


IMHO g5_defconfig isn't really maintained well. My suggestion is to use an optimized .config as a starting point, e.g. this one: Working 5.15.x kernel-config for PowerMac G5 AGP/PCIe

With genkernel, I then default to using an existing .config from the sources directory directly, which natually I have to put there before running genkernel: (/etc/genkernel.conf)
Code:
INSTALL="yes"
OLDCONFIG="yes"
MENUCONFIG="no"
GCONFIG="no"
NCONFIG="no"
XCONFIG="no"
MRPROPER="no"
CLEAN="no"
MOUNTBOOT="yes"
SYMLINK="yes"
SAVE_CONFIG="no"
NOCOLOR="false"
MAKEOPTS="-j4"
NICE=10
...
BOOTLOADER="grub2"
...


Since I keep my own .config around (I copy successful ones to /usr/src/kernel_config, just in case I delete my .config by running "make mrproper" or unmerging a kernel), I use SAVE_CONFIG=no. I don't know what SAVECONFIG=yes in conjunction with OLDCONFIG=yes does with new kernel config options, so I always run "make oldconfig" by myself on a new kernel and select which new options I want and don't want. "make listnewconfig" is always a good idea as well...

As for the roaring fans: according to G5 Fans blow like crazy (but not with live CD) - solved "make g5_defconfig" doesn't include any CONFIG_WINDFARM_* options, so that might be the reason...
_________________
Think for yourself and let others enjoy the privilege of doing so too. Voltaire
Back to top
View user's profile Send private message
Atha
Apprentice
Apprentice


Joined: 22 Sep 2004
Posts: 240

PostPosted: Sat Jul 08, 2023 10:16 am    Post subject: Re: Power Mac G5 - unable to boot into completed installl Reply with quote

lukezenoob wrote:
Here is my current yaboot.conf. fstab doesn't include a boot partition.

Code:
boot=/dev/sdb2
device=/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@2/disk@0:
partition=4
root=/dev/sdb4


The device seems wrong: /ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@2/disk@0 looks like it's "/dev/sda" i.e. disk@0. If the disk is on the same SATA controller, it probably should be disk@1...

My guess is (though I could be wrong as well):
/dev/sda --> k2-sata@2/disk@0
/dev/sdb --> k2-sata@2/disk@1

It never hurts to give it a try though... If you're still at it: Good luck!

Edit:

It should always work to use the default aliases already provided by Open Firmware. These aliases are even present after the NVRAM (and Parameter RAM) is zapped, so they are perfectly safe to use. Sadly, aliases for the generic "hd" are limited to the first hard disk. Only on G4 Power Macs with the UltraATA "IDE" bus (not SATA), there were aliases for the first and second HDD:

/dev/sda --> ultra0:
/dev/sdb --> ultra1:

On a Power Mac G5 "ultra0:" and "ultra1:" would, if even still present, refer to the IDE bus, where the optical drive is connected. But the hard disks are on the G5's SATA bus, and the only alias available here is "hd:" for the first HDD (/dev/sda)...

Some links to get to know the possibilities of Open Firmware:

_________________
Think for yourself and let others enjoy the privilege of doing so too. Voltaire
Back to top
View user's profile Send private message
exuberantmonkey
n00b
n00b


Joined: 09 Apr 2023
Posts: 19

PostPosted: Thu Jul 20, 2023 7:17 pm    Post subject: Reply with quote

Thanks for the tips. My two G5s are actually both power macs.

I gave up on yaboot and got boot working with grub, though I did snag the penguin icon for the ofboot.b CHRP script from yaboot -- looks better and further reduces file size on a rather tiny NWBB partition.

As for the fans - yes, I just had to enable all the windfarm options and it worked.

One other thing I noticed was a difference in the path reported by yaboot's ofpath tool vs. what is listed by "devalias" when booting the G5 into open firmware with command-option-O-F. The path reported by ofpath includes additional details, like the "@0,f2000000" after "/ht", and "@c" after "k2-sata-root".

I have two G5s, different models. On one, using the path from the ofpath tool works in the CHRP script. However, for my second G5, that path doesn't work. Then I noticed the discrepancy in the paths reported by ofpath vs. devalias, and for one last attempt I tried the less decorated path, as reported by open firmware's devalias, in the CHRP script. Then she booted.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC 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