Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GRUB on PPC, anyone?
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
Atha
Apprentice
Apprentice


Joined: 22 Sep 2004
Posts: 229

PostPosted: Sun Feb 28, 2016 9:10 am    Post subject: GRUB on PPC, anyone? Reply with quote

I have to appologize. I really am the Gentoo guy, at least always have been.
Recently, over the last two years, I silently and out of convenience transitioned—kind'o—to Debian GNU/Linux…

Yeah, I feel ashamed…

Anyhow, I do use Debians GRUB on PPC and on PPC64 and I realy realy like it a lot. The installation is still very manual; I wouldn't know how to automatically-with-voodoo-magic install GRUB such that it would work out-of-the-box, but once installed, all you have to do is modify the grub.cfg and you're all set.

The BIG advantage of GRUB (version 2) over yaboot is the ability to 1) modify the kernel command line during the selection of a kernel, 2) the ability to present more then one kernels at easy, with different configurations (command lines) and easily changable and 3) its way of presentation (menu like, using arrow keys, instead of input command like, which is I believe called a prompt…).

I was really planning on getting Gentoo to run on my (newer) Power Mac G5 also, which is a PowerMac11,2 ("Late 2005" Dual-Core PowerPC 970MP). It's not a Quad, it's the low-end 2.0 GHz Dual-Core with the problematic Nvidia GeForce 6600LE PCIe graphics card. After the trouble under Debian I didn't bother installing Gentoo yet, except for a Gentoo kernel, which didn't fix things. (Yeah – you can use a Gentoo custom kernel to boot a Debian installation! The Gentoo installation doesn't work as well… shitty nouveau!)

If I had the time…
My Macs are:
  • Power Mac G4 "Quicksilver" (PowerMac3,5) Dual-800 MHz
  • Power Mac G4 "Cube" (PowerMac5,1) 500 MHz – currently a bit broken: Mac OS X boots only in safe mode, but I don't know why
  • Power Mac G5 (PowerMac7,2) Dual-2.0 GHz – (original 2003 model) with a Radeon 9600 Pro AGP graphics card
  • Power Mac G5 "Late 2005" (PowerMac11,2) Dual-Core 2.0 GHz – trouble with nouveau
  • Mac mini G4 "Late 2005" (PowerMac10,2) – not tested under Linux yet


Before that I had a MDD running Gentoo for at least two years:
  • Power Mac G4 "Mirrored Drive Doors" (PowerMac3,6) Dual-1.42 GHz – was working back in 2007, Radeon 9000 APG graphics card


Anyway, on the Quicksilver I had set up a Mac OS X/Debian/Gentoo installation with Debian providing GRUB 2. Gentoo worked well on that box, as did Debian.

On the G5 "Late 2005" I was going to set up a Mac OS X/Debian/Gentoo installation as well, and I also used GRUB 2 providid by Debian. GRUB works very well. I only had to disable the background graphics image, because then screen updates get really slow, especially when on higher resolutions (Mac OS X sets the resolution in Open Firmware, and GRUB uses this resolution). After disabling the background image one gets a normal text-mode-like grub selection screen which works reasonaly fast.

Long story short: does anyone actually use GRUB 2 on Open Firmware (ieee-1275) on a Power Mac?
Yes? How did you set it up? What is your experience with it? What are your observations? Are there problems you ran into – and work-arounds?

Cheers, Atha
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Sun Feb 28, 2016 9:30 am    Post subject: Reply with quote

So... You say your grub works, then it doesn't work, then it works, then... what's the problem actually?
What does the long list of your macs have to do with it? Should we clap our hands?
Finally.... aren't macs EFI-only now?
Back to top
View user's profile Send private message
Atha
Apprentice
Apprentice


Joined: 22 Sep 2004
Posts: 229

PostPosted: Sun Feb 28, 2016 9:50 am    Post subject: Reply with quote

Sorry if that was the impression.
I was purely wondering if anyone on PPC is using GRUB instead of yaboot. And should you wonder what Macs I am using, I included the list and a history.

I had used Gentoo back in 2007 on a Power Mac G4 with yaboot. Now I use Debian and Gentoo on a Power Mac G4 and I use GRUB 2 instead of yaboot. The installation was not automatic, but with some manual copying and configuring it works on PowerMacs. GRUB is in many ways more convenient than yaboot as it allows to modify a kernel command line and boot that modified version, so you can try out differents settings very easily.

I needed this a lot while trying to get Linux running on a Power Mac G5 with a Nvidia GeForce 6600, which prooved very hard to do, and I haven't succeeded yet.

I was wondering if Gentoo users on PPC use yaboot or GRUB. And if they use GRUB, how did they set it up on pure Gentoo, because like I said I use a Debian version of GRUB (also with Gentoo).
Back to top
View user's profile Send private message
Atha
Apprentice
Apprentice


Joined: 22 Sep 2004
Posts: 229

PostPosted: Sun Feb 28, 2016 11:02 am    Post subject: Reply with quote

Okay, here is what I did on Debian. I installed GRUB using apt (aptitude, apt-get). I assume on Gentoo you'd get a similar installation after emerging grub.

Since I use a dual boot installation with Mac OS X, I have a bootstrap partition (NewWorld bootblock). So, yaboot is already installed (Debian defaults to yaboot on PPC/PPC64). On Gentoo, you would also use yaboot to get an initial setup.

I then found what I wanted on the internet: Rogério Brito had experimented with GRUB before and found a very good solution to get GRUB started off from the HFS partition while enabling you to maintain your grub.cfg in the regular place /boot/grub. Running GRUB2 on PowerPC Macs, Rogério Brito's Blog

Actually, I did not reproduce his steps, but he made a very convenient initial grub.cfg that I placed on the HFS bootstrap partition:
Code:
search --no-floppy --fs-uuid --set=root 35d26869-f7c9-4852-a9b8-100314560c34
set prefix=($root)/boot/grub
configfile /boot/grub/grub.cfg

Naturally, you would replace the UUID with the one of your root partition (the one containing /boot, and /boot/grub/grub.cfg).

How to get GRUB over to the HFS partition and loaded is well described by the Ubuntu PowerPCFAQ:
Code:
sudo grub-install --no-nvram
sudo update-grub

sudo mount /dev/sda2 /mnt
sudo cp /boot/grub/core.elf /mnt/
sudo umount /mnt

sudo hmount /dev/sda2
sudo hattrib -c UNIX -t "????" :ofboot.b
sudo hattrib -c UNIX -t tbxi :core.elf
sudo humount


It may also be desirable to add a line in yaboot's CHRP script that loads GRUB, like it would load Mac OS, Mac OS X or Linux when prompted.

I completely replaced yaboot as I blessed GRUB (type tbxi on core.elf) which makes Open Firmware load grub right away. Before doing so, you should check if GRUB works as inteded by entering Open Firmware (Opt-Alt-O-F) and loading it with boot hd:2,core.elf. core.elf should include everything GRUB needs, it will load grub.cfg on the bootstrap HFS partition, which will then look for the /boot (or root, depending on your setup) partition (using the search UUID feature) and load grub.cfg from there.

If you create a CHRP script, it is possible to include a boot logo that will be displayed when holding down the option key after the chime. I think I also had this set up, but right now I don't remember if I simply modified the yaboot CHRP script or used a different one from the internet.

From this moment on, all you have to maintain is grub.cfg in /boot/grub.


My personal impression is, that after installing GRUB – after having it installed manually, which is complicated by itself – the maintenance of Linux, especially if you are trying different configurations, becomes a lot more convenient from GRUBs menu and using grub-update to update /boot/grub/grub.cfg.

I haven't tried GRUB from Gentoo yet, as I have only used Debians GRUB on 32-bit and 64-bit PowerMac so far.

UPDATE: I forgot to ask: is it with GRUB the same as with yaboot, that only a 32-bit version works even on a 64-bit system (64-bit userland)? I remember that was one of the things with Gentoo that one had to use a precompiled 32-bit yaboot binary on 64ul, or alternatively a 32-bit chroot to build yaboot as a 32-bit binary yourself. I was hoping that GRUB would also work as a 64-bit binary. (And I don't know how Debian, being all pre-compiled packages, is compiled.)
Back to top
View user's profile Send private message
gringo
Advocate
Advocate


Joined: 27 Apr 2003
Posts: 3793

PostPosted: Fri Mar 04, 2016 10:03 am    Post subject: Reply with quote

I tried once to get grub2 running on my powerbook years ago ... and failed misserably.
Yaboot has given me lots of problems last time i used this powerbook so im really looking forward to have grub2 running.
will try in 2 weekends once i have access again to this laptop, will update afterwards.

Thanks !
Back to top
View user's profile Send private message
cbefdf
n00b
n00b


Joined: 07 Aug 2016
Posts: 2

PostPosted: Mon Aug 08, 2016 10:13 am    Post subject: Reply with quote

Good info Atha. Works fine.
GRUB_PLATFORMS="ieee1275" emerge --ask sys-boot/grub
nano /etc/grub.d/40_custom #menuentry ......
grub2-mkconfig


Works better than yaboot as I found "ybin" to mess up Open Firmware somehow?
Setup is standard ext2 /boot and ext4 /

TODO : working macosx menuentry (chainloader? to yaboot?) Suggestions welcome

Booting Mac OS X partition works by OF prompt: > boot hd:4,\\:tbxi


I'll post the history which may help
# GRUB_PLATFORMS="ieee1275" emerge --ask sys-boot/grub # (9999-r1 2.02beta3)

78 grub2-mkconfig -o /tmp/grub.cfg
blkid >> blkid.txt # for UUIDs
86 cat blkid.txt >> grub.cfg
79 less /tmp/grub.cfg
80 cp /tmp/grub.cfg /root/grub2-mkconfig.00
87 nano grub.cfg

122 grub2-install -v --no-nvram

145 cat grub2-mkconfig.01 >> /etc/grub.d/40_custom
146 nano /etc/grub.d/40_custom
147 cat blkid.txt >> /etc/grub.d/40_custom
148 nano /etc/grub.d/40_custom

149 grub2-mkconfig -o grub2-mkconfig.02
150 less grub2-mkconfig.02
151 cp grub2-mkconfig.02 /boot/grub/grub.cfg

89 mkdir /mnt/bootstrap
92 mount -t hfs /dev/hda2 /mnt/bootstrap/
213 cp /boot/grub/powerpc-ieee1275/core.elf /mnt/bootstrap/
214 umount /mnt/bootstrap/
522 history | grep bootstrap >> hist.grub

216 hmount /dev/hda2
218 hattrib -c UNIX -t tbxi :core.elf
221 hattrib -c UNIX -t "????" :core.elf
258 hattrib -c UNIX -t tbxi :core.elf

hattrib -c UNIX -t "????" :ofboot.b

260 humount

525 history | grep core.elf >> hist.grub


233 nano /boot/grub/grub.cfg

247 grub2-mkconfig -o grub2-mkconfig.03
250 cp grub2-mkconfig.03 /boot/grub/grub.cfg
251 less /boot/grub/grub.cfg
252 nano /etc/grub.d/README

347 cp /root/grub2-mkconfig.04 /boot/grub/grub.cfg.new
348 cd /boot/grub/
349 mv grub.cfg grub.cf_g_o
350 mv grub.cfg.new grub.cfg
354 grub2-mkconfig -o /root/grub2-mkconfig.04
355 less /root/grub2-mkconfig.04
356 cp /root/grub2-mkconfig.04 /boot/grub/grub.cfg

506 nano /etc/default/grub

519 history | grep grub >> hist.grub


G4 ~ # mount -r -t hfs /dev/hda2 /mnt/bootstrap/
G4 ~ # ll /mnt/bootstrap/
total 310
-rw-r--r-- 1 root root 81436 Aug 7 21:46 core.elf
-rw-r--r-- 1 root root 128 Aug 7 20:26 grub.cfg
-rw-r--r-- 1 root root 3203 Aug 6 14:04 ofboot.b
-rw-r--r-- 1 root root 227188 Aug 6 14:04 yaboot
-rw-r--r-- 1 root root 3631 Aug 7 21:25 yaboot.conf
G4 ~ # cat /mnt/bootstrap/grub.cfg
search --no-floppy --fs-uuid --set=root UUID-of-hda6-here
set prefix=($root)/grub
configfile /grub/grub.cfg
_________________
box1: Power Mac G4 Quicksilver


Last edited by cbefdf on Thu Aug 11, 2016 7:10 am; edited 9 times in total
Back to top
View user's profile Send private message
Atha
Apprentice
Apprentice


Joined: 22 Sep 2004
Posts: 229

PostPosted: Mon Aug 08, 2016 2:47 pm    Post subject: Reply with quote

Hello cbefdf!

Is this all you did?
cbefdf wrote:
GRUB_PLATFORMS="ieee1275" emerge --ask sys-boot/grub
nano /etc/grub.d/40_custom #menuentry ......
grub2-mkconfig


So you're not using the yaboot NewWorld bootblock Apple_Bootstrap partition with HFS as the filesystem?

cbefdf wrote:
TODO : working macosx menuentry (chainloader?) Suggestions welcome

os-prober should take care of that – it should automatically find and configure Windows and Mac OS X. If I remember correctly it even configured an x86-only operating system (like Windows or Mac OS X/Intel) on my Power Mac…

EDIT: 2 typos fixed


Last edited by Atha on Thu Dec 22, 2016 7:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
toofied
n00b
n00b


Joined: 26 Oct 2016
Posts: 28

PostPosted: Wed Dec 21, 2016 4:18 pm    Post subject: os-proper? Reply with quote

Quote:

os-proper should take care of that – it should automatically find and configure Windows and Mac OS X. If I remember correctly it even configured an x86-only operating system (like Windows or Mac OS X/Intel) on my Power Mac…


Can someone provide more information on what os-proper is? I am very interested in seeing if it is possible to boot grub directly without yaboot.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Dec 21, 2016 4:45 pm    Post subject: Re: os-proper? Reply with quote

toofied wrote:
Quote:
os-proper should take care of that – it should automatically find and configure Windows and Mac OS X. If I remember correctly it even configured an x86-only operating system (like Windows or Mac OS X/Intel) on my Power Mac…

Can someone provide more information on what os-proper is? I am very interested in seeing if it is possible to boot grub directly without yaboot.

toofied ... that seems to be a typo, sys-boot/os-prober.

HTH & best ... khay
Back to top
View user's profile Send private message
Atha
Apprentice
Apprentice


Joined: 22 Sep 2004
Posts: 229

PostPosted: Thu Dec 22, 2016 7:45 pm    Post subject: Reply with quote

I have to apologize. Yes, this was a typo.

os-prober does the magic to find operating systems and configures them for grub.

Sorry for the confusion.
Back to top
View user's profile Send private message
toofied
n00b
n00b


Joined: 26 Oct 2016
Posts: 28

PostPosted: Sun Dec 25, 2016 12:36 am    Post subject: Reply with quote

Thanks for the clarification.

Also lacking from the instructions, the bootstrap partition has to be formatted as hfs! I was unable to find this in the handbook.

Quote:

hformat -f /dev/hda2 (make sure this is your boostrap partition from blkid)


Hopefully this helps someone.
Back to top
View user's profile Send private message
Atha
Apprentice
Apprentice


Joined: 22 Sep 2004
Posts: 229

PostPosted: Sun Dec 25, 2016 7:00 am    Post subject: Reply with quote

If you followed the handbook, you would use yaboot for creating an initial configuration, including formating the bootstrap partition.

I remember that I partitioned with mac-fdisk as described in Preparing the disks and installed yaboot as described in Configuring the bootloader.

As of now, the handbook as well as the PPC/FAQ do not contain instructions for installing GRUB yet. So, on an initial yaboot-less setup you would have to format it using hformat. @toofied: Thanks for sharing.
Back to top
View user's profile Send private message
schwarzygesetzlos
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 185
Location: Funeralopolis

PostPosted: Thu Dec 29, 2016 1:25 pm    Post subject: Reply with quote

Nice Read! Thanks Atha & toofied.

Will definately try this out the next few weeks. yaboot has annoying drawbacks...
_________________
Talos II. [Gentoo Linux] | PMac G5 11,2. PMac G4 3,6. PBook G4 5,8. [MorphOS 3.18 / Gentoo Linux] | Vampire V4 SA [ApolloOS / Amiga OS 3.2.2]
Back to top
View user's profile Send private message
blackjok3r
n00b
n00b


Joined: 13 Feb 2005
Posts: 16

PostPosted: Sun Jul 23, 2017 8:37 pm    Post subject: Reply with quote

Any updates on this?
Back to top
View user's profile Send private message
Atha
Apprentice
Apprentice


Joined: 22 Sep 2004
Posts: 229

PostPosted: Mon Jul 24, 2017 12:18 am    Post subject: Reply with quote

blackjok3r wrote:
Any updates on this?

Not from me. I still have my two G5s waiting to be used. I gave up last time after the trouble I had with the Nvidia 6600LE graphics card. I will have to start over once I find the time. Sadly, right now I have more important things in my life, so I doubt to find the time this or next year…

Judging from what I read on various forums and mailing lists, support in general for PPC and PPC64 is not getting better. I suspect that issues will get worse over time, since most developers have already moved on.

Have you tried the manual installation method for GRUB2?
For those using a 64-Bit userland on a G5 Mac: does a 64-Bit version of core.elf run on PPC64 or do you have to cross-compile a 32-Bit version? Background: yaboot is said to only work as 32-Bit version, even on a 64-Bit Power Mac. Seems to be dependant on the Open Firmware, and just maybe OF is only 32-Bit, even on PPC64.
Back to top
View user's profile Send private message
blackjok3r
n00b
n00b


Joined: 13 Feb 2005
Posts: 16

PostPosted: Mon Jul 24, 2017 3:31 am    Post subject: Reply with quote

I have a g3 ibook 600mhz. I'm having really big trouble with both yaboot and grub2. Yaboot installs as the yaboot-static version but I cannot boot any file systems due tot he 'file system corruption error'. There is a comment on another thread that says "I used xfs as boot partition and it works ok. So I am going to try and recompile my kernel with xfs enabled and try making the boot partition XFS. I tried to do that already but I made my kernel very minimal and didnt include anything other than vfat and etx3/4 and the error remained.

For grub2, when I try and install the grub2 emerge, I get a whole list of dependency errors and it fails. Stayed up until 430am lasy night trying to install grub2 in CHROOT and gave up.
Back to top
View user's profile Send private message
Atha
Apprentice
Apprentice


Joined: 22 Sep 2004
Posts: 229

PostPosted: Mon Jul 24, 2017 8:12 am    Post subject: Reply with quote

blackjok3r wrote:
I have a g3 ibook 600mhz. … trying to install grub2 in CHROOT and gave up.

Since that is 32-Bit, you don't need to cross-compile. What do you need the chroot for? Oh, you booted from a live media?

Did you mount everything necessary as shown in Chroot (Gentoo Wiki) under section Configuration?

Also, you really shouldn't use ext3 anymore. Just include ext2/ext4 or XFS/ext4 and you're okay. Use ext2 or XFS as your boot partition.
I personally always used ext2 as /boot and never had any problems. As your primary step is to get a working boot configuration, I would stick to the book and get yaboot running first. After you've succeeded with this you can play around with GRUB2.

Good luck!
Back to top
View user's profile Send private message
schwarzygesetzlos
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 185
Location: Funeralopolis

PostPosted: Tue Feb 27, 2018 8:06 pm    Post subject: Reply with quote

I got a hint to a nice GRUB2 tutoral for PPC: :arrow: http://cynic.cc/blog/posts/running_grub2_on_powerpc_macs/
_________________
Talos II. [Gentoo Linux] | PMac G5 11,2. PMac G4 3,6. PBook G4 5,8. [MorphOS 3.18 / Gentoo Linux] | Vampire V4 SA [ApolloOS / Amiga OS 3.2.2]
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