DEVICE=/dev/sdb
VOLUME=MultiBootUSB
# create filesystem on usb pen
sudo mkfs.vfat -n ${VOLUME} ${DEVICE}1
# mount usb
mount ${DEVICE}1 /mnt/
# install grub2 on usb pen
grub-install --no-floppy --root-directory=/mnt ${DEVICE}
# create grub config
cat < /mnt/boot/grub/grub.cfg
menuentry "Ubuntu Live 11.04 64bit" {
loopback loop /boot/iso/ubuntu-11.04-desktop-amd64.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/ubuntu-11.04-desktop-amd64.iso noeject noprompt --
initrd (loop)/casper/initrd.lz
}
menuentry "Ubuntu Live 9.10 32bit" {
loopback loop /boot/iso/ubuntu-9.10-desktop-i386.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/ubuntu-9.10-desktop-i386.iso noeject noprompt --
initrd (loop)/casper/initrd.lz
}
menuentry "Ubuntu Live 9.10 64bit" {
loopback loop /boot/iso/ubuntu-9.10-desktop-amd64.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/ubuntu-9.10-desktop-amd64.iso noeject noprompt --
initrd (loop)/casper/initrd.lz
}
menuentry "Grml small 2009.10" {
loopback loop /boot/iso/grml-small_2009.10.iso
linux (loop)/boot/grmlsmall/linux26 findiso=/boot/iso/grml-small_2009.10.iso apm=power-off lang=us vga=791 boot=live nomce noeject noprompt --
initrd (loop)/boot/grmlsmall/initrd.gz
}
menuentry "tinycore" {
loopback loop /boot/iso/tinycore_2.3.1.iso
linux (loop)/boot/bzImage --
initrd (loop)/boot/tinycore.gz
}
menuentry "Netinstall 32 preseed" {
loopback loop /boot/iso/mini.iso
linux (loop)/linux auto url=http://www.panticz.de/pxe/preseed/preseed.seed locale=en_US console-setup/layoutcode=de netcfg/choose_interface=eth0 debconf/priority=critical --
initrd (loop)/initrd.gz
}
menuentry "debian-installer-amd64.iso" {
loopback loop /boot/iso/debian-installer-amd64.iso
linux (loop)/linux vga=normal --
initrd (loop)/initrd.gz
}
menuentry "BackTrack 4" {
linux /boot/bt4/boot/vmlinuz BOOT=casper boot=casper nopersistent rw vga=0x317 --
initrd /boot/bt4/boot/initrd.gz
}
menuentry "Memory test (memtest86+)" {
linux16 /boot/img/memtest86+.bin
}
menuentry "BackTrack ERR" {
loopback loop /boot/iso/bt4-pre-final.iso
linux (loop)/boot/vmlinuz find_iso/filename=/boot/iso/bt4-pre-final.iso BOOT=casper boot=casper nopersistent rw vga=0x317--
initrd (loop)/boot/initrd.gz
}
menuentry "XBMC ERR" {
loopback loop /boot/iso/XBMCLive.iso