]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
1. grub2 mode supports Porteus ISO file.
authorlongpanda <admin@ventoy.net>
Wed, 4 Jan 2023 13:46:40 +0000 (21:46 +0800)
committerlongpanda <admin@ventoy.net>
Wed, 4 Jan 2023 13:46:40 +0000 (21:46 +0800)
2. Optimization for Lenovo Recovery Image.

IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
INSTALL/grub/grub.cfg
INSTALL/ventoy/vtoyjump32.exe
INSTALL/ventoy/vtoyjump64.exe
vtoyjump/vtoyjump/vtoyjump.c

index d1cbdac199b3dd9f3c2da6524b952e70b323c008..7b43a79f1b3cb540d9a71b23b6b8b8a3fd659998 100644 (file)
@@ -159,7 +159,7 @@ if $GREP -q SCRE /proc/cmdline; then
 fi
 
 if $GREP -qw 'SA[.]1' /proc/cmdline; then
-if $GREP -qw 'SA[.]2' /proc/cmdline; then
+if $GREP -qw 'writable.fsimg' /proc/cmdline; then
 if $GREP -qw 'rw'     /proc/cmdline; then
     echo 1 > $VTOY_PATH/distmagic/DELL_PER
 fi
index fe130668fffa8dfbb05ec6cee6b0b924812777d2..c198879d946cca05308627fd7dfd97210a6150cf 100644 (file)
@@ -860,6 +860,9 @@ function uefi_linux_menu_func {
             if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
                 syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
                 set vtback_cfg_find=1
+            elif [ -f (loop)/boot/syslinux/porteus.cfg ]; then
+                syslinux_configfile (loop)/boot/syslinux/porteus.cfg
+                set vtback_cfg_find=1
             fi
         fi
 
@@ -1311,6 +1314,9 @@ function legacy_linux_menu_func {
                 if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
                     syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
                     set vtback_cfg_find=1
+                elif [ -f (loop)/boot/syslinux/porteus.cfg ]; then
+                    syslinux_configfile (loop)/boot/syslinux/porteus.cfg
+                    set vtback_cfg_find=1
                 fi
             fi
 
@@ -1486,6 +1492,8 @@ function iso_common_menuentry {
     
     get_os_type (loop)
     
+    ventoy_debug_pause
+    
     if vt_need_secondary_menu "$vt_chosen_name"; then
         vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size
         if [ "$VTOY_SECOND_EXIT" = "1" ]; then
index 15f3fc17793138e8823db13774a25cdcba7091e0..ae791443016c57a0d474d8c2d904d115d9176d70 100644 (file)
Binary files a/INSTALL/ventoy/vtoyjump32.exe and b/INSTALL/ventoy/vtoyjump32.exe differ
index d1e63c6f05cbe0e25e5678f5401ac54c4129cc1c..af643e4312174050101ace99ea272decbe2df8cd 100644 (file)
Binary files a/INSTALL/ventoy/vtoyjump64.exe and b/INSTALL/ventoy/vtoyjump64.exe differ
index 178e4354e4a3d8427931e5a852479ae2a6763346..2d9a8a6a402ce331527d8178326da7419c23cd0f 100644 (file)
@@ -916,7 +916,7 @@ static BOOL Is2K10PE(void)
     return bRet;\r
 }\r
 \r
-static CHAR GetIMDiskMountLogicalDrive(void)\r
+static CHAR GetIMDiskMountLogicalDrive(const char *suffix)\r
 {\r
     CHAR Letter = 'Y';\r
     DWORD Drives;\r
@@ -929,6 +929,12 @@ static CHAR GetIMDiskMountLogicalDrive(void)
         return 'M';\r
     }\r
 \r
+    //fixed use Z as mountpoint for Lenovo Product Recovery\r
+    if (strcmp(suffix, "VTLRI") == 0)\r
+    {\r
+        return 'Z';\r
+    }\r
+\r
     Drives = GetLogicalDrives();\r
     Log("Drives=0x%x", Drives);\r
     \r
@@ -1073,26 +1079,18 @@ End:
     return rc;\r
 }\r
 \r
-static int VentoyRunImdisk(const char *IsoPath, const char *imdiskexe, const char *opt)\r
+static int VentoyRunImdisk(const char *suffix, const char *IsoPath, const char *imdiskexe, const char *opt)\r
 {\r
     CHAR Letter;\r
     CHAR Cmdline[512];\r
     WCHAR CmdlineW[512];\r
     PROCESS_INFORMATION Pi;\r
 \r
-    Log("VentoyRunImdisk <%s> <%s> <%s>", IsoPath, imdiskexe, opt);\r
+    Log("VentoyRunImdisk <%s> <%s> <%s> <%s>", suffix, IsoPath, imdiskexe, opt);\r
 \r
-    Letter = GetIMDiskMountLogicalDrive();\r
+    Letter = GetIMDiskMountLogicalDrive(suffix);\r
 \r
-    if (opt)\r
-    {\r
-        sprintf_s(Cmdline, sizeof(Cmdline), "%s -a -o %s -f \"%s\" -m %C:", imdiskexe, opt, IsoPath, Letter);\r
-    }\r
-    else\r
-    {\r
-        sprintf_s(Cmdline, sizeof(Cmdline), "%s -a -f \"%s\" -m %C:", imdiskexe, IsoPath, Letter);\r
-    }\r
-    \r
+    sprintf_s(Cmdline, sizeof(Cmdline), "%s -a -o %s -f \"%s\" -m %C:", imdiskexe, opt, IsoPath, Letter);    \r
     Log("mount iso to %C: use imdisk cmd <%s>", Letter, Cmdline);\r
 \r
     if (IsUTF8Encode(IsoPath))\r
@@ -1135,7 +1133,7 @@ int VentoyMountISOByImdisk(const char *IsoPath, DWORD PhyDrive)
 \r
     if (0 == VentoyCopyImdisk(PhyDrive, ImPath))\r
     {\r
-        VentoyRunImdisk(IsoPath, ImPath, "ro");\r
+        VentoyRunImdisk("iso", IsoPath, ImPath, "ro");\r
         rc = 0;\r
     }\r
 \r
@@ -2370,7 +2368,7 @@ static int MountVTLRI(CHAR *ImgPath, DWORD PhyDrive)
 \r
     VentoyCopyImdisk(PhyDrive, ImDiskPath);\r
 \r
-    VentoyRunImdisk(ImgPath, ImDiskPath, "rem");\r
+    VentoyRunImdisk("VTLRI", ImgPath, ImDiskPath, "ro,rem");\r
 \r
     return 0;\r
 }\r