Skip to content

Instantly share code, notes, and snippets.

@lixingcong
Last active May 8, 2018 03:58
Show Gist options
  • Save lixingcong/fe27b7747346a964e95765d00860dfdd to your computer and use it in GitHub Desktop.
Save lixingcong/fe27b7747346a964e95765d00860dfdd to your computer and use it in GitHub Desktop.
GRUB2 bootiing linux iso
menuentry "Boot Ubuntu ISO" {
set root=(hd1,msdos4)
set isofile=/lubuntu-16.04.3-desktop-amd64.iso
loopback loop $isofile
linux (loop)/casper/vmlinuz.efi persistent boot=casper iso-scan/filename="$isofile" quiet splash ro locale=zh_CN.UTF-8 noprompt --
initrd (loop)/casper/initrd.lz
}
menuentry "Boot ArchLinux ISO" {
set root=(hd0,msdos1)
set isofile=/archlinux-2018.05.01-x86_64.iso
# ls -l /dev/disk/by-uuid
set uuid=4A94-70F9
loopback loop $isofile
probe -l $root -s label
linux (loop)/arch/boot/x86_64/vmlinuz img_dev=/dev/disk/by-uuid/$uuid img_loop=$isofile
initrd (loop)/arch/boot/x86_64/archiso.img
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment