OpenBoot NVRAMObjective: List, change, and restore default NVRAM parameters.
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.
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. 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.31. 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? = false To reset the variable to its default setting, you type the following: ok set-default auto-boot? The system does not respond with a messageonly 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 (note the use of quotes to escape the ? from expansion by the shell): eeprom 'auto-boot?=true' Any non-root 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. Use the prtconf command with the -vp options to view OpenBoot parameters from the shell prompt as follows: prtconf -vp The system responds with a great deal of output, but you'll see the following OpenBoot information embedded in the output: . . . . <output truncated> ansi-terminal?: 'true' screen-#columns: '80' screen-#rows: '34' silent-mode?: 'false' use-nvramrc?: 'false' nvramrc: security-mode: 'none' security-password: security-#badlogins: '0' oem-logo: oem-logo?: 'false' oem-banner: oem-banner?: 'false' hardware-revision: last-hardware-update: diag-switch?: 'false' name: 'options' Node 0xf002ce38 screen: '/pci@1f,0/pci@1,1/SUNW,m64B@2' net: '/pci@1f,0/pci@1,1/network@1,1' cdrom: '/pci@1f,0/pci@1,1/ide@3/cdrom@2,0:f' disk: '/pci@1f,0/pci@1,1/ide@3/disk@0,0' disk3: '/pci@1f,0/pci@1,1/ide@3/disk@3,0' disk2: '/pci@1f,0/pci@1,1/ide@3/disk@2,0' disk1: '/pci@1f,0/pci@1,1/ide@3/disk@1,0' disk0: '/pci@1f,0/pci@1,1/ide@3/disk@0,0' ide: '/pci@1f,0/pci@1,1/ide@3' . . . <output truncated> Note Resetting NVRAM Variables On non-USB style keyboards, not USB keyboards, 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. You can use the NVRAM commands listed in Table 3.9 to modify device aliases so that they remain permanent, even after a restart.
For example, to permanently create a device alias named bootdisk that represents a SCSI disk with a target ID of 3 on an Ultra 5 system, you type the following: nvalias bootdisk /pci@1f,0/pci@1,1/ide@3/disk@3,0 Because disk device pathnames can be long and complex, the show-disks command is provided to assist you in creating device aliases. Type the show-disks command and a list of disk devices is shown as follows: ok show-disks a) /pci@1f,0/pci@1,1/ide@3/cdrom b) /pci@1f,0/pci@1,1/ide@3/disk c) /pci@1f,0/pci@1,1/ebus@1/fdthree@14,3023f0 q) NO SELECTION Enter Selection, q to quit: Type b to select an IDE disk and the system responds with the following message: /pci@1f,0/pci@1,1/ide@3/disk has been selected. Type ^Y ( Control-Y ) to insert it in the command line. e.g. ok nvalias mydev ^Y for creating devalias mydev for /pci@1f,0/pci@1,1/ide@3/disk Now create a device alias named mydisk followed by ctrl+y as follows: nvalias mydisk ^Y The system pastes the selected device path as follows: ok nvalias mydisk /pci@1f,0/pci@1,1/ide@3/disk Now all you need to do is add the target number and logical unit number (for example, sd@0,0 or disk@0,0) to the end of the device name as follows: ok nvalias mydisk /pci@1f,0/pci@1,1/ide@3/disk@0,0 Note Specifying the Disk Slice If the boot slice of the disk device that you wish to boot to is not slice 0, you will need to add the disk slice letter to the end of the device name as follows: ok nvalias mydisk /pci@1f,0/pci@1,1/ide@3/disk@0,0:b In the example, I used the letter "b," which corresponds to disk slice 1. This is one area where you'll find disk slices identified by an alpha character and not a number. The letter "a" corresponds to slice 0, "b" is slice 1, etc. If no letter is specified, "a" for slice 0 is assumed. For example, /pci@1f,0/pci@1,1/ide@3/disk@0,0 is the same as specifying /pci@1f,0/pci@1,1/ide@3/disk@0,0:a. To remove an alias, type nvunalias <aliasname>. For example, to remove the devalias named mydisk, type ok nvunalias mydisk The alias named mydisk will no longer be listed after the next OpenBoot reset. The nvedit Line EditorOptionally, you can use nvedit to create your device aliases. On systems with a PROM version of 1.x or 2.x, the nvalias command might not be available and you must use nvedit to create custom device aliases. nvedit is an OpenBoot 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 covered on the certification exam. The system responds with the following: use-nvramrc? = true ok nvedit 0: devalias bootdisk /pci@1f,0/pci@1,1/ide@3/disk@0,0 1: <Control-C> ok nvstore ok reset-all Resetting ...... ok boot bootdisk The preceding example uses nvedit to create a permanent device alias named bootdisk. 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-all command to reset the system and then boots the system from bootdisk by using the boot bootdisk command. Table 3.10 lists some of the basic commands you can use while in the nvedit line editor.
|