]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - INSTALL/grub/grub.cfg
update
[Ventoy.git] / INSTALL / grub / grub.cfg
index d59e46d772fd2a09422dd1bd1b34e2a068247e9e..b85a31a8b88051f88907058bc19363378ed21ce0 100644 (file)
@@ -206,6 +206,11 @@ function distro_specify_initrd_file_phase2 {
         if [ -f (loop)/parabola/boot/i686/parabolaiso.img ]; then 
             vt_linux_specify_initrd_file /parabola/boot/i686/parabolaiso.img
         fi
+    elif [ -f (loop)/hyperbola/boot/x86_64/hyperiso.img ]; then 
+        vt_linux_specify_initrd_file /hyperbola/boot/x86_64/hyperiso.img
+        if [ -f (loop)/hyperbola/boot/i686/hyperiso.img ]; then 
+            vt_linux_specify_initrd_file /hyperbola/boot/i686/hyperiso.img
+        fi
     elif [ -f (loop)/EFI/BOOT/initrd.img ]; then 
         #Qubes
         vt_linux_specify_initrd_file /EFI/BOOT/initrd.img
@@ -230,6 +235,14 @@ function ventoy_get_ghostbsd_ver {
     set vt_freebsd_ver=12.x
 }
 
+function ventoy_get_furybsd_ver {
+    if regexp "13\.[0-9]" "$2"; then
+        set vt_freebsd_ver=13.x
+    else
+        set vt_freebsd_ver=12.x
+    fi
+}
+
 function ventoy_get_freenas_ver {   
     set vt_freebsd_ver=11.x
 
@@ -250,6 +263,8 @@ function ventoy_freebsd_proc {
         ventoy_get_ghostbsd_ver $1 ${chosen_path}
     elif vt_strstr "$vt_volume_id" "FREENAS"; then
         ventoy_get_freenas_ver $1 ${chosen_path}   
+    elif vt_strstr "$vt_volume_id" "FURYBSD"; then
+        ventoy_get_furybsd_ver $1 ${chosen_path}   
     elif regexp "^13_[0-9]" "$vt_volume_id"; then
         set vt_freebsd_ver=13.x
     elif regexp "^12_[0-9]" "$vt_volume_id"; then
@@ -307,7 +322,7 @@ function ventoy_freebsd_proc {
     fi
     
     unset vt_unix_mod_path
-    for file in "/COPYRIGHT" "/FreeNAS-MANIFEST" "/version"; do   
+    for file in "/COPYRIGHT" "/FreeNAS-MANIFEST" "/version" "/etc/fstab"; do   
         if [ -e (loop)${file} ]; then                    
             set vt_unix_mod_path=${file}
             break
@@ -389,7 +404,7 @@ function uefi_linux_menu_func {
             loopback loop $1$2
         fi
         
-        vt_load_cpio  ${vtoy_path}/ventoy.cpio   $2 $1
+        vt_load_cpio  ${vtoy_path}/ventoy.cpio   $2 $1 "busybox=$ventoy_busybox_ver"
         
         vt_linux_clear_initrd
         
@@ -442,6 +457,8 @@ function uefi_linux_menu_func {
         elif [ -d (loop)/EFI/boot/entries ]; then
             if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
                 vt_add_replace_file 0 "EFI\\parabolaiso\\parabolaiso.img"
+            elif [ -f (loop)/hyperbola/boot/x86_64/hyperiso.img ]; then
+                vt_add_replace_file 0 "EFI\\hyperiso\\hyperiso.img"
             fi
         elif [ -e (loop)/syslinux/alt0/full.cz ]; then
             vt_add_replace_file 0 "EFI\\BOOT\\full.cz"            
@@ -594,7 +611,7 @@ function legacy_linux_menu_func {
             loopback loop $1$2
         fi
     
-        vt_load_cpio  $vtoy_path/ventoy.cpio  $2 $1
+        vt_load_cpio  $vtoy_path/ventoy.cpio  $2 $1 "busybox=$ventoy_busybox_ver"
 
         vt_linux_clear_initrd
         
@@ -709,32 +726,6 @@ function legacy_iso_memdisk {
     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
@@ -744,7 +735,7 @@ function iso_endless_os_proc {
     loopback loop ${1}${2}   
     vt_img_sector ${1}${2}
 
-    vt_load_cpio  $vtoy_path/ventoy.cpio  $2 $1   
+    vt_load_cpio  $vtoy_path/ventoy.cpio  $2 $1  "busybox=$ventoy_busybox_ver"
     vt_trailer_cpio $1 $2 noinit
     
     ventoy_debug_pause
@@ -765,20 +756,27 @@ function iso_endless_os_proc {
     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
+
+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
-            iso_deepin_live_proc $vtoy_iso_part $vt_chosen_path
+            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
@@ -852,13 +850,125 @@ function efi_unsupport_menuentry {
     common_unsupport_menuentry
 }
 
+#
+#============================================================#
+# IMG file boot process                                      #
+#============================================================#
+#
 
 
+function ventoy_img_easyos {
+    vt_load_cpio  $vtoy_path/ventoy.cpio  ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
+    vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
+    
+    loopback easysfs (vtimghd,1)/easy.sfs
+    vt_get_lib_module_ver (easysfs) /lib/modules/ vt_module_ver
+    
+    if [ -n "$vt_module_ver" ]; then        
+        for mod in "kernel/drivers/md/dm-mod.ko" "kernel/drivers/dax/dax.ko"; do
+            vt_img_extra_initrd_append  (easysfs)/lib/modules/$vt_module_ver/$mod
+        done
+    fi
+
+    ventoy_debug_pause
+
+    #boot image file
+    vt_set_boot_opt rdinit=/vtoy/vtoy
+    vt_img_hook_root
+    
+    syslinux_configfile (vtimghd,1)/syslinux.cfg
+    
+    vt_img_unhook_root
+    vt_unset_boot_opt
+    loopback -d easysfs
+}
+
+function ventoy_img_volumio {
+    vt_load_cpio  $vtoy_path/ventoy.cpio  ${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 imgpart=/dev/ventoy2 bootpart=/dev/ventoy1
+    vt_img_hook_root
+    
+    syslinux_configfile (vtimghd,1)/syslinux.cfg
+    
+    vt_img_unhook_root
+    vt_unset_boot_opt
+}
+
+function ventoy_img_fydeos {
+
+    set ventoy_busybox_ver=64
+
+    vt_load_cpio  $vtoy_path/ventoy.cpio  ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
+    vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
+    
+    # loopback easysfs (vtimghd,1)/easy.sfs
+    # vt_get_lib_module_ver (easysfs) /lib/modules/ vt_module_ver
+    
+    # if [ -n "$vt_module_ver" ]; then        
+        # for mod in "kernel/drivers/md/dm-mod.ko" "kernel/drivers/dax/dax.ko"; do
+            # vt_img_extra_initrd_append  (easysfs)/lib/modules/$vt_module_ver/$mod
+        # done
+    # fi
+
+    ventoy_debug_pause
+
+    #boot image file
+    vt_set_boot_opt rdinit=/vtoy/vtoy
+    vt_img_hook_root
+    
+    set root=(vtimghd,12)
+    configfile (vtimghd,12)/efi/boot/grub.cfg
+    #syslinux_configfile (vtimghd,12)/syslinux/syslinux.cfg
+    
+    vt_img_unhook_root
+    vt_unset_boot_opt
+}
 
 
 function img_common_menuentry {
+    set ventoy_busybox_ver=32
+    
+    vt_chosen_img_path vt_chosen_path vt_chosen_size
+
+    if [ -d (vtimghd)/ ]; then
+        loopback -d vtimghd
+    fi
 
-    echo "To be implement"
+    loopback vtimghd ${vtoy_iso_part}${vt_chosen_path}
+    vt_img_sector ${vtoy_iso_part}${vt_chosen_path}
+
+    vt_img_part_info (vtimghd)
+
+    set vtback_root=$root
+    ventoy_cli_console
+    vt_push_last_entry
+
+    vt_img_extra_initrd_reset
+
+    if [ -e (vtimghd,1)/easy.sfs ]; then
+        ventoy_img_easyos
+    elif [ -e (vtimghd,1)/volumio.initrd ]; then
+        ventoy_img_volumio
+    elif [ -e (vtimghd,3)/etc/os-release ]; then
+        if vt_file_strstr (vtimghd,3)/etc/os-release FydeOS; then
+            ventoy_img_fydeos
+        fi
+        
+    else
+        echo -e "\n This IMG file is NOT supported now. \n"
+        echo -e " 当前不支持启动此 IMG 文件 \n"    
+        echo -e "\npress ENTER to exit (请按 回车 键返回) ..."    
+        read vtInputKey        
+    fi
+
+    set root=$vtback_root
+    vt_pop_last_entry
+    ventoy_gui_console
 }
 
 function img_unsupport_menuentry {