#************************************************************************************
function ventoy_pause {
- if [ -n "${vtdebug_flag}" ]; then
- echo "press Enter to continue ......"
- read vtTmpPause
- fi
+ echo "press Enter to continue ......"
+ read vtTmpPause
}
function ventoy_debug_pause {
fi
}
-function ventoy_cli_console {
- if [ "$grub_platform" = "pc" ]; then
- #terminal_output vga_text
+function ventoy_cli_console {
+ if [ -z "$vtoy_display_mode" ]; then
+ terminal_output console
+ elif [ "$vtoy_display_mode" = "GUI" ]; then
terminal_output console
- else
- if [ "$vtoy_display_mode" != "CLI" ]; then
- terminal_output console
- fi
fi
}
function ventoy_gui_console {
- if [ "$grub_platform" = "pc" ]; then
- if [ "$vtoy_display_mode" = "CLI" ]; then
- terminal_output console
- else
- terminal_output gfxterm
- fi
- else
- if [ "$vtoy_display_mode" != "CLI" ]; then
- terminal_output gfxterm
- fi
- fi
+ if [ -z "$vtoy_display_mode" ]; then
+ terminal_output gfxterm
+ elif [ "$vtoy_display_mode" = "GUI" ]; then
+ terminal_output gfxterm
+ fi
}
function ventoy_power {
fi
vt_load_cpio ${vtoy_path}/ventoy.cpio $2 $1
-
+
vt_linux_clear_initrd
if [ -d (loop)/pmagic ]; then
unset LoadIsoEfiDriver
fi
- vt_chosen_img_path chosen_path
+ set chosen_path=$2
vt_select_auto_install ${chosen_path}
vt_select_persistence ${chosen_path}
vt_iso9660_nojoliet 0
fi
- loopback loop ${1}${chosen_path}
- vt_parse_iso_volume ${1}${chosen_path} vt_system_id vt_volume_id
+ loopback loop ${1}${chosen_path}
get_os_type (loop)
if [ -d (loop)/EFI ]; then
}
function uefi_iso_memdisk {
- vt_chosen_img_path chosen_path
-
echo 'Loading ISO file to memory ...'
- vt_load_iso_to_mem ${1}${chosen_path} vtoy_iso_buf
+ vt_load_img_memdisk ${1}${2} vtoy_iso_buf
ventoy_cli_console
chainloader ${vtoy_path}/ventoy_x64.efi memdisk env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_iso_buf_addr}:size:${vtoy_iso_buf_size}
loopback -d loop
fi
- vt_chosen_img_path chosen_path
+ set chosen_path=$2
vt_select_auto_install ${chosen_path}
vt_select_persistence ${chosen_path}
fi
loopback loop ${1}${chosen_path}
- vt_parse_iso_volume ${1}${chosen_path} vt_system_id vt_volume_id
+
get_os_type (loop)
if [ -n "$vtcompat" ]; then
}
function legacy_iso_memdisk {
- vt_chosen_img_path chosen_path
linux16 $vtoy_path/memdisk iso raw
echo "Loading ISO file to memory ..."
- initrd16 ${1}${chosen_path}
+ initrd16 ${1}${2}
+ boot
+}
+
+function iso_deepin_live_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
+ vt_trailer_cpio $1 $2 noinit
+
+ ventoy_debug_pause
+
+ vt_set_boot_opt rdinit=/ventoy/loop/deepin/ventoy-init.sh live-media=/dev/mapper/ventoy
+
+ set ventoy_loading_tip="Loading files ......"
+
+ linux (loop)/live/vmlinuz boot=live components locales=zh_CN.UTF-8 splash quiet
+ initrd (loop)/live/initrd.img
boot
+
+ unset ventoy_loading_tip
+
+ vt_unset_boot_opt
+}
+
+
+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
+ 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 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
+
+ #special process for deepin-live iso
+ if [ "$vt_chosen_size" = "403701760" ]; then
+ if vt_str_begin $vt_chosen_path "/deepin-live"; then
+ iso_deepin_live_proc $vtoy_iso_part $vt_chosen_path
+ fi
+ fi
+
+ #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
+ legacy_iso_memdisk $vtoy_iso_part $vt_chosen_path
else
- legacy_iso_menu_func $vtoy_iso_part
+ legacy_iso_menu_func $vtoy_iso_part $vt_chosen_path
fi
else
if vt_check_mode 0; then
- uefi_iso_memdisk $vtoy_iso_part
+ uefi_iso_memdisk $vtoy_iso_part $vt_chosen_path
else
- uefi_iso_menu_func $vtoy_iso_part
+ uefi_iso_menu_func $vtoy_iso_part $vt_chosen_path
fi
fi
}
}
function wim_common_menuentry {
- vt_chosen_img_path chosen_path
- vt_wim_chain_data ${vtoy_iso_part}${chosen_path}
+ vt_chosen_img_path vt_chosen_path vt_chosen_size
+ vt_wim_chain_data ${vtoy_iso_part}${vt_chosen_path}
ventoy_debug_pause
}
function efi_common_menuentry {
- vt_chosen_img_path chosen_path
+ 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_iso_part}${chosen_path}
+ 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}
boot
ventoy_gui_console
}
+
+
+function img_common_menuentry {
+
+ echo "To be implement"
+}
+
+function img_unsupport_menuentry {
+ common_unsupport_menuentry
+}
+
#############################################################
#############################################################
#############################################################
if [ "$vtoy_display_mode" = "CLI" ]; then
terminal_output console
+elif [ "$vtoy_display_mode" = "serial" ]; then
+ if [ -n "$vtoy_serial_param" ]; then
+ serial $vtoy_serial_param
+ fi
+ terminal_input serial
+ terminal_output serial
+elif [ "$vtoy_display_mode" = "serial_console" ]; then
+ if [ -n "$vtoy_serial_param" ]; then
+ serial $vtoy_serial_param
+ fi
+ terminal_input serial console
+ terminal_output serial console
else
if [ -n "$vtoy_theme" ]; then
set theme=$vtoy_theme