+function ventoy_img_openelec {
+ elec_ver=$1
+
+ vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
+ vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
+
+ loopback vtloopex $vtoy_efi_part/ventoy/vtloopex.cpio
+ vt_img_extra_initrd_append (vtloopex)/$elec_ver/vtloopex.tar.xz
+
+ ventoy_debug_pause
+
+ #boot image file
+ vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=$elec_ver
+ vt_img_hook_root
+
+ set root=(vtimghd,1)
+ syslinux_configfile (vtimghd,1)/syslinux.cfg
+
+ vt_img_unhook_root
+ vt_unset_boot_opt
+ loopback -d vtloopex
+}
+
+
+function ventoy_img_freedombox {
+ vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
+ vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
+
+ vt_get_lib_module_ver (vtimghd,1) /lib/modules/ vt_module_ver
+ if [ -n "$vt_module_ver" ]; then
+ vt_img_extra_initrd_append (vtimghd,1)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko
+ fi
+
+ ventoy_debug_pause
+
+ #boot image file
+ vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=freedombox
+ vt_img_hook_root
+
+ configfile (vtimghd,1)/boot/grub/grub.cfg
+
+ vt_img_unhook_root
+ vt_unset_boot_opt
+}
+
+function ventoy_img_paldo {
+ vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
+ vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
+
+ ventoy_debug_pause
+
+ #boot image file
+ vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=paldo
+ vt_img_hook_root
+
+ vt_fs_enum_1st_file (vtimghd,1) /loader/entries/ vt_paldo_entry_conf
+ vt_file_basename $vt_paldo_entry_conf vtPaldoVer
+
+ echo loading file...
+ linux (vtimghd,1)/linux-${vtPaldoVer} root=/dev/ventoy1 rootfstype=vfat
+ initrd (vtimghd,1)/initramfs-${vtPaldoVer}
+ boot
+
+ vt_img_unhook_root
+ vt_unset_boot_opt
+}
+
+function ventoy_img_ubos {
+ vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
+ vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
+
+ vt_get_lib_module_ver (vtimghd,3) /lib/modules/ vt_module_ver
+ if [ -n "$vt_module_ver" ]; then
+ vt_img_extra_initrd_append (vtimghd,3)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko.xz
+ fi
+
+ ventoy_debug_pause
+
+ #boot image file
+ vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=ubos
+ vt_img_hook_root
+
+ echo loading file...
+ linux (vtimghd,2)/vmlinuz-linux root=/dev/ventoy3 rw
+ initrd (vtimghd,2)/initramfs-linux.img
+ boot
+
+ vt_img_unhook_root
+ vt_unset_boot_opt
+}
+
+function ventoy_img_recalbox {
+ vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
+ vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
+
+ ventoy_debug_pause
+
+ #boot image file
+ vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=recalbox
+ vt_img_hook_root
+
+ set root=(vtimghd,1)
+ configfile (vtimghd,1)/boot/grub/grub.cfg
+
+ vt_img_unhook_root
+ vt_unset_boot_opt
+}
+
+function ventoy_img_batocera {
+ vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
+ vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
+
+ ventoy_debug_pause
+
+ #boot image file
+ vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=batocera
+ vt_img_hook_root
+
+ set root=(vtimghd,1)
+ syslinux_configfile (vtimghd,1)/boot/syslinux/syslinux.cfg
+
+ vt_img_unhook_root
+ vt_unset_boot_opt
+}
+
+function ventoy_img_openwrt {
+ if [ -e (vtimghd,2)/lib64 ]; then
+ set ventoy_busybox_ver=64
+ fi
+
+ if [ ! -f ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz ]; then
+ ventoy_gui_console
+ echo -e "\n ventoy_openwrt.xz not found. Please refer https://www.ventoy.net/en/doc_openwrt.html.\n"
+ echo -e " 未找到 ventoy_openwrt.xz 文件。请参考 https://www.ventoy.net/cn/doc_openwrt.html\n"
+ echo -e "\n press ENTER to exit (请按 回车 键返回) ..."
+ read vtInputKey
+ ventoy_cli_console
+ return
+ fi
+
+ if vt_img_check_range "${vtoy_iso_part}${vt_chosen_path}"; then
+ ventoy_debug_pause
+ else
+ ventoy_gui_console
+ echo -e "\n IMG file need processed. Please refer https://www.ventoy.net/en/doc_openwrt.html.\n"
+ echo -e " 此 IMG 文件必须处理之后才能支持。请参考 https://www.ventoy.net/cn/doc_openwrt.html\n"
+ echo -e "\n press ENTER to exit (请按 回车 键返回) ..."
+ read vtInputKey
+ ventoy_cli_console
+ return
+ fi
+
+
+ vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
+ vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
+
+ vt_img_extra_initrd_append ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz
+
+
+ #boot image file
+ vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=openwrt
+ vt_img_hook_root
+
+ set root=(vtimghd,1)
+ configfile (vtimghd,1)/boot/grub/grub.cfg
+
+ vt_img_unhook_root
+ vt_unset_boot_opt
+}
+
+function ventoy_img_tails {
+ vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
+ vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
+
+ ventoy_debug_pause
+
+ #boot image file
+ vt_set_boot_opt rdinit=/vtoy/vtoy live-media=/dev/dm-1 ventoyos=tails
+ vt_img_hook_root
+
+ set root=(vtimghd,1)
+ configfile (vtimghd,1)/efi/debian/grub.cfg
+
+ vt_img_unhook_root
+ vt_unset_boot_opt
+}
+
+function ventoy_img_memtest86 {
+ chainloader (vtimghd,1)/efi/boot/BOOTX64.efi
+ boot
+}
+
+function img_unsupport_tip {
+ echo -e "\n This IMG file is NOT supported now. \n"
+ echo -e " 当前不支持启动此 IMG 文件 \n"
+ echo -e "\npress ENTER to exit (请按 回车 键返回) ..."
+ read vtInputKey
+}