


                       D E F I N I N G   M E N U S



Since version 0.7 netboot supports a Menu Generation Language called MGL, which
is a Pascal like language. It provides an easy way for creating customizable
menus for the netboot process. You have to write a simple MGL program which
will then be compiled by mknbi-mgl into a directly loadable and executable
network boot image file. It can then be loaded by the bootrom via TFTP like
any normal boot image, but allows booting different other image files depen-
ding on the MGL program itself. The older method of using BOOTP/DHCP tags
to define a boot menu has been discontinued since netboot version 0.10 and
is no longer available.




Defining a menu with MGL:
========================


Using a menu means booting different operating systems, selected by the
user at runtime. This means that you first have to provide all those
boot image files, which you want to boot lateron. To do this, you have
to use the mknbi-<os> programs. See the general INSTALL file and especially
the corresponding man pages for further information about how to do this.
I recommend to name all boot image files as bootImage-<os> and keep them
all together in one directory for each client system. Now read the mknbi-mgl
man page which explains the definition of MGL to some detail. If you are
familiar to the Pascal programming language be careful as MGL is only
_similar_ to Pascal, not identical! However, since reading a language
definition is not very entertaining, and you probably won't understand
it the first time you read it, I recommend to use some sample program.
For this change into the directory mknbi-mgl/tests in the netboot distri-
bution and read the file menu.mgl in parallel with the man page. You will
then understand the MGL definition more easily. Then you should copy the
menu.mgl file to some other directory (best would be to use the directory
where you also keep your boot image files) and modify it according to your
local setup with a normal text editor. Especially you want to adjust the
paths to the different operating system boot image files, and also change
the device names for the local partitions in case you also want to offer
to boot from a local hard disk. If your client doesn't have any hard disk
installed, you should remove the corresponding lines in menu.mgl. When you
are finished editing, compile the file with

	mknbi-mgl -i menu.mgl -o bootImage-menu

which will create a boot image file named bootImage-menu. If mknbi-mgl
finds any program errors, it will print the line numbers where it detected
the errors. You will then have to reedit the source file and run mknbi-mgl
again. When your menu program compiled without an error, change the 'bf'
tag for the diskless client in your /etc/booptab to point to this new boot
image file. If you have bootpd permanently running on your server, send
it the HUP signal and reboot your client. It will now load the bootImage-menu
file and you should see the output of your menu program.


