This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Handbook:MIPS/Installation/Bootloader

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page Handbook:MIPS/Installation/Bootloader and the translation is 100% complete.
MIPS Handbook
Установка
Об установке
Выбор подходящего источника для установки
Настройка сети
Подготовка дисков
Установка stage3
Установка базовой системы
Настройка ядра
Настройка системы
Установка системных утилит
Настройка загрузчика
Завершение
Работа с Gentoo
Введение в Portage
USE-флаги
Возможности Portage
Система init-скриптов
Переменные окружения
Работа с Portage
Файлы и каталоги
Переменные
Смешение ветвей программного обеспечения
Дополнительные утилиты
Дополнительные репозитории пакетов
Расширенные возможности
Настройка сети
Начальная настройка
Расширенная настройка
Модульное построение сети
Беспроводная сеть
Добавляем функциональность
Динамическое управление



Arcload для машин с Silicon Graphics

arcload was written for machines that require 64-bit kernels, and therefore can't use arcboot (which can't easily be compiled as a 64-bit binary). It also works around peculiarities that arise when loading kernels directly from the volume header. Let's proceed with the installation:

root #emerge arcload dvhtool

Once this has finished, find the arcload binary inside /usr/lib/arcload/. Now, two files exist:

  • sashARCS: The 32-bit binary for Indy, Indigo2 (R4k), Challenge S and O2 systems
  • sash64: The 64-bit binary for Octane/Octane2, Origin 200/2000 and Indigo2 Impact systems

Use dvhtool to install the appropriate binary for the system into the volume header:

For Indy/Indigo2/Challenge S/O2 users:

root #dvhtool --unix-to-vh /usr/lib/arcload/sashARCS sashARCS

For Indigo2 Impact/Octane/Octane2/Origin 200/Origin 2000 users:

root #dvhtool --unix-to-vh /usr/lib/arcload/sash64 sash64
Заметка
The name sashARCS or sash64 does not have to be used, unless the operation is installing to the volume header of a bootable CD. For normal boot from hard-disk, it can be named whatever the user wants.

Now just use dvhtool to verify they are in the volume header:

root #dvhtool --print-volume-directory
----- directory entries -----
Entry #0, name "sash64", start 4, bytes 55859

The arc.cf file has a C-like syntax. For the full detail on how one configures it, see the arcload page on the Linux/MIPS wiki. In short, define a number of options, which are enabled and disabled at boot time using the OSLoadFilename variable.

Filearc.cfAn example arc.cf

'"`UNIQ--pre-00000002-QINU`"'

This is a deprecated template. Help us update this template!

Starting with arcload-0.5, arc.cf and kernels may reside either in the volume header, or on a partition. To utilize this newer feature, place the files in the /boot/ partition (or / if the boot partition is not separate). arcload uses the filesystem driver code from the popular grub bootloader, and thus supports the same range of filesystems.

root #dvhtool --unix-to-vh arc.cf arc.cf
root #dvhtool --unix-to-vh /usr/src/linux/vmlinux new

CoLo for Cobalt MicroServers

Installing CoLo

On Cobalt servers, these machines have a much less capable firmware installed on chip. The Cobalt BOOTROM is primitive, by comparison to the SGI PROM, and has a number of serious limitations.

  • There's a 675kB (approximate) limit on kernels. The current size of Linux 2.4 makes it nearly impossible to make a kernel this size. Linux 2.6 and 3.x is totally out of the question.
  • 64-bit kernels are not supported by the stock firmware (although these are highly experimental on Cobalt machines at this time)
  • The shell is basic at best

To overcome these limitations, an alternative firmware, called CoLo (Cobalt Loader) was developed. This is a BOOTROM image that can either be flashed into the chip inside the Cobalt server, or loaded from the existing firmware.

Заметка
This guide will go through setting up CoLo so that it is loaded by the stock firmware. This is the only truly safe, and recommended way to set up CoLo.
Предупреждение
If wanted, these can be flashed into the server to totally replace the original firmware -- however, you are entirely on your own in that endeavour. Should anything go wrong, physically remove the BOOTROM and reprogram it with the stock firmware. If this sounds scary -- then DO NOT flash the machine. We take no responsibility for whatever happens if you ignore this advice.

Let's get on with installing CoLo. First, start by emerging the package.

root #emerge --ask sys-boot/colo

With that installed, take a look inside the /usr/lib/colo/ directory to find two files:

  • colo-chain.elf (the "kernel" for the stock firmware to load), and
  • colo-rom-image.bin (a ROM image for flashing into the BOOTROM)

We start by mounting /boot/ and dumping a compressed copy of colo-chain.elf in /boot/ where the system expects it.

root #gzip -9vc /usr/lib/colo/colo-chain.elf > /boot/vmlinux.gz

Configuring CoLo

Now, when the system first boots up, it'll load CoLo which will spit up a menu on the back LCD. The first option (and default that is assumed after roughly 5 seconds) is to boot to the hard disk. The system would then attempt to mount the first Linux partition it finds, and run the script default.colo. The syntax is fully documented in the CoLo documentation (have a peek at /usr/share/doc/colo-X.YY/README.shell.gz -- where X.YY is the version installed), and is very simple.

Заметка
Just a tip: when installing kernels, it is recommended to create two kernel images, kernel.gz.working -- a known working kernel, and kernel.gz.new -- a kernel that's just been compiled. It is possible to use symlinks to point to the curent "new" and "working" kernels, or just rename the kernel images.
Filedefault.coloAn example CoLo configuration

'"`UNIQ--pre-00000005-QINU`"'

This is a deprecated template. Help us update this template!

Заметка
CoLo will refuse to load a script that does not begin with the #:CoLo:# line. Think of it as the equivalent of saying #!/bin/sh in shell scripts.

It is also possible to ask a question, such as which kernel & configuration to boot, with a default timeout. The following configuration does exactly this, asks the user which kernel they wish to use, and executes the chosen image. vmlinux.gz.new and vmlinux.gz.working may be actual kernel images, or just symlinks pointing to the kernel images on that disk. The 50 argument to select specifies that it should proceed with the first option ("Working") after 50/10 seconds.

Filedefault.coloMenu-based configuration

'"`UNIQ--pre-00000008-QINU`"'

This is a deprecated template. Help us update this template!

See the documentation in /usr/share/doc/colo-VERSION for more details.

Setting up for serial console

Okay, the Linux installation as it stands now, would boot fine, but assumes the user will be logged in at a physical terminal. On Cobalt machines, this is particularly bad -- there's no such thing as a physical terminal.

Заметка
Those who do have the luxury of a supported video chipset may skip this section if they wish.

First, pull up an editor and hack away at /etc/inittab. Further down in the file, notice the following:

File/etc/inittabSnippet from inittab

'"`UNIQ--pre-0000000B-QINU`"'

This is a deprecated template. Help us update this template!

First, uncomment the c0 line. By default, it's set to use a terminal baud rate of 9600 bps. On Cobalt servers, this may be changed to 115200 to match the baud rate decided by the BOOT ROM. The following is how that section looks then. On a headless machine (e.g. Cobalt servers), we also recommend commenting out the local terminal lines (c1 through to c6) as these have a habit of misbehaving when they can't open /dev/ttyX.

File/etc/inittabExample snippet from inittab

'"`UNIQ--pre-0000000E-QINU`"'

This is a deprecated template. Help us update this template!

Now, lastly... we have to tell the system, that the local serial port can be trusted as a secure terminal. The file we need to poke at is /etc/securetty. It contains a list of terminals that the system trusts. We simply stick in two more lines, permitting the serial line to be used for root logins.

root #echo 'ttyS0' >> /etc/securetty

Lately, Linux also calls this /dev/tts/0 -- so we add this too:

root #echo 'tts/0' >> /etc/securetty

Tweaking the SGI PROM

Setting generic PROM settings

With the bootloader installed, after rebooting (which we will come to in a second), go to the System Maintenance Menu and select Enter Command Monitor (5) like did initially when netbooting the system.

CodeMenu after boot

'"`UNIQ--pre-00000011-QINU`"'

This is a deprecated template. Help us update this template!

Provide the location of the Volume Header:

>>setenv SystemPartition scsi(0)disk(1)rdisk(0)partition(8)

Automatically boot Gentoo:

>>setenv AutoLoad Yes

Set the timezone:

>>setenv TimeZone EST5EDT

Use the serial console - graphic adapter users should have "g" instead of "d1" (one):

>>setenv console d1

Set the serial console baud rate. This is optional, 9600 is the default setting, although one may use rates up to 38400 if that is desired:

>>setenv dbaud 9600

Now, the next settings depend on how the system is booted.

Settings for direct volume-header booting

Заметка
This is covered here for completeness. It's recommended that users look into installing arcload instead.
Заметка
This only works on the Indy, Indigo2 (R4k) and Challenge S.

Set the root device to Gentoo's root partition, such as /dev/sda3:

>>setenv OSLoadPartition <root device>

To list the available kernels, type "ls".

>>setenv OSLoader <kernel name>
>>setenv OSLoadFilename <kernel name>

Declare the kernel parameters to pass:

>>setenv OSLoadOptions <kernel parameters>

To try a kernel without messing with kernel parameters, use the boot -f PROM command:

root #boot -f new root=/dev/sda5 ro

Settings for arcload

arcload uses the OSLoadFilename option to specify which options to set from arc.cf. The configuration file is essentially a script, with the top-level blocks defining boot images for different systems, and inside that, optional settings. Thus, setting OSLoadFilename=mysys(serial) pulls in the settings for the mysys block, then sets further options overridden in serial.

In the example file above, we have one system block defined, ip28 with working, new and debug options available. We define our PROM variables as so:

Select arcload as the bootloader:- sash64 or sashARCS:

>>setenv OSLoader sash64

Use the "working" kernel image, defined in "ip28" section of arc.cf:

>>setenv OSLoadFilename ip28(working)

Starting with arcload-0.5, files no longer need to be placed in the volume header -- they may be placed in a partition instead. To tell arcload where to look for its configuration file and kernels, one must set the OSLoadPartition PROM variable. The exact value here will depend on where the disk resides on the SCSI bus. Use the SystemPartition PROM variable as a guide -- only the partition number should need to change.

Заметка
Partitions are numbered starting at 0, not 1 as is the case in Linux.

To load from the volume header -- use partition 8:

>>setenv OSLoadPartition scsi(0)disk(1)rdisk(0)partition(8)

Otherwise, specify the partition and filesystem type:

>>setenv OSLoadPartition scsi(0)disk(1)rdisk(0)partition(0)[ext2]


Перезагрузка системы

Выйдите из chroot среды и размонтируйте все смонтированные разделы. Затем введите ту самую волшебную команду, которая запускает последний настоящий тест: reboot.

root #exit
cdimage ~#cd
cdimage ~#umount -l /mnt/gentoo/dev{/shm,/pts,}
cdimage ~#umount -R /mnt/gentoo
cdimage ~#reboot

Естественно, не забудьте вынуть загрузочный компакт-диск, иначе он загрузится сам вместо вашей новой системы Gentoo.

Загрузив вновь установленную систему, переходите к завершению установки Gentoo.