[Previous] [Contents] [Next]

netboot

Service boot requests from the network (QNX)

Syntax:

netboot [-Aav] [-B burst] [-b address] [-f bootfile] 
        [-m mapfile] [-P packets] [-S ms] &

Options:

-a
Automatically assign a logical node ID to any node that's not currently defined in the netmap file. A boot request is processed and the node's entry is added to the file. The assignment of logical node IDs is incremental from the highest existing logical node ID in the netmap file.
-A
Similar to -a, except that each new node will be assigned the lowest unassigned logical node ID, thus filling any "holes" in the network node map.
-b address
For any node booting an operating system built at boot time by buildqnx (f=buildfile in that node's entry in the bootfile), pass this as the load address to buildqnx. The address, which is always specified in hexadecimal, must be greater than or equal to 0x1000 and must be a multiple of 0x1000.
-B burst
The starting packet burst size (default: 40).

Boot data is sent out in bursts of packets, in between which netboot pauses. This is done so that machines executing from the boot ROM (which is slower than executing out of RAM) are not overwhelmed and unable to keep up with the flow of data. If a given node repeatedly tries to boot (within a short interval of the last data packet being sent), netboot will assume that the machine had trouble with the data rate and will use smaller packet bursts. The netboot utility will remember the last packet burst size used for a given node and will reuse it if that machine boots again within 15 minutes.

Special -B burst values may be specified to restrict this auto-slowdown feature:

-B 0
Disables the auto-slowdown completely. The packet burst rate is fixed to the default or whatever was specified in another -B option as the starting packet burst size.
-B -minburst
Specifying a negative number to -B puts a lower limit on the burst size that netboot will use to boot a node. The default is 2 (-B -2).
-f bootfile
Use this file as the network boot configuration file. The default is /etc/config/netboot. The bootfile contains information about how to boot each node in the network that will be serviced by netboot.
-m mapfile
Use this file as the network node mapfile. The default is /etc/config/netmap. In most cases, you should ensure that the file you specify here is the same one specified for netmap -f or netmap -F.
-P packets
Try to read an OS image this amount at a time. The amount will be the packet size of the boot media multiplied by the specified packets. A large number may result in too large a delay between packets for some boot ROM/network card combinations. This number must be between 1 and 10. Default: 5.
-S ms
The number of milliseconds to pause between transmission of each set of burst packets (see -B). The number will be rounded to an even multiple of the current timer resolution at the time the boot request is serviced (see ticksize). (1<=ms<=1000; default: 10)
-v
Be verbose; print each boot request to standard output. Multiple -v options will cause netboot to be increasingly verbose for troubleshooting.

Description:

The netboot utility services boot requests from machines attempting to boot over the network. If a node is being used as a boot server, netboot must be running on that node before other machines can boot over the network from that node.

When netboot starts, it queries the Network Manager (Net) about the network drivers currently running on the machine. Using the information it receives, netboot will "adopt" a corresponding set of boot packet protocols. Net then passes incoming boot packets to netboot, which services the boot request.

When boot request packets are passed to netboot, Net informs netboot of the following information:

With this information, netboot first determines the logical node ID of the requesting node, and then looks up how it is to boot that logical node.

Determining the logical node ID

The netboot utility determines the logical node ID of the requesting node by looking for an entry in the /etc/config/netmap file that matches the logical network ID and physical node ID of the requesting node. Only the logical-to-physical node ID mapping fields are considered; that is, netboot will try to boot the node regardless of whether the node is masked or unmasked. For more information on the format of the netmap file, see the documentation for the netmap utility.

If it doesn't locate a matching entry in the /etc/config/netmap file and if neither -a nor -A was specified, netboot will ignore this boot request and go back to waiting for another one. However, if -a or -A was specified, netboot will assign a logical node ID to the requesting node and append an entry for it to the end of the netmap file. It will then proceed to the next step of looking up how to boot that node.

Servicing the boot request

Once netboot has found out the logical node ID of the requesting node, it uses that ID in combination with the logical network ID that the request came in on to look up in the /etc/config/netboot bootfile for information on how the boot request should be serviced.

The netboot file contains lines of the form:

log_node_ID [log_net_ID] [c=build_command] f=file|F=file [server_ID]

Each field is separated by white space consisting of space or tab characters. At least one white space character must separate each field. Any line starting with a # character is treated as a comment and ignored.


Note: Don't put any comments on the same line as an entry. For example, don't do this:
8	f=build/node.8  #Node 8 has a UPS

Comments must reside on their own line, like this:

#Node 8 has a UPS
8	f=build/node.8

The fields are as follows:

log_node_ID
The logical node ID, or *, meaning "any node." Entries containing * should generally be placed after entries that contain more specific information, since netboot will stop scanning once it obtains a valid match.
log_net_ID
The network the boot request came from, or *, meaning "any network." If this field is absent, "any network" is assumed.
c=build_command
The command to be used to build the OS image. Default: buildqnx
f|F=file
The image file or build file to be used to generate the OS required to service the boot request. This field is used by netboot only if the log_node_ID, log_net_ID, and server_ID fields have matched the incoming boot request.

This field has two forms:

      F=imagefile
    

This form specifies that the named OS image be transmitted to the booting node. The imagefile must name the path to an OS image that has been built previously (usually via the buildqnx utility). If a relative pathname (one not starting with /) is used, it's assumed to be relative to the /boot directory. For example, F=images/ws.arcnet is equivalent to F=/boot/images/ws.arcnet.

      f=buildfile [b=address]
    

This form instructs netboot to invoke buildqnx (or the program specified by the c=build_command field) on the fly to build an OS image. This image is then piped back into netboot and shipped as an image over the network. The specified buildfile is used by buildqnx to construct the image. As with the above F= form, relative pathnames for the buildfile are assumed to be relative to the /boot directory. (Note that f=buildfile is the preferred form.)

You can include a [b=address] after the f=buildfile to specify a load address for the OS image being constructed. If a b= is present, it will override (for this node only) the default address or the one specified by the -b command-line option to netboot. As with the -b command-line option, the address is always specified in hex, must be greater than or equal to 0x1000, and must be a multiple of 0x1000.

Generally, you should use f=buildfile instead of F=imagefile, since you save considerable disk space by not keeping prebuilt OS images on disk. Nevertheless, you may sometimes wish to freeze a particular image to keep it immune from subsequent OS module updates. For example, if you build images on the fly (f=) and obtain an updated version of Proc, the new Proc will become part of that network-booted OS image the next time the node is booted. However, if you built the image beforehand and used F=imagefile, the new Proc would not form part of the network-booted OS image until you run buildqnx to create a new imagefile on disk.

Since QNX is a modular OS, you don't need to build into the transmitted image all the modules you may require. Once the operating system loads, you can start many subsequent modules from the command line, or more typically, from the sysinit.node file. For more information on this method, see the buildqnx and sinit utilities.

server_ID
This field, which is optional, pertains only to broadcast boot requests, i.e. the style of boot request in which the booting node broadcasts a request to all nodes on a network. The field is ignored if the boot request isn't a broadcast type. (QNX's Ethernet boot ROM uses the broadcast method; the Corman Arcnet boot ROM doesn't.)

Broadcast boot requests are similar to saying, "Will my boot server A boot me, please?" Every netboot process running on the network will get the broadcast boot request. It's up to each boot server to look in its own /etc/config/netboot bootfile to determine what its relationship to the booting node is. Based on this relationship, the boot request will be either serviced or ignored. That is, each boot server must check its bootfile to discover what server it is to be for the requesting node (i.e. server A, B, or C) and whether this is the server that the actual boot request is asking for. If it's a match, the request is serviced. Otherwise, the request is ignored.

If netboot is being run on multiple nodes, each netboot must have its own bootfile tailored to uniquely identify it as each node's primary, secondary, or tertiary boot server. This is required because of the way servers respond to the broadcast boot requests. If it isn't done, the multiple netboot servers on the network will respond simultaneously to the broadcast boot request.

The server_ID field must be a single alphabetic character. Typically, network boot ROMs that broadcast boot requests ask only for A, B, or C (primary, secondary, tertiary). The field isn't case-sensitive: upper- and lowercase both mean the same thing.

For the purposes of serving broadcast boot requests, having no server_ID field is treated the same as having a server_ID field specifying A (i.e. netboot will regard itself as being that node's primary boot server, by default).

Example netboot file

Let's say you have two networks connected to node 1: logical network 1 (Arcnet) and logical network 2 (Ethernet).

The following are the contents of a /etc/config/netboot file that could be used by netboot on node 1:

NID LAN Bootfile "I am server..."
2 f=build/ws.arcnet
3 1 f=build/ws.arcnet
3 2 f=build/ws.ether B
* 1 f=build/ws.arcnet
* 2 f=build/ws.ether C

The entry for logical node 2 is simple: boot node 2 regardless of which logical network the request came in on; use the build file ws.arcnet.

For node 3, a boot request may arrive via logical network 1 or via logical network 2. If the boot request for node 3 comes via logical network 1, then node 3 will be booted with the build file ws.arcnet. If the boot request for node 3 comes via network 2, netboot will respond to the request only if node 3 asks for its secondary (B) boot server. (We're assuming that another node is the primary boot server for nodes booting by Ethernet.) The ws.ether buildfile would be used in this case.

Any other nodes booting via network 1 will boot using the buildfile ws.arcnet. Any nodes that request to be booted from their tertiary (C) boot server on logical network 2 will boot using the build file ws.ether.

Examples:

Run in verbose mode on the unused console /dev/con8:

    ontty /dev/con8 netboot -v &

Assign node IDs automatically:

    netboot -A &

Caveats:

As new network drivers become available for QNX, new versions of the netboot utility will be released that know about the new drivers and their boot packet protocols. When netboot starts, it will write a warning message to standard error if it doesn't support one of the network drivers you're running. A list of supported network types (e.g. Arcnet, Ethernet) is maintained in the usage message (use netboot).

See also:

buildqnx, Net, netmap


[Previous] [Contents] [Next]