netboot(5)

๐Ÿ“ฆ
version 0.10.2 ยท 2 versions
, in nixos 26.05

okay so bestie, this is netboot(5) from the File Formats Manual โ€” the page for the netboot package, aka the thing that gives you programs to generate bootroms and load image files using an IP network so an x86-based system can boot. ๐Ÿ’…โœจ

๐Ÿ’… PROGRAMS ๐Ÿ’…

The netboot package contains these programs to generate bootroms and load image files using an IP network in order to boot a x86-based system:

  • makerom โ€” generates a bootrom from various binary files. It can use many types of network drivers like standard DOS packet and NDIS driver binaries. ๐Ÿ› ๏ธ
  • mknbi-linux โ€” generates a netbootable image to load the Linux operating system. ๐Ÿง
  • mknbi-dos โ€” generates a netbootable image to load a DOS-like operating system, like MS-DOSยฎ or OpenDOSยฎ. ๐Ÿ’พ
  • mknbi-mgl โ€” generates a netbootable image from a program written in the Pascal-like Menu Generation Language (MGL). With this program it is easily possible to write a custom boot menu. ๐ŸŽ€

See the corresponding man page for a further explanation about any of the above mentioned programs.

๐Ÿ“ FILES ๐Ÿ“

okay, hereโ€™s the file roster, and every path is literally sacred โ€” copy them exactly, no cap:

  • /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/etc/netboot.config โ€” main netboot configuration file.
  • /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/lib/netboot/config.local โ€” local additions to the configuration file. While the master configuration file gets overwritten by installing a new netboot version, the config.local file never gets modified by the installation process.
  • /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/lib/netboot/netboot.db โ€” systems database file.
  • /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/share/netboot/netboot.drivers โ€” network driver information database. This is a text file which contains the descriptions of individual network drivers. It gets replaced without asking everytime a new netboot version gets installed.
  • /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/lib/netboot/drivers.local โ€” local additions to the network driver information database file. This file never gets modified by the installation process.

These files control the operation of the various programs which are part of the netboot project. While the configuration file contains general definitions for the programs, the systems database contains specifications for client systems. Using this approach, it is for example possible to give a system name on the command line of mknbi-linux and then automatically have the boot image file created with the correct Linux kernel and NFS root parameters. This makes it easier to maintain a large base of diskless clients with different configurations.

The network driver information database contains specifications needed to find and use certain pre-known network drivers like packet or NDIS drivers.

All configuration files have a common format. Each file is divided into sections. Each section has to be preceded by a section name enclosed in square brackets, and reaches until the next section name or the end of the file. There are no blanks allowed between the square brackets and the section name. The name itself can contain any alphanumeric character, and may be split into different parts, which are seperated by colons. For example, that section in the main configuration file which is used by makerom and contains its general definitions is named [makerom:general].

Each section contains a number of definitions, which start with a parameter name, followed by an equal sign and the parameter value. Depending on the type of parameter, the value can either be a string, a number, a boolean value or an enumeration value. In case of a number, the usual C conventions apply. For example, prepending the number with 0x identifies it as a hex number. Boolean parameters can either have a value of false or true. Enumeration parameters can have a value out of a list of allowed strings. In case of a string value, leading (between the equal sign and the first string character) and trailing (following the last string character) blanks are ignored. Blanks enclosed by some other string characters are copied into the string unmodified. If leading and/or trailing spaces, carriage-returns or # characters are required in a string argument, the whole string can be enclosed in double quotes. Also, if the string can be interpreted as some other type (like an integer number or a boolean value) it has to be enclosed in double quotes.

If a string value names a directory or file, it is possible to make these paths relative to either the non-shared-data directory /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/lib/netboot or the shared-data directory /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/share/netboot by prepending the string with two slashes. All netboot programs then search for the corresponding file or directory in both paths. For example, specifying //utils gets expanded to /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/lib/netboot/utils and /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/share/netboot/utils when the configuration file is read.

Also, many directory parameters can specify more than one directory. All directories in such a specification have to be seperated by colons within the string, and are searched in turn for the required file. For example, specifying //utils://binaries as a directory name will let a program search the directories below for a required file, in this order:

  1. /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/lib/netboot/utils
  2. /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/share/netboot/utils
  3. /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/lib/netboot/binaries
  4. /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/share/netboot/binaries

This is somewhat similar to specifying the PATH variable in the shell.

