GRUB should be correctly configured for the platform automatically based on the profile. To make it explicit, however, specify it using:
echo 'GRUB_PLATFORMS="ieee1275"' >> /etc/portage/make.conf
emerge --ask --verbose sys-boot/grub
The GRUB software has now been merged to the system, but not yet installed as a bootloader.
If the disk is partitioned using GPT (the preferred method), then install GRUB to the BIOS boot partition. Presuming the first disk (the one where the system boots from) is /dev/sda, the following commands will do:
grub-install --target=sparc64-ieee1275 --recheck /dev/sda
Sun partition table
If the disk is partitioned using a Sun partition table instead, GRUB must be installed using blocklists. In this mode, instead of providing the physical disk as an argument, provide the path to the partition on which /boot/grub is mounted.
grub-install --target=sparc64-ieee1275 --recheck --force --skip-fs-probe /dev/sda1
Next, generate the GRUB2 configuration based on the user configuration specified in the /etc/default/grub file and /etc/grub.d scripts. In most cases, no configuration is needed by users as GRUB2 will automatically detect which kernel to boot (the highest one available in /boot/) and what the root file system is. It is also possible to append kernel parameters in /etc/default/grub using the GRUB_CMDLINE_LINUX variable.
To generate the final GRUB2 configuration, run the grub-mkconfig command:
grub-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ... Found linux image: /boot/vmlinuz-3.16.5-gentoo Found initrd image: /boot/initramfs-genkernel-sparc-3.16.5-gentoo done
The output of the command must mention that at least one Linux image is found, as those are needed to boot the system. If an initramfs is used or genkernel was used to build the kernel, the correct initrd image should be detected as well. If this is not the case, go to /boot/ and check the contents using the ls command. If the files are indeed missing, go back to the kernel configuration and installation instructions.
SILO, the SPARC bootloader
emerge --ask sys-boot/silo
Next create /etc/silo.conf:
nano -w /etc/silo.conf
Below an example silo.conf file is shown. It uses the partitioning scheme we use throughout this book, kernel-3.16.5-gentoo as kernel image and initramfs-genkernel-sparc64-3.16.5-gentoo as initramfs.
partition = 1 # Boot partition (= root partition)
root = /dev/sda1 # Root partition
timeout = 150 # Wait 15 seconds before booting the default section
image = /boot/kernel-3.16.5-gentoo
label = linux
append = "initrd=/boot/initramfs-genkernel-sparc64-3.16.5-gentoo root=/dev/sda1"
When using the example silo.conf file as delivered by Portage, be sure to comment out all lines that aren't needed.
If the physical disk on which to install SILO (as bootloader) differs from the physical disk on which /etc/silo.conf resides, then first copy over /etc/silo.conf to a partition on that disk. If /boot/ is a separate partition on that disk, copy over the configuration file to /boot/ and run /sbin/silo:
cp /etc/silo.conf /boot
/sbin/silo -C /boot/silo.conf
/boot/silo.conf appears to be valid
Otherwise just run /sbin/silo:
/etc/silo.conf appears to be valid
Run silo (with parameters if necessary) again each time after updating or installing the package.