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

Re: Updated installer images



On 09/21/2017 11:26 AM, John Paul Adrian Glaubitz wrote:
[...]
I’ll be happy to test Grub on my PowerMac7,3 G5 machine, but I’ll need instructions for doing so.  I’ve always just used yaboot, but Grub would be a nice addition…

There is documentation here, for example [1]. GRUB is available
for installation on both powerpc and ppc64. I haven't tested it
myself yet, but I would be very interested in seeing the results.

Adrian

[1] http://cynic.cc/blog/posts/running_grub2_on_powerpc_macs/


Thanks for the instructions which were also helpful to me :-). After some fiddling I got it to work on the earlier mentioned Power Macintosh G5 (11,2).

I followed the instructions on [1] but also needed to change a few things here and there - maybe also because I'm not that familiar with Grub2 yet :-).

I booted grub from OpenFirmware with the command given on [1]:

```
0 > boot hd:2,grub.img
```

`hd:2` is the HFS partition where yaboot and grub are located. I don't know if this can also be accomplied with the `mac-boot` command, which can be used to boot with yaboot.

I also created a small howto about the setup process that worked for me:

# GRUB-IEEE1275 setup in Power Macintosh G5 (11,2) #

## Install grub-ieee1275 ##

```
# apt install grub-ieee1275
```

## Full file list for grub image ##

Placed in `~/grub/`, copied from `/usr/lib/grub/powerpc-ieee1275`:

```
archelp.mod
bitmap.mod
bitmap_scale.mod
blocklist.mod
boot.mod
bufio.mod
cat.mod
cmp.mod
configfile.mod
cpio.mod
crypto.mod
datehook.mod
date.mod
datetime.mod
disk.mod
echo.mod
elf.mod
ext2.mod
fat.mod
font.mod
fshelp.mod
gettext.mod
gfxmenu.mod
gfxterm.mod
gzio.mod
halt.mod
help.mod
hexdump.mod
hfs.mod
hfsplus.mod
ieee1275_fb.mod
kernel.img
linux.mod
loadenv.mod
loopback.mod
lsmmap.mod
ls.mod
memdisk.mod
memrw.mod
minicmd.mod
moddep.lst
msdospart.mod
normal.mod
part_apple.mod
part_msdos.mod
parttool.mod
probe.mod
read.mod
reboot.mod
regexp.mod
relocator.mod
scsi.mod
search_fs_file.mod
search_fs_uuid.mod
search_label.mod
search.mod
setjmp.mod
sleep.mod
suspend.mod
terminal.mod
test.mod
trig.mod
true.mod
video_colors.mod
video_fb.mod
videoinfo.mod
video.mod
```

In addition to the list given on [1], the following files needed to be added (already included in the list above!):
```
moddep.lst
archelp.mod
video_colors.mod
disk.mod
kernel.img
```

## Partition table ##

```
~# mac-fdisk -l
/dev/sda
# type name length base ( size ) system /dev/sda1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map /dev/sda2 Apple_Bootstrap untitled 1954 @ 64 (977.0k) NewWorld bootblock /dev/sda3 Apple_UNIX_SVR2 untitled 1953126 @ 2018 (953.7M) Linux native /dev/sda4 Apple_UNIX_SVR2 untitled 1916015626 @ 1955144 (913.6G) Linux native /dev/sda5 Apple_UNIX_SVR2 swap 35554349 @ 1917970770 ( 17.0G) Linux swap /dev/sda6 Apple_Free Extra 49 @ 1953525119 ( 24.5k) Free space

Block size=512, Number of Blocks=1953525168
DeviceType=0x0, DeviceId=0x0
```

## Embedded config file ##

~/grub/grub-embedded-config.cfg
```
insmod part_apple
insmod ext2
set root=(ieee1275/hd,apple3)
set prefix=(ieee1275/hd,apple3)/grub
configfile /grub/grub.cfg
```

`(ieee1275/hd,apple3)` is `/dev/sda3`, the partition for `/boot` formatted with EXT3 (`(hd,apple3)` alone didn't work for me). To be able to load the config file I assume grub needs to first load the given modules.

## Actual config file ##

/boot/grub/grub.cfg
```
insmod part_apple
insmod ext2
set root=(ieee1275/hd,apple3)

timeout=5
default=0

menuentry "Debian GNU/Linux Sid (ppc64)" {
    linux /vmlinux root=/dev/sda4
    initrd /initrd.img
}
```

The first three lines can be omitted as they are also in the embedded configuration file but they're still informative as the embedded config file usually won't be touched again after installation.

## Command to create the grub image ##

```
~/grub# grub-mkimage -c ./grub-embedded-config.cfg -o ../grub.img -O powerpc-ieee1275 -d . -p '(ieee1275/hd,apple3)/boot/grub' *.mod
```

Although the prefix is actuall given in the embedded configuration file, `grub-mkimage` insisted on having this in its command line (`-p` option), too. The search command with the UUID of the partition for `/boot` didn't work for me.

## Installation on HFS partition ##

```
~# mount /dev/sda2 /mnt
~# cp grub.img /mnt/
~# sync
~# dh -h
[...]
/dev/sda2       974K  852K  122K  88% /mnt
[...]
~# umount /boot
```

My `grub.img` is about 639 KiB in size, so the 1 MiB HFS partition just was big enough to host both yaboot and grub, but maybe this partition should be created with a bigger size.


Reply to: