Home > Articles > Operating Systems, Server > Solaris

  • Print
  • + Share This
This chapter is from the book

OpenBoot NVRAM

  • List, change, and restore default NVRAM parameters.

  • View and change NVRAM parameters from the shell.

System configuration variables are stored in system NVRAM. These OpenBoot variables determine the startup machine configuration and related communication characteristics. If you modify the values of the configuration variables, any changes you make remain in effect even after a power cycle. Configuration variables should be adjusted cautiously, however, because incorrect settings can prevent a system from booting.

Table 3.7 describes OpenBoot's NVRAM configuration variables, their default values, and their functions.

Table 3.7 - NVRAM Variables

Variable

Default

Description

auto-boot?

true

The system starts up automatically after power-on or reset if auto-boot? is true. If it is set to false, the system stops at the OpenBoot prompt (ok) after power-on or reset.

boot-command

boot

The command that is executed if auto-boot? is true.

boot-device

disk or net

The device from which to start up.

boot-file

Empty string

Arguments passed to the started program.

diag-device

net

The diagnostic startup source device.

diag-file

Empty string

Arguments passed to the startup program in diagnostic mode.

diag-switch?

false

Whether to run in diagnostic mode.

fcode-debug?

false

Whether name fields are included for plug-in device FCodes.

input-device

keyboard

A console input device (usually keyboard, ttya, or ttyb).

nvramrc

Empty

The contents of NVRAMRC.

oem-banner

Empty string

A custom original equipment manufacturer (OEM) banner (enabled with oem-banner? true).

oem-banner?

false

If true, use custom OEM banner.

oem-logo

No default

A byte array custom OEM logo (enabled with oem-logo? true). Displayed in hexadecimal.

oem-logo?

false

If true, use custom OEM logo; otherwise, use the Sun logo.

output-device

screen

A console output device (usually screen, ttya, or ttyb).

sbus-probe-list

0123

Which SBus slots to probe and in what order.

screen-#columns

80

The number of onscreen columns (characters/line).

screen-#rows

34

The number of onscreen rows (lines).

security-#badlogins

No default

The number of incorrect security password attempts.

security-mode

none

The firmware security level (options: none, command, or full).

security-password

No default

The firmware security password (which is never displayed).

use-nvramrc?

false

If true, execute commands in NVRAMRC during system startup.


NOTE

OpenBoot Versions Because older SPARC systems use older versions of OpenBoot, they might use different defaults or different configuration variables from those shown in Table 3.7. This text describes OpenBoot version 4.

You can view and change the NVRAM configuration variables by using the commands listed in Table 3.8.

Table 3.8 - Commands for Viewing and Modifying Configuration Variables

Command

Description

password

Sets the security password.

printenv

Displays the current value and the default value for each variable. To show the current value of a named variable, you type the following: printenv <parameter-name>

setenv <variable> <value>

Sets <variable> to the given decimal or text <value>. Changes are permanent, but they often take effect only after a reset.

set-default <variable>

Resets the value of <variable> to the factory default.

set-defaults

Resets variable values to the factory defaults.


The following examples illustrate the use of the commands described in Table 3.8. All commands are entered at the ok OpenBoot prompt.

You use the printenv command, with no argument, to display the current value and the default value for each variable:

ok printenv

The system responds with this:

Variable Name     Value             Default Value
tpe-link-test?    true              true
scsi-initiator-id   7               7
keyboard-click?    false             false
keymap
ttyb-rts-dtr-off   false             false
ttyb-ignore-cd    true              true
ttya-rts-dtr-off   false             false
ttya-ignore-cd    true              true
ttyb-mode       9600,8,n,1,-          9600,8,n,1,-
ttya-mode       9600,8,n,1,-          9600,8,n,1,-
pcia-probe-list    1,2,3,4            1,2,3,4
pcib-probe-list    1,2,3             1,2,3
mfg-mode       off              off
diag-level      max              max
#power-cycles     89
system-board-serial#
system-board-date
fcode-debug?     false             false
output-device     screen             screen
input-device     keyboard            keyboard
load-base       16384             16384
boot-command     boot              boot
auto-boot?      false             true
watchdog-reboot?   false             false
diag-file
diag-device      net              net
boot-file
boot-device      disk:a disk net        disk net
local-mac-address?  false             false
ansi-terminal?    true              true
screen-#columns    80               80
screen-#rows     34               34
silent-mode?     false             false
use-nvramrc?     false             false
nvramrc
security-mode     none
security-password
security-#badlogins  0
oem-logo
oem-logo?       false             false
oem-banner
oem-banner?      false             false
hardware-revision
last-hardware-update
diag-switch?     false             false

NOTE

The printenv Command Depending on the version of OpenBoot that you have on your system, the printenv command might show slightly different results. This example uses a system running OpenBoot version 3.15.

To set the auto-boot? variable to false, you type the following:

ok setenv auto-boot? false

The system responds with this:

auto-boot? =  false

You can verify the setting by typing the following:

ok printenv auto-boot?

The system responds with this:

auto-boot? =   true

To reset the variable to its default setting, you type the following:

ok set-default auto-boot?

The system does not respond with a message—only another OpenBoot prompt. You can verify the setting by typing the following:

ok printenv auto-boot?

The system responds with this:

auto-boot? =   true

To reset all variables to their default settings, you type the following:

