Skip to content

Instantly share code, notes, and snippets.

@fourdollars
Last active July 27, 2018 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fourdollars/f60bf3be509a712553cc8e70eab210c7 to your computer and use it in GitHub Desktop.
Save fourdollars/f60bf3be509a712553cc8e70eab210c7 to your computer and use it in GitHub Desktop.
function load_efi_video {
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
}
function load_video {
set gfxmode=auto
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
insmod gfxterm
terminal_output gfxterm
}
if loadfont ($root)/boot/grub/fonts/unicode.pf2
then
if load_efi_video
then
set bios="UEFI BIOS"
else
load_video
set bios="Legacy BIOS"
fi
fi
set locale_dir=($root)/boot/grub/locale
set lang=zh_TW
insmod gettext
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30
then
clear
fi
set gfxpayload=keep
set options="file=/cdrom/preseed/ubuntu.seed boot=casper"
set desktop="locale=zh_TW.UTF-8 toram noeject noprompt"
set extra=""
insmod regexp
for isofile in /iso/*.iso
do
menuentry "試用 $isofile 免安裝 ($bios)" $isofile {
loopback loop $2
if [ -f (loop)/casper/vmlinuz ]; then
set vmlinuz="(loop)/casper/vmlinuz"
elif [ -f (loop)/casper/vmlinuz.efi ]; then
set vmlinuz="(loop)/casper/vmlinuz.efi"
fi
if [ -f (loop)/casper/initrd ]; then
set initrd="(loop)/casper/initrd"
elif [ -f (loop)/casper/initrd.lz ]; then
set initrd="(loop)/casper/initrd.lz"
elif [ -f (loop)/casper/initrd.gz ]; then
set initrd="(loop)/casper/initrd.gz"
fi
linux $vmlinuz iso-scan/filename=$2 $options $desktop --- $extra
initrd $initrd
}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment