Example grub.cfg menu
It’s time to trot out a full example grub.cfg. See below. This is (more or less) the one I use on my “Swiss Army” fob. This fob started by copying the contents of the Ubuntu 14.04 live CD ISO to the fob. At that point it was UEFI-bootable. Grub2 was installed, and grub.cfg hand edited to add all the extra boot stanzas. Memdisk was installed, and the various ISOs and extracted bootable files added.
It’s worth remembering that the boot menu can be edited “on-the-fly” at boot time. Useful if the target machine uses a different path to Windows (for instance) or requires a specific graphics configuration or other special option. Just arrow up/down to the desired boot entry and hit “e”.
# Ubuntu 14.04.1 stock grub.cfg modified for geezblog "A Fob Story" if loadfont /boot/grub/font.pf2 ; then set gfxmode=auto insmod efi_gop insmod efi_uga insmod gfxterm terminal_output gfxterm fi set menu_color_normal=white/black set menu_color_highlight=black/light-gray # Stock boot stanzas # They boot the _contents_ of the Ubuntu ISO as copied to the flash drive # UEFI or legacy menuentry "Try Ubuntu without installing" { set gfxpayload=keep linux /casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash -- initrd /casper/initrd.lz } menuentry "Install Ubuntu" { set gfxpayload=keep linux /casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash -- initrd /casper/initrd.lz } menuentry "OEM install (for manufacturers)" { set gfxpayload=keep linux /casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash oem-config/enable=true -- initrd /casper/initrd.lz } menuentry "Check disc for defects" { set gfxpayload=keep linux /casper/vmlinuz.efi boot=casper integrity-check quiet splash -- initrd /casper/initrd.lz } # Boot stanzas added for "A Fob Story" # File paths are specific to this implementation # Yours may be different # Boot Ubuntu 14.04.1 from an ISO file menuentry "Ubuntu 14.04.1 64-bit Desktop ISO" { set isofile="/bootable/iso/ubuntu-14.04.1-desktop-amd64.iso" loopback loop $isofile linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noeject noprompt splash -- initrd (loop)/casper/initrd.lz } # Boot Ubuntu 14.04.1 with persistence menuentry "Boot Ubuntu 14.04.1 with persistence" { set gfxpayload=keep linux /casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper persistent persistent-path=/bootable/persistent/ubuntu-14.04.1-desktop-amd64 splash -- initrd /casper/initrd.lz } # Boot Ubuntu 14.04.01 From ISO with persistence menuentry "Ubuntu 14.04.1 64-bit Desktop ISO with persistence" { set isofile="/bootable/iso/ubuntu-14.04.1-desktop-amd64.iso" loopback loop $isofile linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile persistent persistent-path=/bootable/persistent/ubuntu-14.04.1-desktop-amd64-ISO noeject noprompt splash -- initrd (loop)/casper/initrd.lz } # Chainload Windows # Check paths! They may be different # This boots Windows (if it exists) on the target hard drive menuentry "Windows legacy chainload" { set root=(hd0,1) chainloader +1 } menuentry "Windows UEFI chainload" { insmod ntfs set root=(hd1,gpt2) chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi boot } # Chainload EFI Shell Tool menuentry "EFI Shell UEFI chainload" { chainloader /bootable/EFI_Shell/BootX64.efi } # Memtest - legacy and UEFI menuentry "Memtest 86+ V5.01 legacy boot" { linux16 /bootable/images/memtest86+-5.01.bin } menuentry "Memtest 5.1.0 UEFI chainload" { chainloader /bootable/memtest_5.1.0/EFI/BOOT/BOOTX64.EFI } # Acronis True Image boot stanzas # # Acronis can be a little flaky with some versions working on # some hardware but not others, so several versions kept on fob # # The non-ISO boot stanzas use files copied from USB bootable # media created by Acronis tools # # None are UEFI-bootable :( [Update] See below for UEFI-bootable Acronis stanza # # The dat versions boot faster than the ISO version, FWIW menuentry "Acronis 2013 6514 ISO ** works with wireless kbd and mouse **" { linux16 /boot/isolinux/memdisk-6.02 iso raw initrd16 /bootable/iso/ATIH2013_6514_en-US.iso } menuentry "Acronis 2013 build 6514" { linux16 /bootable/acronis/2013/dat3.dat vga=0x314 ramdisk_size=40000 quiet mbrcrcs=on initrd16 /bootable/acronis/2013/dat2.dat } menuentry "Acronis 2012 build 7133" { linux16 /bootable/acronis/2012/dat3.dat vga=0x314 ramdisk_size=40000 quiet mbrcrcs=on initrd16 /bootable/acronis/2012/dat2.dat } menuentry "Acronis 2011 build 6696" { linux16 /bootable/acronis/2011/dat3.dat vga=0x314 ramdisk_size=40000 quiet mbrcrcs=on initrd16 /bootable/acronis/2011/dat2.dat } menuentry "Acronis 2010 build 6029" { linux16 /bootable/acronis/2010/dat3.dat vga=0x314 ramdisk_size=40000 quiet mbrcrcs=on initrd16 /bootable/acronis/2010/dat2.dat } # [Update 2018.05.01] This method _does_ boot Acronis in UEFI and legacy mode menuentry "Acronis 2018 9207 ISO 64 Bit Mode UEFI and Legacy" { set quiet=1 set gfxpayload=1024x768x32,1024x768 set mbrcrcs=on set isofile="/bootable/iso/AcronisBootableMedia2018_9207.iso" search --set -f $isofile loopback loop $isofile # edit: lang=13 is asian # linux (loop,msdos1)/dat10.dat lang=13 quiet force_modules=usbhid linux (loop,msdos1)/dat10.dat quiet force_modules=usbhid initrd (loop,msdos1)/dat11.dat (loop,msdos1)/dat12.dat boot } # A few more exotic and/or obscure but possibly useful things to boot - legacy only # A 32-bit version of Ubuntu that will boot and run on non-PAE enabled CPUs # If said machine won't boot via USB, at least the ISO is here for CD burning menuentry "Ubuntu 11.10 32-bit (non PAE CPUs OK) Desktop ISO" { set isofile="/bootable/iso/ubuntu-11.10-desktop-i386.iso" loopback loop $isofile linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noeject noprompt splash -- initrd (loop)/casper/initrd.lz } # Puppy linux - a small distro - ISO contents copied to the # /bootable/puppy/ directory on the flash drive # puppy searches for its files on start up so don't put it any # deeper in the directory structure (this is just a test) menuentry "Pupy Test - lupu 5.28 - NOT ISO" { linux /bootable/puppy/vmlinuz initrd /bootable/puppy/initrd.gz } # Hard drive forensic and recovery tools menuentry "Spinrite 6.0" { linux16 /boot/isolinux/memdisk-6.02 initrd16 /bootable/images/SpinRite.img } # img file renamed for convenience - was Bootable_1.44M.img menuentry "HD Regenerator 1.71" { linux16 /boot/isolinux/memdisk-6.02 initrd16 /bootable/images/HDRegen.img } # Windows repair CD ISOs # In my testing these boot but can't find the target OS for repair # Included here since the ISOs are handy for burning Repair CDs # and in the hope someone will offer a suggestion # # files renamed slightly to replace underscores and spaces with hyphens menuentry "Windows 7 SP1 repair 32-bit ISO" { linux16 /boot/isolinux/memdisk-6.02 iso raw initrd16 /bootable/iso/Windows-7-SP1-32-bit-Repair-Disc.iso } menuentry "Windows 7 SP1 repair 64-bit ISO" { linux16 /boot/isolinux/memdisk-6.02 iso raw initrd16 /bootable/iso/Windows-7-SP1-64-bit-Repair-Disc.iso } menuentry "Windows 8 repair 64-bit ISO" { linux16 /boot/isolinux/memdisk-6.02 iso raw initrd16 /bootable/iso/Windows-8-64-bit-Repair-Disc.iso }
<<< add a link to the above as a text file here >>>
<<< add the full directory/file tree for the sample fob here – or a link to a text file >>>
Pingback: FOB Story II | GeezBlog