Everything including and following a # character up to the end of the line is ignored as a comment. Empty lines are also ignored, as well as leading and trailing blanks on a line. Therefore, tag names and parameter definitions can start anywhere on a line. Between the parameter name, the equal sign and the parameter value any number of spaces may be placed. Parsing of all configuration files is case significant. Especially, the boolean and enumeration values as well as parameter names have to be all lower case.

All configuration files can make use of meta-commands, which modify parsing their contents. Text file meta-commands always start with a dollar sign, and have to be placed on a line by their own. They can appear anywhere in the text. The following meta-commands are implemented:

  • $if [not] <condition> โ€” the $if meta-command allows processing of the following text according to certain conditions. If the condition is met, the text following the $if meta-command is processed until reaching a corresponding $else or $endif meta-command. If the word not is inserted in front of the condition code, the condition is inverted, e.g. the following text is processed if the condition is not met. These condition codes have been implemented:
    • exists <filename> โ€” the condition is met if the file <filename> exists and is readable. Normal preprocessing of the file name is used (e.g. substitution of two starting slashes as described above).
    • defined <variable> โ€” the condition is met if the variable named <variable> is defined. See the $set meta-command about setting a variable.
    • equal [<string>|<variable>] , [<string>|<variable>] โ€” the condition is met if both strings or variable contents are equal. Strings have to be enclosed in double-quotes.
Up to 16 levels of $if meta-commands can be nested into each other.
  • $else โ€” this meta-command starts the else-branch of a $if meta-command. This means that the text following the $else is parsed if the corresponding $if condition is not met.
  • $endif โ€” this meta-command ends the $if processing.
  • $include <filename> โ€” the $include meta-command includes another file into the currently processed text file. Processing of the included file starts right at the position of the $include meta-command. Normal pre-processing of the file name (like double-slash substitutions) is done.
  • $set <variable> <string> โ€” this meta-command sets a variable named <variable> to the value of the string <string>. Certain variables are already predefined: VERSION, PACKAGE, DEBUG, HAVE_BDB, HAVE_ODBC and HAVE_LDAP. Also, all environment variables are considered as predefined, so you can use any environment variable by just naming it in the configuration file.

