]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
bug fix
authorlongpanda <admin@ventoy.net>
Wed, 8 Apr 2020 14:44:14 +0000 (22:44 +0800)
committerlongpanda <admin@ventoy.net>
Wed, 8 Apr 2020 14:44:17 +0000 (22:44 +0800)
IMG/cpio/sbin/init
IMG/mkcpio.sh
INSTALL/Ventoy2Disk.exe
INSTALL/grub/grub.cfg
INSTALL/ventoy/ipxe.krn
INSTALL/ventoy/ventoy.cpio
IPXE/ipxe-3fe683e/src/arch/x86/core/ventoy_vdisk.c
Ventoy2Disk/Ventoy2Disk/Language.c
Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.c
Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.rc
Ventoy2Disk/Ventoy2Disk/WinDialog.c

index 3a4a6ab94c40c51a6d3aa97735a3c34812969210..ef7b5d6d1a2df5a3830870362ae3abb0b2fcd60d 100644 (file)
@@ -41,8 +41,8 @@ $BUSYBOX_PATH/busybox --install $BUSYBOX_PATH
 
 export PATH=$BUSYBOX_PATH/:$VTOY_PATH/tool
 
-export VTOY_BREAK_LEVEL=$(hexdump -n 1 -s 429 -e '1/1 "%02x"' $VTOY_PATH/ventoy_os_param)
-export VTOY_DEBUG_LEVEL=$(hexdump -n 1 -s 430 -e '1/1 "%02x"' $VTOY_PATH/ventoy_os_param)
+export VTOY_BREAK_LEVEL=$(hexdump -n 1 -s 449 -e '1/1 "%02x"' $VTOY_PATH/ventoy_os_param)
+export VTOY_DEBUG_LEVEL=$(hexdump -n 1 -s 450 -e '1/1 "%02x"' $VTOY_PATH/ventoy_os_param)
 
 #Fixme: busybox shell output redirect seems to have some bug in rhel5
 if uname -a | grep -q el5; then
index 517b55c41ce5486c0827566504ebb766288865ab..a6ac06c83bda6299b96560ff616978b4661b4d72 100644 (file)
@@ -2,6 +2,12 @@
 
 VENTOY_PATH=$PWD/../
 
+if [ -e check.sh ]; then
+    if ! sh check.sh; then
+        exit 1
+    fi
+fi
+
 rm -f ventoy.cpio
 
 chmod -R 777 cpio
index 38d912e6d5c476b56898e621f4fb7d8ccd6bec75..8fdae8e17e0062089d674367919584522194f870 100644 (file)
Binary files a/INSTALL/Ventoy2Disk.exe and b/INSTALL/Ventoy2Disk.exe differ
index 444a337a517f42dbf40987502946011a247b95eb..d89f45e0c242a96d18daeb5e0915ca777d0fb8f4 100644 (file)
@@ -144,8 +144,12 @@ function uefi_iso_menu_func {
         loopback -d loop
     fi
 
-    unset LoadIsoEfiDriver
-   
+    if [ -n "$vtisouefi" ]; then
+        set LoadIsoEfiDriver=on
+    else
+        unset LoadIsoEfiDriver
+    fi
+
     vt_chosen_img_path chosen_path
 
     if vt_is_udf ${1}${chosen_path}; then
@@ -302,7 +306,7 @@ function legacy_iso_menu_func {
 #############################################################
 #############################################################
 
-set VENTOY_VERSION="1.0.01"
+set VENTOY_VERSION="1.0.02"
 
 #disable timeout
 unset timeout
index 61a863756acc38d4fcf5568da1f4c440c8022295..4b0514d7b534557dfb2e6f930879f95ead28725e 100644 (file)
Binary files a/INSTALL/ventoy/ipxe.krn and b/INSTALL/ventoy/ipxe.krn differ
index 48b4fafe998d8291ad8bceb6515c04a256e57bbe..5dfd6c4988850c233bdb8b79a2594ec3e65888a4 100644 (file)
Binary files a/INSTALL/ventoy/ventoy.cpio and b/INSTALL/ventoy/ventoy.cpio differ
index b283b0878c20a3fcc1ba6a77a3d5bf0097fa13bf..fd02bb91d57bc678adf641bc9406d64b774c0468 100644 (file)
@@ -361,6 +361,7 @@ static void ventoy_dump_chain(ventoy_chain_head *chain)
     uint32_t i = 0;
     uint8_t chksum = 0;
     uint8_t *guid;
+    uint8_t *vtoy_reserve;
     
     guid = chain->os_param.vtoy_disk_guid;
     for (i = 0; i < sizeof(ventoy_os_param); i++)
@@ -368,6 +369,8 @@ static void ventoy_dump_chain(ventoy_chain_head *chain)
         chksum += *((uint8_t *)(&(chain->os_param)) + i);
     }
 
+    vtoy_reserve = (uint8_t *)(chain->os_param.vtoy_reserved);
+
     printf("##################### ventoy_dump_chain #######################\n");
 
     printf("os_param will be save at %p\n", ventoy_get_runtime_addr());
@@ -379,6 +382,8 @@ static void ventoy_dump_chain(ventoy_chain_head *chain)
     printf("os_param->vtoy_disk_part_type=%u\n",  chain->os_param.vtoy_disk_part_type);
     printf("os_param->vtoy_img_path=<%s>\n",      chain->os_param.vtoy_img_path);
     printf("os_param->vtoy_img_size=<%llu>\n",    chain->os_param.vtoy_img_size);
+    printf("os_param->vtoy_reserve[0]=<%u>\n",    vtoy_reserve[0]);
+    printf("os_param->vtoy_reserve[1]=<%u>\n",    vtoy_reserve[1]);
     printf("os_param->vtoy_img_location_addr=<0x%llx>\n", chain->os_param.vtoy_img_location_addr);
     printf("os_param->vtoy_img_location_len=<%u>\n",   chain->os_param.vtoy_img_location_len);
     ventoy_debug_pause();
index 66a1e56e6fe62a30adfa460989eff558c2d4c86b..023158d5536db401ebb3af7107434d640452168b 100644 (file)
@@ -38,9 +38,9 @@ const TCHAR * g_Str_English[STR_ID_MAX] =
     TEXT("The disk will be formatted and all the data will be lost.\r\nContinue?"),
     TEXT("The disk will be formatted and all the data will be lost.\r\nContinue? (Double Check)"),
     TEXT("Congratulations!\r\nVentoy has been successfully installed to the device."),
-    TEXT("An error occurred during the installation. You can try again and check log.txt for detail."),
+    TEXT("An error occurred during the installation. You can replug the USB and try again. Check log.txt for detail."),
     TEXT("Congratulations!\r\nVentoy has been successfully updated to the device."),
-    TEXT("An error occurred during the update. You can try again and check log.txt for detail."),
+    TEXT("An error occurred during the update. You can replug the USB and try again. Check log.txt for detail."),
 
     TEXT("A thread is running, please wait..."),
 };
