Boot ISO

GRUB Boot ISO 範例

Demo 修改檔案 是否需要執行 update-grub
demo_40_custom /etc/grub.d/40_custom 修改後,需要執行 sudo update-grub
demo_41_custom /boot/grub/custom.cfg 修改後,不需要執行 sudo update-grub

指引

GRUB Menu Entry / Boot ISO 樣板 / Arch


menuentry "Archlinux ISO / Latest" --class archlinux {

	set iso_file="/opt/iso/archlinux/latest/archlinux.iso"

	search --set=iso_partition --no-floppy --file ${iso_file}
	probe --set=iso_partition_uuid --fs-uuid ${iso_partition}

	#set img_dev="/dev/disk/by-uuid/${iso_partition_uuid}"
	set img_dev="UUID=${iso_partition_uuid}"


	loopback loop (${iso_partition})${iso_file}


	set boot_option=""
	#set boot_option="quiet splash"


	linux (loop)/arch/boot/x86_64/vmlinuz-linux img_dev=${img_dev} img_loop=${iso_file} archisobasedir=arch ${boot_option}
	initrd (loop)/arch/boot/x86_64/initramfs-linux.img

}

GRUB Menu Entry / Boot ISO 樣板 / Manjaro


menuentry "Manjaro ISO / Latest" --class manjaro {

	set iso_file="/opt/iso/manjaro/latest/manjaro.iso"

	search --set=iso_partition --no-floppy --file ${iso_file}
	probe --set=iso_partition_uuid --fs-uuid ${iso_partition}

	set img_dev="/dev/disk/by-uuid/${iso_partition_uuid}"


	loopback loop (${iso_partition})${iso_file}


	set boot_option=""
	#set boot_option="lang=zh_TW keytable=us tz=Asia/Taipei"
	#set boot_option="quiet splash"

	linux (loop)/boot/vmlinuz-x86_64 img_dev=${img_dev} img_loop=${iso_file} ${boot_option}
	#initrd (loop)/boot/initramfs-x86_64.img
	initrd (loop)/boot/initramfs-x86_64.img (loop)/boot/intel_ucode.img (loop)/boot/amd_ucode.img

}

GRUB Menu Entry / Boot ISO 樣板 / Debian


menuentry "Debian ISO / Latest" --class debian {

	set iso_file="/opt/iso/debian/latest/debian.iso"

	search --set=iso_partition --no-floppy --file ${iso_file}
	probe --set=iso_partition_uuid --fs-uuid ${iso_partition}

	set img_dev="/dev/disk/by-uuid/${iso_partition_uuid}"


	loopback loop (${iso_partition})${iso_file}


	set boot_option=""
	#set boot_option="components splash quiet"
	#set boot_option="components locales=zh_TW.UTF-8 quiet splash"

	linux (loop)/live/vmlinuz boot=live buuid=${iso_partition_uuid} findiso=${iso_file} ${boot_option}
	initrd (loop)/live/initrd.img

}

GRUB Menu Entry / Boot ISO 樣板 / Ubuntu


menuentry "Ubuntu ISO / Latest" --class ubuntu {

	set gfxpayload=keep
	set iso_file="/opt/iso/ubuntu/latest/ubuntu.iso"

	search --set=iso_partition --no-floppy --file ${iso_file}
	probe --set=iso_partition_uuid --fs-uuid ${iso_partition}

	set img_dev="/dev/disk/by-uuid/${iso_partition_uuid}"


	loopback loop (${iso_partition})${iso_file}


	set boot_option=""
	#set boot_option="locale=zh_TW"
	#set boot_option="quiet splash"
	#set boot_option="file=/cdrom/preseed/xubuntu.seed maybe-ubiquity ---"

	linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=${iso_file} ${boot_option}
	initrd (loop)/casper/initrd

}

GRUB Menu Entry / Boot ISO 樣板 / Fedora

請參考「Fedora 探索筆記 / Boot ISO By GRUB

參考文章

Reference

See Also


Table of contents