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 "Arch 2022.04.05 ISO" --class Arch {
	set iso_file="/opt/iso/arch/latest/archlinux-2022.04.05-x86_64.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="quiet splash"
	linux (loop)/arch/boot/x86_64/vmlinuz-linux img_dev=$img_dev img_loop=$iso_file $boot_option
	initrd (loop)/arch/boot/intel-ucode.img (loop)/arch/boot/amd-ucode.img (loop)/arch/boot/x86_64/initramfs-linux.img
}

GRUB Menu Entry / Boot ISO 樣板 / Manjaro

menuentry "Manjaro xfce 21.2.5 ISO" --class Manjaro {
	set iso_file="/opt/iso/manjaro/latest/manjaro-xfce-21.2.5-220314-linux515.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/intel_ucode.img (loop)/boot/amd_ucode.img (loop)/boot/initramfs-x86_64.img
}

GRUB Menu Entry / Boot ISO 樣板 / Debian

menuentry "Debian 11 Xfce ISO" --class Debian {
	set iso_file="/opt/iso/debian/11/debian-live-11.2.0-amd64-xfce.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-5.10.0-10-amd64 boot=live buuid=$iso_partition_uuid findiso=$iso_file $boot_option
	initrd (loop)/live/initrd.img-5.10.0-10-amd64
}

GRUB Menu Entry / Boot ISO 樣板 / Ubuntu

menuentry "Xubuntu 22.04 Live ISO" --class Ubuntu {
	set gfxpayload=keep
	set iso_file="/opt/iso/ubuntu/22.04/xubuntu-22.04-desktop-amd64.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 iso-scan/filename=$iso_file boot=casper $boot_option
	initrd (loop)/casper/initrd
}

參考文章

Reference

See Also


Table of contents