]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - INSTALL/grub/grub.cfg
update pl_PL.json
[Ventoy.git] / INSTALL / grub / grub.cfg
index b3977d629756dfea334361ea8a72f8669e36416b..19cce835ae339815b01584d042aae3d77d32c4ce 100644 (file)
 # 
 #************************************************************************************
 
+if [ "$grub_platform" = "pc" ]; then
+    insmod setkey
+    insmod regexp
+    insmod video_fb
+fi
+
 function ventoy_pause {
     echo "press Enter to continue ......"
     read vtTmpPause
@@ -65,6 +71,10 @@ function ventoy_vcfg_proc {
     fi
 }
 
+function ventoy_language {
+    configfile $prefix/menulang.cfg
+}
+
 function ventoy_diagnosis {
     vt_enum_video_mode    
     configfile $prefix/debug.cfg
@@ -99,8 +109,9 @@ function ventoy_show_help {
         fi
 
         loopback vt_help_tarfs mem:${vtoy_help_txt_mem_addr}:size:${vtoy_help_txt_mem_size}
-        if [ -f "(vt_help_tarfs)/help/${VTOY_HELP_TXT_LANGUAGE}.txt" ]; then
-            cat "(vt_help_tarfs)/help/${VTOY_HELP_TXT_LANGUAGE}.txt"
+        vt_cur_menu_lang vtCurLang
+        if [ -f "(vt_help_tarfs)/help/${vtCurLang}.txt" ]; then
+            cat "(vt_help_tarfs)/help/${vtCurLang}.txt"
         else
             cat "(vt_help_tarfs)/help/en_US.txt"
         fi        
@@ -108,6 +119,11 @@ function ventoy_show_help {
     fi
 }
 
+function ventoy_load_menu_lang_file {
+    vt_load_file_to_mem "auto" $vtoy_efi_part/grub/menu.tar.gz vtoy_menu_lang_mem
+    loopback vt_menu_tarfs mem:${vtoy_menu_lang_mem_addr}:size:${vtoy_menu_lang_mem_size}    
+}
+
 function get_os_type {
     set vtoy_os=Linux
     
@@ -836,6 +852,13 @@ function uefi_linux_menu_func {
                 configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
             fi
         fi
+        
+        if [ $vtback_cfg_find -eq 0 ]; then
+            if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
+                syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
+                set vtback_cfg_find=1
+            fi
+        fi
 
         if [ "$vtback_cfg_find" = "0" ]; then
             echo " "
@@ -1303,6 +1326,13 @@ function legacy_linux_menu_func {
                     configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
                 fi
             fi
+            
+            if [ $vtback_cfg_find -eq 0 ]; then
+                if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
+                    syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
+                    set vtback_cfg_find=1
+                fi
+            fi
 
             vt_unset_boot_opt
             set root=$vtback_root        
@@ -2304,14 +2334,15 @@ function img_common_menuentry {
     elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then
         ventoy_img_ubos
     elif [ -f (vtimghd,2)/etc/openwrt_version ]; then
-        ventoy_img_openwrt
-    elif [ -f (vtimghd,1)/efi/boot/mt86.png ]; then 
-        if [ "$grub_platform" = "pc" ]; then
-            img_unsupport_tip
-        else
-            ventoy_img_memtest86            
-        fi    
+        ventoy_img_openwrt    
     else
+        if [ -f (vtimghd,1)/efi/boot/mt86.png ]; then 
+            if [ "$grub_platform" = "pc" ]; then
+                img_unsupport_tip
+            fi 
+        fi
+
+        #common chain
         vt_linux_chain_data "${vtoy_iso_part}${vt_chosen_path}"
         ventoy_acpi_param ${vtoy_chain_mem_addr} 512
         if [ "$grub_platform" = "pc" ]; then 
@@ -2336,6 +2367,28 @@ function img_unsupport_menuentry {
     common_unsupport_menuentry
 }
 
+function mimg_common_menuentry {
+    vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
+
+    if vt_check_password "${vt_chosen_path}"; then
+        return
+    fi
+
+    echo "memdisk mode boot for $vt_chosen_path"
+    echo ""
+    ventoy_debug_pause
+
+    if [ "$grub_platform" = "pc" ]; then
+        legacy_img_memdisk $vtoy_iso_part "$vt_chosen_path"
+    else
+        vt_load_img_memdisk "$vtoy_iso_part$vt_chosen_path" vtoy_img_buf
+        ventoy_cli_console
+        chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi memdisk env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_img_buf_addr}:size:${vtoy_img_buf_size}
+        boot
+        ventoy_gui_console    
+    fi      
+}
+
 #############################################################
 #############################################################
 #############################################################
@@ -2344,7 +2397,7 @@ function img_unsupport_menuentry {
 #############################################################
 #############################################################
 
-set VENTOY_VERSION="1.0.82"
+set VENTOY_VERSION="1.0.84"
 
 #ACPI not compatible with Window7/8, so disable by default
 set VTOY_PARAM_NO_ACPI=1
@@ -2368,6 +2421,7 @@ set VTOY_HELP_CMD="ventoy_show_help"
 set VTOY_CHKSUM_CMD="ventoy_checksum"
 set VTOY_HELP_TXT_LANGUAGE="en_US"
 set VTOY_CHKSUM_FILE_PATH="X"
+set VTOY_LANG_CMD="ventoy_language"
 
 
 if [ "$grub_platform" = "pc" ]; then
@@ -2433,6 +2487,9 @@ fi
 #Load Partition Table
 vt_load_part_table $vtoydev
 
+#Load menu lang file
+ventoy_load_menu_lang_file
+
 #Load Plugin
 if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
     clear
@@ -2442,6 +2499,12 @@ else
     vt_check_json_path_case $vtoy_iso_part
 fi
 
+if [ -n "$VTOY_MENU_LANGUAGE" ]; then
+    vt_init_menu_lang "$VTOY_MENU_LANGUAGE"
+else
+    vt_init_menu_lang en_US
+fi
+
 if [ -n "$VTOY_MENU_TIMEOUT" ]; then
     set timeout=$VTOY_MENU_TIMEOUT
 else
@@ -2463,10 +2526,8 @@ fi
 
 if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
     set VTOY_F3_CMD="vt_dynamic_menu 1 1"
-    set VTOY_HOTKEY_TIP="h:Help  F1:Memdisk  F2:Browser  F3:TreeView  F4:Localboot  F5:Tools  F6:ExMenu"
 else
     set VTOY_F3_CMD="vt_dynamic_menu 1 0"
-    set VTOY_HOTKEY_TIP="h:Help  F1:Memdisk  F2:Browser  F3:ListView  F4:Localboot  F5:Tools  F6:ExMenu"
 fi
 
 terminal_output  console
@@ -2575,7 +2636,7 @@ export VTOY_HELP_CMD
 export VTOY_CHKSUM_CMD
 export VTOY_HELP_TXT_LANGUAGE
 export VTOY_CHKSUM_FILE_PATH
-export VTOY_HOTKEY_TIP
+export VTOY_LANG_CMD
 
 
 #colect all image files (iso files)