Handbook:SPARC/Blocks/Bootloader

From Gentoo Wiki
Jump to:navigation Jump to:search
This page contains changes which are not marked for translation.


GRUB2

When selecting a 64-bit profile during installation, then GRUB2 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:2

The GRUB2 software has now been merged to the system, but not yet installed.

Install

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

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.

{{RootCmd template error}}
Parameter 1 not defined. For correct usage see RootCmd template's documentation on the 1 parameter.

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-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

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-3.16.5-gentoo as kernel image and initramfs-genkernel-sparc64-3.16.5-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-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:

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.