@@ -61,9 +61,9 @@ const TCHAR * g_Str_ChineseSimple[STR_ID_MAX] =
     TEXT("´ÅÅ̻ᱻ¸ñʽ»¯, ËùÓÐÊý¾Ý¶¼»á¶ªÊ§!\r\nÊÇ·ñ¼ÌÐø£¿"),
     TEXT("´ÅÅ̻ᱻ¸ñʽ»¯, ËùÓÐÊý¾Ý¶¼»á¶ªÊ§!\r\nÔÙ´ÎÈ·ÈÏÊÇ·ñ¼ÌÐø£¿"),
     TEXT("¹§Ï²Äã! Ventoy ÒѾ­³É¹¦°²×°µ½´ËÉ豸ÖÐ."),
-    TEXT("°²×° Ventoy ¹ý³ÌÖз¢Éú´íÎó. Äã¿ÉÒÔÖØÊÔÒ»´Î, ÏêϸÐÅÏ¢Çë²éÔÄ log.txt Îļþ."),
+    TEXT("°²×° Ventoy ¹ý³ÌÖз¢Éú´íÎó. Äã¿ÉÒÔÖØÐ°βåÒ»ÏÂUÅÌÈ»ºóÖØÊÔÒ»´Î, ÏêϸÐÅÏ¢Çë²éÔÄ log.txt Îļþ."),
     TEXT("¹§Ï²Äã! Ð°汾µÄ Ventoy ÒѾ­³É¹¦¸üе½´ËÉ豸ÖÐ."),
-    TEXT("¸üРVentoy ¹ý³ÌÖÐÓöµ½´íÎó. Äã¿ÉÒÔÖØÊÔÒ»´Î, ÏêϸÐÅÏ¢Çë²éÔÄ log.txt Îļþ."),
+    TEXT("¸üРVentoy ¹ý³ÌÖÐÓöµ½´íÎó. Äã¿ÉÒÔÖØÐ°βåÒ»ÏÂUÅÌÈ»ºóÖØÊÔÒ»´Î, ÏêϸÐÅÏ¢Çë²éÔÄ log.txt Îļþ."),
 
     TEXT("µ±Ç°ÓÐÈÎÎñÕýÔÚÔËÐÐ, ÇëµÈ´ý..."),
 };
index f6f77342aed421585f2036abe653dac2e929afeb..a3dfb776864a1278ffa9907f41dd074b0d1f40d8 100644 (file)
@@ -25,7 +25,7 @@
 
 PHY_DRIVE_INFO *g_PhyDriveList = NULL;
 DWORD g_PhyDriveCount = 0;
