Boot ISO By GRUB

範例專案

下載 ISO

先參考「Download ISO」這篇提到的下載方式,下載「Fedora 官方提供最新的ISO檔案」。

將「ISO檔案」放到「/opt/iso/fedora/40/Fedora-Xfce-Live-x86_64-40-1.14.iso」這個路徑。

舉例執行下面指令

sudo curl -fLo //opt/iso/fedora/40/Fedora-Xfce-Live-x86_64-40-1.14.iso --create-dirs \
	https://download.fedoraproject.org/pub/fedora/linux/releases/40/Spins/x86_64/iso/Fedora-Xfce-Live-x86_64-40-1.14.iso

設定範例

接著採用下面其中一種方式來設定。

GRUB Boot ISO 範例 設定檔路徑 是否需要執行 update-grub
demo_40_custom /etc/grub.d/40_custom 修改後,需要執行 sudo update-grub
demo_41_custom /boot/grub/custom.cfg 修改後,不需要執行 sudo update-grub

關於「sudo update-grub」指的是「sudo grub-mkconfig -o /boot/grub/grub.cfg

GRUB Menu Entry / Boot ISO 樣板 / Fedora

menuentry "Fedora 40 ISO / Xfce" --class Fedora {
	set iso_file="/opt/iso/fedora/40/Fedora-Xfce-Live-x86_64-40-1.14.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)/images/pxeboot/vmlinuz iso-scan/filename=$iso_file root=live:CDLABEL=Fedora-Xfce-Live-40-1-14 rd.live.image rhgb $boot_option
	initrd (loop)/images/pxeboot/initrd.img
}

See Also