Boot ISO By GRUB

範例專案

下載 ISO

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

將「ISO檔案」放到「/opt/iso/elementaryos/latest/elementaryos-8.0-stable.20241122rc.iso」這個路徑。

舉例:執行下面指令

sudo curl -fLo /opt/iso/elementaryos/latest/elementaryos-8.0-stable.20241122rc.iso --create-dirs \
	https://sgp1.dl.elementary.io/download/MTczODQ5OTExMA==/elementaryos-8.0-stable.20241122rc.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 樣板 / Elementary OS (Ubuntu)


menuentry "Elementary OS 8.0 / 20241122rc" --class Ubuntu {
	set gfxpayload=keep
	set iso_file="/opt/iso/elementaryos/latest/elementaryos-8.0-stable.20241122rc.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"

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

See Also