-static int g_FilterRemovable = 1;
+static int g_FilterRemovable = 0;
 static int g_FilterUSB = 1;
 int g_ForceOperation = 1;
 
@@ -41,11 +41,8 @@ int ParseCmdLineOption(LPSTR lpCmdLine)
 
     for (i = 0; i < __argc; i++)
     {
-        if (strncmp(__argv[i], "-R", 2) == 0)
-        {
-            g_FilterRemovable = 0;
-        }
-        else if (strncmp(__argv[i], "-U", 2) == 0)
+        if (strncmp(__argv[i], "-U", 2) == 0 ||
+                       strncmp(__argv[i], "-u", 2) == 0)
         {
             g_FilterUSB = 0;
         }
@@ -58,11 +55,6 @@ int ParseCmdLineOption(LPSTR lpCmdLine)
     GetCurrentDirectoryA(sizeof(cfgfile), cfgfile);
     strcat_s(cfgfile, sizeof(cfgfile), "\\Ventoy2Disk.ini");
 
-    if (0 == GetPrivateProfileIntA("Filter", "Removable", 1, cfgfile))
-    {
-        g_FilterRemovable = 0;
-    }
-
     if (0 == GetPrivateProfileIntA("Filter", "USB", 1, cfgfile))
     {
         g_FilterUSB = 0;
@@ -258,6 +250,30 @@ PHY_DRIVE_INFO * GetPhyDriveInfoById(int Id)
     return NULL;
 }
 
+int SortPhysicalDrive(PHY_DRIVE_INFO *pDriveList, DWORD DriveCount)
+{
+       DWORD i, j;
+       PHY_DRIVE_INFO TmpDriveInfo;
+
+       for (i = 0; i < DriveCount; i++)
+       {
+               for (j = i + 1; j < DriveCount; j++)
+               {
+                       if (pDriveList[i].BusType == BusTypeUsb && pDriveList[j].BusType == BusTypeUsb)
+                       {
+                               if (pDriveList[i].RemovableMedia == FALSE && pDriveList[j].RemovableMedia == TRUE)
+                               {
+                                       memcpy(&TmpDriveInfo, pDriveList + i, sizeof(PHY_DRIVE_INFO));
+                                       memcpy(pDriveList + i, pDriveList + j, sizeof(PHY_DRIVE_INFO));
+                                       memcpy(pDriveList + j, &TmpDriveInfo, sizeof(PHY_DRIVE_INFO));
+                               }
+                       }
+               }
+       }
+
+       return 0;
+}
+
 int Ventoy2DiskInit(void)
 {
     g_PhyDriveList = (PHY_DRIVE_INFO *)malloc(sizeof(PHY_DRIVE_INFO)* VENTOY_MAX_PHY_DRIVE);
@@ -269,6 +285,9 @@ int Ventoy2DiskInit(void)
     memset(g_PhyDriveList, 0, sizeof(PHY_DRIVE_INFO)* VENTOY_MAX_PHY_DRIVE);
 
     GetAllPhysicalDriveInfo(g_PhyDriveList, &g_PhyDriveCount);
+
+       SortPhysicalDrive(g_PhyDriveList, g_PhyDriveCount);
+
     FilterPhysicalDrive(g_PhyDriveList, g_PhyDriveCount);
 
     return 0;
index 1f393adc812307dc4d16c0ace8cc4fba966deeaf..d38afb0fe4c9b0788df4bf2b46d1b191af617cad 100644 (file)
Binary files a/Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.rc and b/Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.rc differ
index 7ee81350fa539aaf44c5733a9d64c2c2cbe19a8e..d531b4563ce414b065bb2d45482ed6fd89458299 100644 (file)
@@ -213,6 +213,16 @@ static DWORD WINAPI InstallVentoyThread(void* Param)
     PHY_DRIVE_INFO *pPhyDrive = (PHY_DRIVE_INFO *)Param;
 
     rc = InstallVentoy2PhyDrive(pPhyDrive);
+       if (rc)
+       {
+               Log("This time install failed, now wait and retry...");
+               Sleep(10000);
+
+               Log("Now retry to install...");
+
+               rc = InstallVentoy2PhyDrive(pPhyDrive);
+       }
+
     if (rc == 0)
     {
                PROGRESS_BAR_SET_POS(PT_FINISH);
@@ -239,6 +249,16 @@ static DWORD WINAPI UpdateVentoyThread(void* Param)
     PHY_DRIVE_INFO *pPhyDrive = (PHY_DRIVE_INFO *)Param;
 
     rc = UpdateVentoy2PhyDrive(pPhyDrive);
+       if (rc)
+       {
+               Log("This time update failed, now wait and retry...");
+               Sleep(10000);
+
+               Log("Now retry to update...");
+
+               rc = UpdateVentoy2PhyDrive(pPhyDrive);
+       }
+
     if (rc == 0)
     {
                PROGRESS_BAR_SET_POS(PT_FINISH);