Handbook:SPARC/Installation/Bootloader

From Gentoo Wiki
Jump to:navigation Jump to:search
SPARC Handbook
Installation
About the installation
Choosing the media
Configuring the network
Preparing the disks
The stage file
Installing base system
Configuring the kernel
Configuring the system
Installing tools
Configuring the bootloader
Finalizing
Working with Gentoo
Portage introduction
USE flags
Portage features
Initscript system
Environment variables
Working with Portage
Files and directories
Variables
Mixing software branches
Additional tools
Custom package repository
Advanced features
OpenRC network configuration
Getting started
Advanced configuration
Modular networking
Wireless
Adding functionality
Dynamic management



GRUB

When selecting a 64-bit profile during installation, then GRUB is the only supported bootloader.

Emerge

GRUB should be correctly configured for the platform automatically based on the profile. To make it explicit, however, specify it using:

root #echo 'GRUB_PLATFORMS="ieee1275"' >> /etc/portage/make.conf
root #emerge --ask --verbose sys-boot/grub

The GRUB software has now been merged to the system, but not yet installed as a bootloader.

Install

GPT

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:

root #grub-install --target=sparc64-ieee1275 --recheck /dev/sda
Tip
To find the boot device string to enter in the firmware, use the grub-ofpathname tool. If the BIOS boot partition is the first partition on the disk, select the entire disk:

root #grub-ofpathname /dev/sda

Otherwise, explicitly select the BIOS boot partition:

root #grub-ofpathname /dev/sda2

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.

root #grub-install --target=sparc64-ieee1275 --recheck --force --skip-fs-probe /dev/sda1

Configure

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:

root #grub-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-6.6.21-gentoo
Found initrd image: /boot/initramfs-genkernel-sparc-6.6.21-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

When selecting a 32-bit profile during installation, then SILO (Sparc Improved boot LOader) is the only supported bootloader.

root #emerge --ask sys-boot/silo

Next create /etc/silo.conf:

root #nano -w /etc/silo.conf

Below an example silo.conf file is shown. It uses the partitioning scheme we use throughout this book, kernel-6.6.21-gentoo as kernel image and initramfs-genkernel-sparc64-6.6.21-gentoo as initramfs.

FILE /etc/silo.confExample configuration file
partition = 1         # Boot partition (= root partition)
root = /dev/sda1      # Root partition
timeout = 150         # Wait 15 seconds before booting the default section
  
image = /boot/kernel-6.6.21-gentoo
  label = linux
  append = "initrd=/boot/initramfs-genkernel-sparc64-6.6.21-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:

root #cp /etc/silo.conf /boot
root #/sbin/silo -C /boot/silo.conf
/boot/silo.conf appears to be valid

Otherwise just run /sbin/silo:

root #/sbin/silo
/etc/silo.conf appears to be valid
Note
Run silo (with parameters if necessary) again each time after updating or installing the sys-boot/silo package.


Rebooting the system

Exit the chrooted environment and unmount all mounted partitions. Then type in that one magical command that initiates the final, true test: reboot.

(chroot) livecd #exit
livecd~#cd
livecd~#umount -l /mnt/gentoo/dev{/shm,/pts,}
livecd~#umount -R /mnt/gentoo
livecd~#reboot

Do not forget to remove the live image, otherwise it may be targeted again instead of the newly installed Gentoo system!

Once rebooted in the fresh Gentoo environment, it is wise to finish with Finalizing the Gentoo installation.