public
Last updated

grub2 loopback multiboot flash drive

  • Download Gist
  • Link to this gist
grub-install.sh
Shell
1 2 3 4 5 6 7 8 9
#!/bin/sh
 
DEVICE=sdf
 
mkfs.vfat -n multipass01 /dev/$DEVICE1
 
mount /dev/$DEVICE1 /mnt/
 
grub-install --no-floppy --root-directory=/mnt /dev/$DEVICE
grub.cfg
INI
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
insmod font
if loadfont /boot/grub/unicode.pf2 ; then
if keystatus --shift ; then true ; else
insmod gfxterm
insmod vbe
insmod vga
set gfxmode=auto
set gfxpayload=auto
terminal_output gfxterm
if terminal_output gfxterm ; then true ; else
terminal gfxterm
fi
fi
fi
 
set color_normal=white/black
set color_highlight=white/light-blue
export color_normal
export color_highlight
 
set drive_label=multipass01
set isopath=/iso
export drive_label
export isopath
 
menuentry "entries under development" {
configfile /boot/grub/grub.cfg.dev
}
 
menuentry "pentoo-x86_64-2012.0_beta1.7" {
set isofile="$isopath/pentoo-x86_64-2012.0_beta1.7.iso"
loopback loop $isofile
linux (loop)/boot/pentoo root=/dev/ram0 init=/linuxrc nokeymap cdroot cdboot looptype=squashfs loop=/image.squashfs initrd=pentoo.igz vga=791 usbcore.autosuspend=1 console=tty0 rootdelay=10 isoboot=$isofile
initrd (loop)/boot/pentoo.igz
}
 
menuentry "systemrescuecd-x86-3.3.0.iso" {
set isofile="$isopath/systemrescuecd-x86-3.3.0.iso"
loopback loop $isofile
linux (loop)/isolinux/rescue32 isoloop=$isofile setkmap=us scandelay=1
initrd (loop)/isolinux/initram.igz
}
 
menuentry "pmagic_2013_01_29.iso (Default Runs from RAM)" {
set isofile="$isopath/pmagic_2013_01_29.iso"
loopback loop $isofile
linux (loop)/pmagic/bzImage iso_filename=$isofile edd=off load_ramdisk=1 prompt_ramdisk=0 rw vga=normal loglevel=9 max_loop=256 vmalloc=256MiB --
initrd (loop)/pmagic/initrd.img
}
 
menuentry "pmagic_2013_01_29.iso (Console)" {
set isofile="$isopath/pmagic_2013_01_29.iso"
loopback loop $isofile
linux (loop)/pmagic/bzImage iso_filename=$isofile edd=off load_ramdisk=1 prompt_ramdisk=0 rw vga=normal consoleboot max_loop=256 vmalloc=256MiB loglevel=9 --
initrd (loop)/pmagic/initrd.img
}
 
menuentry "linuxmint-14-mate-dvd-oem-64bit.iso" {
set isofile="$isopath/linuxmint-14-mate-dvd-oem-64bit.iso"
loopback loop $isofile
linux (loop)/casper/vmlinuz file=/cdrom/preseed/mint.seed oem-config/enable=true only-ubiquity boot=casper iso-scan/filename=$isofile quiet splash noprompt --
initrd (loop)/casper/initrd.lz
}
 
menuentry "ophcrack-notables-livecd-3.4.0.iso" {
set isofile="$isopath/ophcrack-notables-livecd-3.4.0.iso"
loopback loop $isofile
linux (loop)/boot/bzImage root=/dev/null rw vga=normal lang=en_US kmap=us autologin iso-scan/filename=$isofile
initrd (loop)/boot/rootfs.gz
}
 
menuentry "archlinux-2013.02.01-dual.iso" {
set isofile="$isopath/archlinux-2013.02.01-dual.iso"
loopback loop $isofile
linux (loop)/arch/boot/x86_64/vmlinuz archisobasedir=arch archisolabel=ARCH_201302 img_dev=/dev/disk/by-label/$drive_label img_loop=$isofile earlymodules=loop noeject noprompt
initrd (loop)/arch/boot/x86_64/archiso.img
}
 
menuentry "Konboot" {
linux16 /boot/grub/memdisk
initrd16 $isopath/FD0-konboot-v1.1-2in1.img
# set root=(hd1)
# drivemap -s hd0 hd1
}
 
menuentry "Plop Boot Manager" {
set isofile="$isopath/pmagic_2013_01_29.iso"
loopback loop $isofile
linux16 (loop)/boot/plpbt/plpbt.bin
}
 
menuentry "Seagate SeaTools" {
linux16 /boot/grub/memdisk bigraw
initrd16 $isopath/SeaTools.img
}
 
menuentry "wdidle3_1_05 FreeDOS" {
linux16 /boot/grub/memdisk
initrd16 $isopath/wdidle.img
}
 
menuentry "Thinkpad x200t BIOS Upgrade to 3.20" {
insmod part_msdos
insmod ext2
linux16 /boot/grub/memdisk iso
initrd16 $isopath/7wuj44uc.iso
}
 
submenu "grub2 related functions" {
menuentry "List devices/partitions" {
ls -l
sleep --interruptible 9999
}
 
menuentry "Enable GRUB2's LVM support" {
insmod lvm
}
 
menuentry "Enable GRUB2's RAID support" {
insmod dm_nv
insmod mdraid09_be
insmod mdraid09
insmod mdraid1x
insmod raid5rec
insmod raid6rec
}
 
menuentry "Enable GRUB2's PATA support (to work around BIOS bugs/limitations)" {
insmod ata
update_paths
}
 
menuentry "Enable GRUB2's USB support *experimental*" {
insmod ohci
insmod uhci
insmod usbms
update_paths
}
 
menuentry "Mount encrypted volumes (LUKS and geli)" {
insmod luks
insmod geli
 
cryptomount -a
}
 
menuentry "Enable serial terminal" {
serial
terminal_input --append serial
terminal_output --append serial
}
}
 
menuentry "DBAN (Darik's Boot and Nuke)" {
set isofile="$isopath/dban-2.2.6_i586.iso"
set gfxpayload=text
loopback loop $isofile
linux (loop)/DBAN.BZI nuke="dwipe" iso-scan/filename=$isofile silent --
}
 
menuentry "memtest86+" {
linux16 $isopath/memtest.bin
}
 
menuentry "Boot to Hard Disk" {
chainloader +1
}
 
menuentry "Reboot" {
reboot
}
 
menuentry "Poweroff" {
halt
}

Nice work (y) super useful

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.