NVSETENV(8)

NAME
nvsetenv - change/view Open Firmware environment variables

SYNOPSIS
nvsetenv [variable [value]]

DESCRIPTION
nvsetenv is a program to adjust or view the Open Firmware (OF) boot parameters stored in non-volatile (battery-powered) RAM. nvsetenv will show the current values of all OF's environment variables when no parameters are given.

OPTIONS

variable
    nvsetenv will show current value of an OF's variable, if no value is given

variable value
    nvsetenv will set variable to value

EXAMPLES
This example will set the boot device to the first SCSI disk on the internal SCSI bus, using /vmlinux as boot image, trying to use the third partition as root partition.

        > nvsetenv boot-device  "scsi-int/sd@0:0"
        > nvsetenv boot-file    " /vmlinux root=/dev/sda3"

Alternatives boot devices are:

        scsi/sd@1:0             SCSI disk at ID 1
        ata/ata-disk@0:0        Internal IDE disk

You can also boot from a floppy, you need a XCOFF-format kernel image (in this example: vmlinux.coff), copied to a HFS format high-density (1.44Mb) floppy.

        > nvsetenv boot-device  "fd:vmlinux.coff"
        > nvsetenv boot-file    " root=/dev/sda3"

To return to MacOS, do:

        > nvsetenv boot-device  "/AAPL,ROM"

Valid values for "input-devices" are:

        ttya                    Modem serial port
        ttyb                    Printer serial port
        kbd                     Keyboard
        enet                    Ethernet interface

Valid values for "output-devices" are (machine and/or OF dependent):

        screen                  Screen display (newer machines)
        /chaos/control          Screen display (7500, 7600 and 8500)
        /bandit/ATY,264GT-B     Screen display (6500)

OF is not designed to wait for your hard disk to spin up (remember MacOS boots from ROM). Use the following setting to have OF retry to boot from your disk until is has spun up:

        > nvsetenv boot-command "begin ['] boot catch 1000 ms cr again"

You only have to append an "S" to the "boot-file" variable to boot Linux in single user mode. You can use install your own nvramrc patch using the following command:

        > nvsetenv nvramrc "`cat file.patch`"

(please note the backticks!), or:

        > nvsetenv nvramrc "$(cat file.patch)"

FILES

/dev/nvram
    character device with major number 10 and minor number 144

/proc/cpuinfo
    to identify New/Old-World machines

SEE ALSO
macos(8)

AUTHORS

Paul Mackerras <paulus@cs.anu.edu.au> (program)

Richard van Hees <R.M.vanHees@phys.uu.nl> (documentation)

Klaus Halfmann  <halfmann@libra.de> (NewWorld code)