Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.
Eric Snowberg edited this page Jul 3, 2018 · 26 revisions

Introduction

This is a staging site for SPARC specific patches that will, at some point, go upstream.

Currently staged SPARC patches are located in the following branch:
https://github.com/esnowberg/grub2-sparc/tree/sparc-next-v6

Building

$ ./autogen.sh
$ CC="/usr/bin/gcc -fno-PIE -no-pie" ./configure
$ make && make install

Installation Instructions for SPARC T3 and below

GRUB embedding is not currently supported on these SPARC systems. At this time, always install GRUB on the /boot partition. For example, do not try to install it on /dev/sdb. This could destroy your partition table and you could lose everything on your disk.

Prerequisites

Verify the following is set in the /etc/default/grub file:

GRUB_PRELOAD_MODULES="iso9660"

Also make sure there is a grub directory on your system:

$ mkdir -p /boot/grub

Steps to install GRUB for the first time

A grub.cfg file must be generated first. The program grub-mkconfig generates a configuration file for GRUB. Issue the following command:

$ grub-mkconfig -o /boot/grub/grub.cfg 

Next, install GRUB on the boot partition (where /dev/sdb1 is the boot partition in the example below):

$ grub-install --force  --skip-fs-probe /dev/sdb1

The following warning can be ignored for now:

Installing for sparc64-ieee1275 platform. 
grub2-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using
blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
Installation finished. No error reported.

Installation Instructions for SPARC T4 and above

Prerequisites

Before trying to install GRUB on your system, verify your firmware supports GPT. There are a few ways to check this. If you can get to the OBP prompt, there is a property located here:

{0} ok cd /packages/disk-label
{0} ok .properties
gpt
supported-labels	gpt
                    sun
                    mbr
name                disk-label

If you see gpt, then you are all set.

If you don't want to go into OBP, from within Linux, you can find this with either of the following methods:

prtconf -pv | grep -c gpt

or you can look for the existence of the following file:

/sys/firmware/devicetree/base/packages/disk-label/gpt

If you do not see GPT with any of the methods above, a firmware update is necessary before moving forward.

Next, verify your disk contains a BIOS boot partition. This can be done with:

$ parted /dev/sda print

Verify there is a partition with the bios-grub flag set. As seen below in partition #1:

Model: HGST H101860SFSUN600G (scsi) Disk /dev/sdd: 600GB Sector size (logical/physical): 512B/512B Partition Table: gpt

Number Start End Size File system Name Flags 1 1049kB 8389kB 7340kB bios_grub bios_grub 2 8389kB 1151MB 1143MB ext3 boot 3 1151MB 600GB 599GB lvm

If this partition is not here, then repartition your drive similar to the example above. Note, the /boot partition should NOT have the boot flag set.

If you do not want to repartition your drive and continue to use SUN/VTOC, then proceed to the installation instructions above for SPARC T3 and below hardware.

Next, verify the following is set in the /etc/default/grub file:

GRUB_PRELOAD_MODULES="iso9660"

Also make sure there is a grub directory on your system:

$ mkdir -p /boot/grub

Steps to install GRUB for the first time

First, a grub.cfg file must be generated. The program grub-mkconfig generates a configuration file for grub.

$ grub-mkconfig -o /boot/grub/grub.cfg 

Then install grub on the disk.

$ grub-install /dev/sda 

After the grub-install completes, SILO has been removed and GRUB has been installed.

How to obtain the OBP boot path if the BIOS Boot partition is on the first partition

Issue the following command to get your OBP boot path:

$ grub-ofpathname /dev/sda
/pci@302/pci@2/pci@0/pci@17/LSI,sas@0/disk@w5000cca02f037d6d,0

The path returned is your new boot path that should be supplied to OBP to boot your kernel.

How to obtain the OBP boot path if the BIOS Boot partition is NOT the first partition

If your BIOS boot partition is NOT the first partition on the disk. Issue the grub-ofpathname command with the partition containing the BIOS boot partition, to get your OBP boot path. In the example below, the second partition contains the BIOS boot partition:

$ grub-ofpathname /dev/sda2
/pci@302/pci@2/pci@0/pci@17/LSI,sas@0/disk@w5000cca02f037d6d,0:b

The path returned is your new boot path that should be supplied to OBP to boot your kernel.