+ initrd16 ${1}${2}
+ boot
+}
+
+
+function iso_endless_os_proc {
+ if [ -d (loop)/ ]; then
+ loopback -d loop
+ fi
+
+ loopback loop ${1}${2}
+ vt_img_sector ${1}${2}
+
+ vt_load_cpio $vtoy_path/ventoy.cpio $2 $1 "busybox=$ventoy_busybox_ver"
+ vt_trailer_cpio $1 $2 noinit
+
+ ventoy_debug_pause
+
+ vt_set_boot_opt '@kparams' rdinit=/vtoy/vtoy
+
+ set eosimage=loop
+ set ventoy_bls_bootdev=/boot
+ set ventoy_loading_tip="Loading files ......"
+
+ export eosimage
+ configfile (loop)/endless/grub/grub.cfg
+
+ unset eosimage
+ unset ventoy_bls_bootdev
+ unset ventoy_loading_tip
+
+ vt_unset_boot_opt
+}
+
+
+function ventoy_iso_busybox_ver {
+ set ventoy_busybox_ver=32
+
+ #special process for deepin-live iso
+ if [ "$vt_chosen_size" = "403701760" ]; then
+ if vt_str_begin $vt_chosen_path "/deepin-live"; then
+ set ventoy_busybox_ver=64
+ fi
+ fi
+}
+
+function iso_common_menuentry {
+ unset vt_system_id
+ unset vt_volume_id
+
+ vt_chosen_img_path vt_chosen_path vt_chosen_size
+ vt_parse_iso_volume ${vtoy_iso_part}${vt_chosen_path} vt_system_id vt_volume_id
+
+ ventoy_iso_busybox_ver
+
+ #special process for Endless OS
+ if vt_str_begin $vt_volume_id "Endless-OS"; then
+ iso_endless_os_proc $vtoy_iso_part $vt_chosen_path
+ fi
+
+ if [ "$grub_platform" = "pc" ]; then
+ if vt_check_mode 0; then
+ legacy_iso_memdisk $vtoy_iso_part $vt_chosen_path
+ else
+ legacy_iso_menu_func $vtoy_iso_part $vt_chosen_path
+ fi
+ else
+ if vt_check_mode 0; then
+ uefi_iso_memdisk $vtoy_iso_part $vt_chosen_path
+ else
+ uefi_iso_menu_func $vtoy_iso_part $vt_chosen_path
+ fi
+ fi
+}
+
+function common_unsupport_menuentry {
+ echo -e "\n The name of the iso file could NOT contain space or non-ascii characters. \n"
+ echo -e " 文件名中不能有中文或空格 \n"
+ echo -e "\npress ENTER to exit (请按 回车 键返回) ..."
+ read vtInputKey
+}
+
+function iso_unsupport_menuentry {
+ common_unsupport_menuentry
+}
+
+function wim_common_menuentry {
+ vt_chosen_img_path vt_chosen_path vt_chosen_size
+ vt_wim_chain_data ${vtoy_iso_part}${vt_chosen_path}
+
+ ventoy_debug_pause
+
+ if [ -n "$vtoy_chain_mem_addr" ]; then
+ if [ "$grub_platform" = "pc" ]; then
+ linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
+ else
+ ventoy_cli_console
+ chainloader ${vtoy_path}/ventoy_x64.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
+ ventoy_gui_console
+ fi
+ boot
+ else
+ echo "chain empty failed"
+ ventoy_pause
+ fi
+}
+
+function wim_unsupport_menuentry {
+ common_unsupport_menuentry
+}
+
+function efi_common_menuentry {
+ vt_chosen_img_path vt_chosen_path vt_chosen_size
+
+ vt_concat_efi_iso ${vtoy_iso_part}${vt_chosen_path} vtoy_iso_buf
+
+ ventoy_debug_pause
+
+ ventoy_cli_console
+ chainloader ${vtoy_path}/ventoy_x64.efi memdisk env_param=${env_param} isoefi=on ${vtdebug_flag} mem:${vtoy_iso_buf_addr}:size:${vtoy_iso_buf_size}