Variables are a means of modifying the contents of a file based on certain runtime states. In order to use a variable value somewhere in the text file, specify its name enclosed into percent signs. For example, specifying %HOME% replaces this whole string with the value of the variable named HOME. Unless this variable has been set previously by using a $set meta-command, its value is looked up in the current environment (which then corresponds to the current user's home directory name in this example).

With these meta-commands it is possible to write rather elaborative configuration files. However note that using meta-commands in database files (like the systems database file or the network driver definition file) is not recommended, unless those files are marked read-only. This is because when the contents of a database file gets modified by some netboot program, it writes the whole database contents back into the text file without the meta-commands. They get lost in this case. See below for a further explanation of databases.

The following sections contain some general comments on each configuration file. Configuration sections which are relevant to certain programs of the netboot package will be explained in greater detail in the man page of that program.

๐Ÿ’– CONFIGURATION FILE ๐Ÿ’–

okay so the main configuration file is the one everybody reads. every netboot program reads it. if you don't name a config file on the command line of a netboot program and you don't set the NETBOOT_CONFIG environment variable, it just goes with the default:

/nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/etc/netboot.config

each program has its own lil section in there named [<progname>:general]. and then there's the [general] section, which is the shared one every single program uses. it can hold these parameters, bestie:

  • datadir โ€” tells netboot where all the shared files it needs actually live. super important detail: if a directory or file name in any of the config files starts with two leading slashes, that prefix gets swapped out for the value of this parameter. no datadir given? default is /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/share/netboot. every netboot program lets you override it with -N or --datadir. and if neither the config file nor the command line says anything, netboot checks the NETBOOT_DATA environment variable before it falls back to the default. layered queen behavior ๐Ÿ’…
  • libdir โ€” basically datadir's sibling, except it points at the non-shared-data directory. default if you don't set it: /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/lib/netboot. you can also set the name of that non-shared-data directory with the -L or --libdir command line options, or with the NETBOOT_LIB environment variable. so many doors, same room โœจ
  • homedir โ€” this is the directory used to look up file names that aren't absolute and aren't relative to some other special directory. like, non-absolute database file names get looked up relative to homedir, iykyk. wanna override the config file on this one? hit it with -H or --home-dir. if no home directory value is specified anywhere, netboot uses the current user's home directory as given by the HOME environment variable or the /etc/passwd file. note: the home directory has to be writable, and if it doesn't exist, it gets created. it's giving "make yourself at home" fr fr ๐Ÿ 
  • tempdir โ€” the directory where all the temporary files get stored. it has to exist and it has to be writable, no exceptions. there is no command line option to override this config parameter, and the default is system dependent. periodt.
  • sysdb โ€” names the database file used when a program is operating in batch mode, a.k.a. when you pass -b or --batch-sys on the command line. its default value is the contents of the NETBOOT_DATABASE environment variable, or //netboot.db if that environment variable isn't defined. plot twist: sysdb can also specify any number of predefined database specifications instead of just a plain file name. see below for how to write a database specification ๐Ÿ‘‘

the parameters you can put in any other section of the config file are documented in the man pages of the netboot programs they belong to, so go read those, bestie.

also! the standard config file that ships with the netboot package includes $HOME/.netboot/config at its very end. and it defines $HOME/.netboot as the home directory for every user. cute, consistent, iconic ๐ŸŽ€


๐Ÿฆ‹ DATABASES ๐Ÿฆ‹

two databases exist in netboot land:

  1. the systems database โ€” used by all programs
  2. the network driver information database โ€” used only by makerom

and yes you can specify more than one database for each purpose. all database specifications are separated by a colon character, and they get searched in the order they appear. so for example, this line in the main configuration file says "use two databases for the sysdb parameter":

sysdb = db@systemsfile[ro,opt]:db@usersysfile[add,opt]

every database name is preceded by a db@ string, which means that name refers to a separate database specification in the config file. if the db@ prefix is missing, the database name is assumed to be the name of a text database file. after the database name, in square brackets, you can put options. these are the recognized ones:

  • ro โ€” open the database read-only, no matter what mode the individual database specification defines. hands off ๐Ÿšซ
  • add โ€” use this database for adding new records. when a new record gets added to a list of databases, the last database that has the add option is the one used for writing. add can only be used on databases that aren't marked read-only. go write your lil heart out โœ๏ธ
  • opt โ€” when reading records, a database with the opt option is skipped if it doesn't exist. if opt is not specified, the database has to exist, and if it doesn't, you get an error printed. no chill, just facts.

these options work on a db@ database specification or on a text file name. flexible icon ๐Ÿ’…

so here's the thing about accessing a database with the db@ prefix โ€” it has to be specified separately in the main configuration file. to do that, you write a section literally named [db:<dbname>] into the config file. like, to define a database named systemsfile, the section should be named [db:systemsfile]. inside that section you describe the database more closely. the following parameters work there:

  • dbtype โ€” what kind of database is this? allowed values are:
    • text file โ€” the database is made up of a text file with the same structure and syntax as the standard configuration file mentioned above. classic.
    • berkeley db โ€” the database is accessed using the Berkeley DB library. binary file-based database, fancy.
    • sql โ€” the database is based on an SQL server using the ODBC interface.
    • ldap โ€” the Lightweight Directory Access Protocol (LDAP) is used to access the database.

text-file databases are always supported, but support for any of the other types depends on whether the required runtime libraries were available at compile time. wanna find out which database types a particular netboot program supports? run it with the --version command line option. vibe check via version flag ๐Ÿ”

  • dbmode โ€” says whether writing into a database is allowed. the only allowed values are read-write and read-only. that's it, those are the two.
  • filename โ€” the name of the database file, for text and Berkeley DB databases.
  • lockfile โ€” the name of the lock file used for a text database. a lock file only has to be specified for a database with mode read-write. for a read-only database it's ignored entirely. ๐Ÿซถ
  • table โ€” names the table used within a SQL database to look up and store netboot parameters.
  • database โ€” when specifying a SQL database, this names the ODBC data source name (DSN) used for the database access.
  • server โ€” the name of the LDAP server. obviously this one is only valid in an LDAP database specification. duh ๐Ÿ’€
  • basedn โ€” the base DN value used when accessing the LDAP server.
  • username โ€” the user name used for authenticating access to a SQL or LDAP database.
  • password โ€” the password required for the user name mentioned in the username parameter. keep it secret, keep it safe ๐Ÿ™ˆ

when reading a certain record, all the databases get searched in the order they appear in the database specification. and if a record name shows up more than once in any of the databases that make up a database specification, every record overwrites the parameter values defined by the previous record with the same name. last one wins, no cap ๐Ÿ‘‘

the standard configuration file that ships with the netboot package defines 6 databases:

  • systemsfile โ€” a text-based systems database file in the netboot non-shared data directory named netboot.db. marked as read-only.
  • usersysfile โ€” a text-based systems database file in the user's home directory. the file name is $HOME/.netboot/systems.text. marked read-write.
  • usersysdb โ€” a Berkeley DB based systems database file in the user's home directory. its file name is $HOME/.netboot/systems.bdb. marked read-write.
  • netdrvfile โ€” a text-based network driver definition database in the netboot non-shared-data directory named netboot.drivers. marked read-only.
  • userdrvfile โ€” a text-based network driver definition database file in the user's home directory. it's named $HOME/.netboot/drivers.text and it's marked read-write.
  • userdrvdb โ€” a Berkeley DB based network driver definition database file in the user's home directory. the file name is $HOME/.netboot/drivers.bdb. marked read-write.

six whole databases, all living their best lives ๐ŸŒˆ

๐Ÿ’พ SYSTEMS DATABASE ๐Ÿ’พ

Okay bestie, so the systems database is where all the diskless-client definitions live for the netboot programs. Every section โ€” or record, if you're in a non-text database โ€” defines the params for one client and one program. No cap.

Record names are built like this: program name, then a colon, then the name of the diskless client. Example: [mknbi-dos:testclient] is the section mknbi-dos uses to generate a boot image file for system testclient. Iconic.

The client name can also have several colon-separated parts to specify different configurations for the same operating system. Using the example above, [mknbi-dos:testclient:msdos] could be used to specify an MS-DOSยฎ setup, while [mknbi-dos:testclient:opendos] might be used for an OpenDOSยฎ environment. Slay.

To use a record in the systems database you have to give either the -b or --batch-sys command line option to the corresponding program. The argument to these options specifies the client's system name. When you use different configurations for the same system, you have to give the full name including the colon and the configuration name. With the example above it would be necessary to use --batch-sys=testclient:opendos on the command line to mknbi-dos to use the [mknbi-dos:testclient:opendos] record. Periodt.

Each netboot program's own man page spills the tea on its parameters. When using a system definition from the systems database, all parameters specified in the database entry always override any command line options. Therefore, you should not use any other command line option besides -b or --batch-sys.

๐Ÿšจ Bestie warning: the database entry params are main character energy here โ€” they override your command line options every time. So don't pile on extra flags, okay?

The default name for the database file is /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/lib/netboot/netboot.db. You can specify a different name by either using the sysdb parameter in the general section of the main configuration file, or by using the command line options -D or --database-file. If none of these has been specified, the value of the NETBOOT_DATABASE environment variable will be looked up before using the default. Iykyk.

๐Ÿงš NETWORK DRIVER INFORMATION DATABASE ๐Ÿงš

The network driver information database is only used by the makerom program. Its structure is therefore explained in the makerom man page. The default name of this database file is /nix/store/bh9zrij5f8gc9m2p8902lxbw0y2s3r4v-netboot-0.10.2/lib/netboot/netboot.drivers. It can be changed by using the -d or --drivers command line options to makerom. Alternatively, it can also be specified in the main configuration file with the driverdb parameter within the [makerom:general] section. Cute.

๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

These environment variables are used by all netboot programs:

  • NETBOOT_CONFIG โ€” specifies the name of the configuration file. This environment variable setting can be overridden by the -c or --config-file command line options.
  • NETBOOT_DATA โ€” specifies the main netboot shared-data directory. This environment variable setting can be overridden by the -N or --datadir command line options.
  • NETBOOT_LIB โ€” specifies the netboot non-shared-data directory. This environment variable setting can be overridden by the -L or --libdir command line options.
  • NETBOOT_DATABASE โ€” specifies the name of the systems database to be used with the -b or --batch-sys command line options. This environment variable setting can be overridden by the -D or --database-file command line options.

Only the NETBOOT_CONFIG environment variable gets read independently of the configuration file. All other environment variables are used in the main configuration file, and modify parsing it. For example, setting NETBOOT_LIB modifies the value of the libdir parameter in the [general] section of the configuration file. Wild, but true.

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

๐Ÿ’… AUTHOR ๐Ÿ’…

The netboot package was written by Gero Kuhlmann <gero@gkminix.han.de> with some parts written by other authors, who are mentioned in the man pages of those programs which they helped writing. Respect the icons.


xoxo, this was netboot(5) from netboot 0.10.2, dated 07 Dec 2004 ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from
  • nixos 26.05: netboot 0.10.2
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms