MKNBI-LINUX(8)
π mknbi-linux β MaKe NetBoot Image for Linux
okay so bestie, welcome to the mknbi-linux(8) page β yes it's section 8, System Manager's Manual, very official, very demure. This is the tool that takes your Linux kernel and turns it into something your diskless babies can actually boot. Buckle up π
β¨ SYNOPSIS β¨
mknbi-linux [OPTIONS] [<kernel image> [<output file>]]
that's it. that's the whole vibe. options go in, kernel goes in, output file goes out. slay π
πΈ DESCRIPTION πΈ
so mknbi-linux is literally the program that converts a Linux kernel image into a file which is directly loadable by diskless systems using a bootrom that's compliant with the netboot specification. that's the whole job. it eats kernels and spits out netbootable images. iconic behavior, honestly π¦
π OPTIONS π
okay this is the long part, stay with me, we're getting through all of them together fr fr π«Ά
-a,--appendSTRING β string to append to the end of the kernel command line. so by default the kernel command line starts withauto rw, which tells the kernel to automatically check and mount all file systems and to mount the root file system read-write. but bestie, if you want your root file system mounted read-only, use the wordrowith the-aoption instead ofrw. likewise, if you want to remove the wordautofrom the command line, usenoautowith the-aoption. and yes, you can also drop any other command line options here that the kernel needs. go off π-b,--batch-sysSYSTEM β putsmknbi-linuxinto batch mode. it looks up the given system name in a database file and generates a netbootable image according to the parameters specified in that database entry. if this option is not given,mknbi-linuxoperates according to the other command line options instead. and heads up: if you give any other options in addition to-bor--batch-sys, the parameters found in the database override those processed from the command line. database said what it said π-C,--config-fileFILE β specifies the pathname of the configuration file. if you don't pass this option, the value of theNETBOOT_CONFIGenvironment variable gets used, or a compiled-in default. no cap π§-d,--root-dirSTRING β defines the name of a directory to mount via NFS on the boot server. STRING can have the following values, and each one is a whole mood:romβ that directory is used as root in which the loaded netboot image file is located. this is determined by the bootrom at run time, usually by using BOOTP or DHCP. and if the boot server is able to handle RFC 1497 extensions, it's possible to define a different root directory than the one where the image file is located. flexible, we love to see it β¨kernelβ the root directory is the one used by the loaded kernel as its compiled-in default. simple, no drama.ram[0-9]β tells the kernel to use a ramdisk for booting. no NFS directory will be mounted in that case. if a number is given, that numbered ram disk will be used for the root directory. otherwise, if no number is given, the initial ram disk of the kernel is used. numbered ramdisks are so main character π₯initrdβ this uses the initial ramdisk as the root directory, so it's therefore the same asram0. however (and this is the important part), with the initrd root device specification the boot loader will not pass any IP autoconfiguration option to the kernel, and the initial ramdisk has to set up the network interface itself if necessary. also the kernel command line will be built so that/linuxrcwill be started by the kernel as the first process β see the initrd documentation for further info iykyk π<directory name>β compiles the directory name directly into the boot image. it will be used by the kernel for its root directory, and there is no way later on to change it at run time. π this is the default when this option isn't given, and the default directory name is/tftpboot/%s, with the%srepresenting the IP address of the booting system. and hey β if the directory name starts with/dev/, that named device is used as the root device, and no NFS directory will be mounted. periodt.
-D,--databaseFILE|DBSPEC β pathname of the database file (or database specification) to be used together with the-bor--batch-sysoptions. if this option isn't given, the value of theNETBOOT_DATABASEenvironment variable or a compiled-in default will be used. check thenetboot(5)man page for a further explanation of the different ways to specify a database π¦-F,--logfileβ name of the log file to write debugging output to. the default is to print all verbose output tostdout. very "we're doing it live" of it π-h,--helpβ prints short usage information. the classic. the icon. when in doubt,-hit out π-H,--home-dirβ specifies the home directory. if this command line option isn't given, either thehomedirconfiguration file parameter or the current user's home directory will be used. home sweet home π-i,--ip-addrsSTRING β defines client and server IP addresses. STRING can have the following values:romβ all necessary IP addresses for NFS root mounting will be determined at run time using the BOOTP or DHCP answer the bootrom received from the server. this is the preferred value when usingmknbi-linuxtogether with a netboot bootrom. bestie this is the good one βkernelβ no IP addresses are defined, and the kernel should determine them by itself, usually by using RARP, BOOTP or DHCP. letting the kernel handle it, bold of you, respect π<client:server:gateway:netmask:hostname[:dev[:proto]]>β define the necessary boot addresses during compilation of the boot image. all addresses must be separated by a colon.mknbi-linuxwill automatically convert system names into decimal IP addresses for the first four entries in this string. the hostname entry will be used by the kernel to set the host name of the booted Linux diskless client and shouldn't contain any domain name part. when more than one network interface is installed in the diskless client, it's possible to specify the name of the interface to use for mounting the root directory via NFS by giving the optionaldevvalue. this entry has to start with the stringethfollowed by a number from 0 to 9. however, if only one interface is installed in the client, thisdeventry (including the preceding colon) can be left out, or remain empty. theprotoentry is only usable with kernel version 2.2.x or newer and can be used to specify the protocol with which the kernel should detect any missing addresses. it can have one of the following values:off,none,on,any,dhcp,bootp,rarporboth. that's a lot of colons but you got this π«Ά
-k,--kernelFILE β pathname of the kernel image file. the default is/vmlinuz. your classic, your default, your girl π-l,--ramdisk-modeβ okay so the startup code that gets included with the netboot image can usually take care of moving the ramdisk image to a valid location in memory. but depending on the version of your BIOS, the kind of bootrom you use, and the fact that you might have more than 16MB of memory, there could be difficulties. π in that case, you'll have to provide further information:autoβ this is the default behavior. the bootrom will load the ramdisk image right behind the kernel image. the startup code will then try to determine the last legal address in the lower 16MB and subsequently move the ramdisk image there. this technique works in most cases and provides the highest degree of compatibility and portability among different machines. the reliable friend of the group β¨eomβ ifautodoesn't work for you, you should check if your bootrom is capable of loading the ramdisk image to the end of the physical memory. this might work fine, but it's slightly less compatible thanauto. proceed with awareness π<address>β if everything else fails, you can resort to explicitly specifying the load address. although, beware: this is likely to cause problems when trying to use the same image on machines with different amounts of memory. you should try to specify an address that is both below 16MB and below the physical end of memory β and you'll have to leave enough room for the entire (compressed) ramdisk image. if you move the image too low, it will collide with the uncompressed kernel image and the kernel will ignore the contents of the ramdisk; you'll notice a warning message when booting. if you have at least 16MB of main memory, you should try to load the image to0xD30000, since this leaves enough room for an uncompressed 2.88MB ramdisk image but is unlikely to conflict with the uncompressed kernel image. if you want to see whether there's a conflict between the ramdisk image and other parts of the compiled netboot image, you can increase the verbosity level until detailed load record information is printed. detective mode π
ngl this one is giving "please read the numbers twice" energy. 0xD30000, 16MB, 2.88MB. don't come for me, that's what the page says π
-m,--vga-modeMODE β specifies the mode into which to set the graphics card when the Linux kernel starts. MODE can be any of these values:normalβ use normal VGA mode, which is what the BIOS has selected when the bootrom started.extendedβ switch to a larger screen size. bigger screen, bigger vibes π¦askβ ask the user which mode to use when the Linux kernel starts. the user gets presented with a menu of possible video modes. very "you decide, bestie" of it πdefaultβ use the VGA mode value defined in the Linux kernel and don't allowmknbi-linuxto change it. this is the default behaviour if the--vga-modeoption is missing. leave it alone, it knows what it's doing.<number>β directly specify the video mode. raw. unhinged. iconic. π₯
-N,--datadirDIR β pathname of the shared-data directory. if this option isn't given, the value of theNETBOOT_DATAenvironment variable or a compiled-in default will be used πΈ-L,--libdirDIR β pathname of the non-shared-data directory. if this option isn't given, the value of theNETBOOT_LIBenvironment variable or a compiled-in default will be used. note the difference from-N, they're siblings not twins π-o,--outfileFILE β pathname of the output file, which is later on loaded by the bootrom via TFTP. this is your product, your masterpiece, your little creation π-r,--ramdisk-imageFILE β preloaded ramdisk image. for further information, look intolinux/Documentation/initrd.txtin the Linux source tree. this requires Linux version 1.3.73 or above. yes i said the number out loud, it's old, we respect the elders π«Ά
-S,--save-sysSYSTEM β okay so this one saves your netboot image parameters into the systems database under the name SYSTEM π«Ά. After that, you donβt have to retype all the command line arguments tomknbi-linuxagain β just use the-bor--batch-sysoption to generate a new netboot image. Iconic lazy-girl win π .-v,--versionβ prints version information, periodt β¨.-x,--verboseβ verbose output so you actually know whatmknbi-linuxis doing π. Each-xincreases the verbosity level β stack βem if youβre nosy.
β¨ BOOTP VENDOR TAGS β¨
mknbi-linux includes a startup code at the beginning of the Linux kernel which is able to detect certain BOOTP or DHCP vendor defined tags. These can be used to modify the kernel loading process at runtime.
To use these tags with bootpd, a publicly available BOOTP server daemon, you can use the following syntax in the /etc/bootptab file:
T<number>="<string>"
For example, to specify a different root NFS device, you can use:
T130="eth1"
The following tags are presently supported by mknbi-linux:
129β the<string>value given with this tag is appended verbatim to the end of the kernel command line. It can be used to specify arguments like I/O addresses or DMA channels required for special hardware like SCSI adapters, network cards etc. Please consult the Linux kernel documentation about the syntax required by those options. It is the same as the-aor--appendcommand line option tomknbi-linux, but works at runtime instead of compile time. β‘130β with this tag it is possible to select the network adapter used for mounting root via NFS on a multihomed diskless client. The syntax for the<string>value is the same as for the dev entry used with the-ioption as described above. However note that themknbi-linuxruntime loader does not check the syntax of the string. π¦
ποΈ DATABASE FILE ποΈ
mknbi-linux does not use any sections in the configuration file except the [general] section. However, for easier maintenance of different client configurations the database file can be used. The entries have to be preceded by a [mknbi-linux:<system name>] tag and can contain the following parameters:
outfileβ specifies the name of the output file.ramdisk-imageβ specifies the name of the ramdisk image file or directory.ramdisk-modeβ specifies the mode of the ramdisk like the-lor--ramdisk-modecommand line options.vga-modeβ specifies the mode to set the graphics card into when starting the Linux kernel like the-mor--vga-modecommand line options.appendβ adds a string verbatim at the end of the Linux kernel command line.root-dirβ specifies the name of the client root directory like the-dor--root-dircommand line options.ip-addrsβ specifies the Linux kernel IP address option like the-ior--ip-addrscommand line options.debugβ Boolean value which specifies if the debugging version of the kernel loader should be used on the client or not.
π± ENVIRONMENT VARIABLES π±
See the netboot(5) man page for a description of all environment variables used by mknbi-linux. π
π BUGS π
None known yet πβ¨.
π«Ά SEE ALSO π«Ά
π AUTHOR π
mknbi-linux was written by Gero Kuhlmann <gero@gkminix.han.de>. Support for preloaded ramdisks and loading into extended memory has been added by Markus Gutschke <gutschk@uni-muenster.de>. π
okay bestie, thatβs the whole tea β β this page is MKNBI-LINUX(8), dated 25 Jul 2002 ππ
. Catch you in the next man page! π«Άβ¨
π¦ where this page comes from
- nixos 26.05: netboot 0.10.2
- nixpkgs unstable: netboot 0.10.2
- Copyright (C) 1995-2007 Gero Kuhlmann <gero@gkminix.han.de>
- Copyright (C) 1996,1997 Gero Kuhlmann <gero@gkminix.han.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms