ALTBOOT(8) (sandpoint)

ALTBOOT(8) | System Manager's Manual (sandpoint) | ALTBOOT(8)

# NAME

`altboot` —
program to boot NetBSD kernel from disk or network

# DESCRIPTION

`altboot` is a standalone program which works on top of a NAS product's bootloader. It is capable of loading a NetBSD kernel from an IDE or SATA disk drive, or via network with NFS or TFTP protocol. `altboot` can be stored in flash ROM. Typically you will first copy it from flash into RAM and then invoke it there to boot the NetBSD kernel.

`altboot` runs in conjunction with popular U-Boot/PPCBoot bootloaders used by NAS products. With an appropriate boot command line, saved in the environment, `altboot` can load and start a NetBSD kernel without manual intervention. The original U-Boot/PPCBoot bootloaders remain useful and altboot works as a functional extension of them.

# EXAMPLES

`altboot` occupies less than 128KB in volume and can be stored to any vacant space of the system's flash. It is made to run at RAM address offset 0x0100'0000. U-Boot/PPCboot is instructed to copy the program to RAM in this way:

`=> cp.b fffe0000 1000000 20000`

Here 0xfffe'0000 is the flash address where `altboot` is stored while 0x0100'0000 is the RAM address to copy to.

The invocation syntax is:

`=> go 1000000 ide:N opt1 opt2 ... bootname`

ide:N
  where N is a string of digits, which defines the number of connected drives on each PATA channel. This option is useful to avoid the delays, when `altboot` is trying to detect a non-existing drive. Examples:
  ide:10
    A single master drive on the first channel. Nothing on the second channel.
  ide:22
    A master and slave drive on both channels of the first controller.
  ide:1111
    A master drive on each channel. The first two digits belong to the first controller, the last two to the second controller.

  Unspecified digits will be read as 0. The ide option has only a meaning for PATA disks. Omitting it makes it default to ide:10.

optN
  multi, auto, ask, single, ddb, userconf, norm, quiet, verb, silent, debug

  Omitting optN makes `altboot` default to multi-user mode boot.

  N.B., the maximum number of allowed go command arguments varies and depends on the U-Boot/PPCBoot buildtime configuration.

bootname
  One of the following:

  `nfs:filename`
  `nfs:`
  `tftp:filename`
  `tftp:`
  `wdNp:filename`
  `wdNp:`
  `mem:address`
  `net:`

  The last one is a synonym for “nfs”.

nfs:filename
  issue a DHCP request to determine the IP address and download filename from the NFS server.
nfs:
  target file is determined by filename field of /etc/dhcpd.conf
tftp:filename
  issue a DHCP request to determine IP address and download filename from the TFTP server.
tftp:
  target file is determined by filename field of /etc/dhcpd.conf
wdNp:filename
  load the ELF NetBSD kernel filename from an FFSv2 or FFSv1 filesystem. N is a number to distinguish the target drive. p is a partition specifier. When omitted, partition ‘a’ is assumed. “wd0a” means partition ‘a’ of the first disk drive.
wdNp:
  use filename “netbsd” for booting the ELF NetBSD kernel.
mem:address
  boots the ELF NetBSD kernel from any address in memory. The address argument has to be specified as a hexadecimal number and denotes the start address of the ELF image in memory.

`altboot` can boot from RAID 1 partitions, but only if the RAID partition is the first partition on the disk.

U-Boot/PPCBoot provides a way to run a short list of commands right after power-on. The following is a procedure to setup the system for starting NetBSD after a 5 second delay, allowing the user to break into interactive mode. Note that a backslashed ‘;’ is necessary to enter the script correctly.

    => setenv bootcmd cp.b fffe0000 1000000 20000\; go 1000000 wd0:
    => setenv bootdelay 5
    => saveenv

When U-Boot/PPCBoot is lacking important commands like cp or go, or is unable to save the enviroment, then there is still the option to replace the Linux kernel module by altboot.img and save it to the same address in flash ROM. In this case you have only two options left to pass arguments:

- Enter the interactive command line mode, after `altboot` has started. This requires a serial console.
- Write a fixed command line into flash, replacing the Linux initrd image. The command line is a normal ASCII file, started by the identifier altboot: and terminated by any control character between 0 and 31. Example:
  `altboot:silent ide:1111 wd0:netbsd`

# SEE ALSO

dhcpd(8), diskless(8), nfsd(8), raidctl(8), tftpd(8)

# HISTORY

The NetBSD/sandpoint `altboot` first appeared in NetBSD 6.0.

# BUGS

The Realtek Gigabit Ethernet driver does not work correctly at 1000 Mbps. Another known problem of this driver is that it runs into a timeout after a coldstart. The system has to be rebooted at least once to make it work.

October 7, 2013 | NetBSD 9.5