ok set-defaults

The system responds with this:

Setting NVRAM parameters to default values.

It's possible to set variables from the Unix command line by issuing the eeprom command. You must be logged in as root to issue this command, and although anyone can view a parameter, only root can change the value of a parameter. For example, to set the auto-boot? variable to true, you type the following at the Unix prompt:

eeprom auto-boot\?=true

Any nonroot user can view the OpenBoot configuration variables from a Unix prompt by typing the following:

/usr/sbin/eeprom

For example, to change the OpenBoot parameter security-password from the command line, you must be logged in as root and issue the following command:

example# eeprom security-password=
Changing PROM password:
New password:
Retype new password:

CAUTION

Setting the OpenBoot Security Mode Setting the security mode and password can be dangerous: If you forget the password, the system is unable to boot. It is nearly impossible to break in without sending the CPU to Sun to have the PROM reset. OpenBoot security is discussed more in the section "OpenBoot Security," later in this chapter.

The security mode password you assign must be between zero and eight characters. Any characters after the eighth are ignored. You do not have to reset the system after you set a password; the security feature takes effect as soon as you type the command.

With no parameters, the eeprom command displays all the OpenBoot configuration settings, similar to the OpenBoot printenv command.

To view OpenBoot parameters from the shell prompt, you type prtconf –vp.

You can use the NVRAM commands listed in Table 3.9 to modify device aliases so that they remain permanent, even after a restart.

NOTE

Resetting NVRAM Variables If you change an NVRAM setting on a SPARC system and the system no longer starts up, you can reset the NVRAM variables to their default settings by holding down Stop+N while the machine is powering up. When you issue the Stop+N key sequence, you hold down Stop+N immediately after turning on the power to the SPARC system; you then keep these keys pressed for a few seconds or until you see the banner (if the display is available).

These are both good techniques for forcing a system's NVRAM variables to a known condition.

Table 3.9 - NVRAM Commands

Command

Description

nvalias <alias> <device-path>

Stores the command devalias <alias> <device-path> in NVRAMRC. (The alias persists until the nvunalias or set-defaults command is executed.) This command turns on use-nvramrc?.

nvunalias <alias>

Deletes the corresponding alias from NVRAMRC.


For example, to permanently create a device alias named disk3 that represents a SCSI disk with a target ID of 3 on a SPARCstation 10 system, you type the following:

nvalias disk3 /pci@1f,0/pci@1,1/ide@3/disk@3,0

The nvedit Line Editor

On systems with a PROM version of 1.x or 2.x, the nvalias command might not be available. On these systems, you need to use nvedit to create custom device aliases. nvedit is a line editor that edits the NVRAMRC directly, has a set of editing commands, and operates in a temporary buffer. The following is a sample nvedit session:

ok setenv use-nvramrc? true

TIP

Learning nvedit This section is included for information purposes, to show an additional method for modifying the NVRAM. The nvedit line editor will not be on the certification exam.

The system responds with the following:

use-nvramrc? =   true
ok nvedit

 0: devalias disk0 /pci@1f,0/pci@1,1/ide@3/disk@0,0\
1: <Control-C>
ok nvstore
ok reset
  Resetting ......
ok boot disk0

The preceding example uses nvedit to create a permanent device alias named disk0. The example uses Ctrl+C to exit the editor. It also uses the nvstore command to make the change permanent in the NVRAMRC. Then, it issues the reset command to reset the system and then boots the system from disk0 by using the boot disk0 command.

Table 3.10 lists some of the basic commands you can use while in the nvedit line editor.

Table 3.10 - nvedit Commands

Command

Meaning

Ctrl+A

Moves backward to beginning of the line.

Ctrl+B

Moves backward one character.

Esc+B

Moves backward one word.

Ctrl+C

Exits the script editor, returning to the OpenBoot command interpreter. The temporary buffer is preserved but is not written back to the script. You use nvstore afterward to write it back.

Ctrl+D

Erases the next character.

Esc+D

Erases from the cursor to the end of the word, storing the erased characters in a save buffer.

Ctrl+E

Moves forward to the end of the line.

Ctrl+F

Moves forward one character.

Esc+F

Moves forward one word.

Ctrl+H

Erases the previous character.

Esc+H

Erases from the beginning of the word to just before the cursor, storing erased characters in a save buffer.

Ctrl+K

Erases from the cursor position to the end of the line, storing the erased characters in a save buffer. If at the end of a line, it joins the next line to the current line (that is, deletes the new line).

Ctrl+L

Displays the entire contents of the editing buffer.

Ctrl+N

Moves to the next line of the script-editing buffer.

Ctrl+O

Inserts a new line at the cursor position and stays on the current line.

Ctrl+P

Moves to the previous line of the script-editing buffer.

Ctrl+Q

Quotes the next character (that is, allows you to insert control characters).

Ctrl+R

Retypes the line.

Ctrl+U

Erases the entire line, storing the erased characters in a save buffer.

Ctrl+W

Erases from the beginning of the word to just before the cursor, storing erased characters in a save buffer.

Ctrl+Y

Inserts the contents of the save buffer before the cursor.

Return (Enter)

Inserts a new line at the cursor position and advances to the next line.

Delete

Erases the previous character.

Backspace

Erases the previous character.


  • + Share This
  • 🔖 Save To Your Account