boot.cfg example file.

1) in order for boot menu to work, "bootmenu" needs to be specified in cmdline.txt as parameter
2) as soon as kernel finishes loading, bootmenu searches all attached disks / usb keys / available partitions for file named boot.cfg
3) if is found, file is checked for all four configuretion statements: a) name b) kernel c) initramfs d) append
4) meaning of name is clear, is string which is going to be displayed in bootmenu along with $DEVNAME where it was found
5) kernel and initramfs parameters are filenames of kernel and initramfs which are going to be used for booting from this partition
6) append ="" is kernel's command line, usually the same as the primary inside cmdline.txt inside /boot partition. BUT root= parameter needs to
be taken out. this will be passed dynamically by boot menu.

kernel and initrd are filenames including full path which is relative to that particular partition. let's have an example:

We have an usb key with ext4 partition with working rootfs of RPI compatible linux distribution. We decide to be able to boot from it with
boot menu. We need to copy kernel.img and initramfs.gx to it (own, customized, or even the same from /boot partition on sdcard).
We create directory /bootmenu on that partition and copy the two files to it. Then in the root of the filesystem we create file boot.cfg as follows:

"
name=My_Linux_Partition
kernel=/bootmenu/kernel.img
initrd=/bootmenu/initramfs.gz
append=" what ever we are using, but don't put root= and boot menu parameters there anymore"
"

then we just connect the usb key into USB port of RPI and can reboot.