]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Fix a bug for Linux GUI program when update from old release. (#1590)
authorlongpanda <admin@ventoy.net>
Tue, 26 Apr 2022 06:49:07 +0000 (14:49 +0800)
committerlongpanda <admin@ventoy.net>
Tue, 26 Apr 2022 06:49:07 +0000 (14:49 +0800)
15 files changed:
INSTALL/tool/aarch64/V2DServer
INSTALL/tool/aarch64/Ventoy2Disk.gtk3
INSTALL/tool/aarch64/Ventoy2Disk.qt5
INSTALL/tool/i386/V2DServer
INSTALL/tool/i386/Ventoy2Disk.gtk2
INSTALL/tool/i386/Ventoy2Disk.gtk3
INSTALL/tool/i386/Ventoy2Disk.qt5
INSTALL/tool/mips64el/V2DServer
INSTALL/tool/mips64el/Ventoy2Disk.gtk3
INSTALL/tool/mips64el/Ventoy2Disk.qt5
INSTALL/tool/x86_64/V2DServer
INSTALL/tool/x86_64/Ventoy2Disk.gtk2
INSTALL/tool/x86_64/Ventoy2Disk.gtk3
INSTALL/tool/x86_64/Ventoy2Disk.qt5
LinuxGUI/Ventoy2Disk/Web/ventoy_http.c

index f4e4873374bb600d55cca20b395b5b570db9dd2b..03ce6438942744699c9ac05f26cd6bc32223b48e 100644 (file)
Binary files a/INSTALL/tool/aarch64/V2DServer and b/INSTALL/tool/aarch64/V2DServer differ
index db03db5ec092c073ed9d2bbe7e34ea149d1c5748..e42d6241977e4aa7d45d865fc6eaea287a3de1ad 100644 (file)
Binary files a/INSTALL/tool/aarch64/Ventoy2Disk.gtk3 and b/INSTALL/tool/aarch64/Ventoy2Disk.gtk3 differ
index 4b8493966a833d1d7768c686cf1d469391247365..009a1877c68f40c4735cdf1c932d2dc62df27467 100644 (file)
Binary files a/INSTALL/tool/aarch64/Ventoy2Disk.qt5 and b/INSTALL/tool/aarch64/Ventoy2Disk.qt5 differ
index fe154acd1060e89d40a17959de404e51352a671e..deb103379fd412a31cb8b1e7e3e0752d58b6acf8 100644 (file)
Binary files a/INSTALL/tool/i386/V2DServer and b/INSTALL/tool/i386/V2DServer differ
index f7317c5918c88f483fe101fa351e98dfff34e317..774f5d3267628fb5310a36c759bd82d0b9db2db5 100644 (file)
Binary files a/INSTALL/tool/i386/Ventoy2Disk.gtk2 and b/INSTALL/tool/i386/Ventoy2Disk.gtk2 differ
index 938d6808e41bd3415fbc6d17ff410c2e7f4b06df..6116798710c512de4f36a53702f143e9094a834b 100644 (file)
Binary files a/INSTALL/tool/i386/Ventoy2Disk.gtk3 and b/INSTALL/tool/i386/Ventoy2Disk.gtk3 differ
index e46494e632ec9f4c6578ca3dfc3dd04eed3d51cb..b1c226d90f5f85ec84d8dd13672249ea17fe554f 100644 (file)
Binary files a/INSTALL/tool/i386/Ventoy2Disk.qt5 and b/INSTALL/tool/i386/Ventoy2Disk.qt5 differ
index 14be9acf0e51623ceb2fd3961e50b8c928f407dc..38eca27ccb1495b359b4b366a420bc785c5d21b9 100644 (file)
Binary files a/INSTALL/tool/mips64el/V2DServer and b/INSTALL/tool/mips64el/V2DServer differ
index 540a93bac801613fd4af878c5a6d864e1d5ac7fb..83ced17043d3a081d6f894e26d8c94a5fb97c848 100644 (file)
Binary files a/INSTALL/tool/mips64el/Ventoy2Disk.gtk3 and b/INSTALL/tool/mips64el/Ventoy2Disk.gtk3 differ
index 03cc6bfb47ce767de62e83ea431d28baa350a530..d3c827ea38f865e0252130cf8f419048521cb7d5 100644 (file)
Binary files a/INSTALL/tool/mips64el/Ventoy2Disk.qt5 and b/INSTALL/tool/mips64el/Ventoy2Disk.qt5 differ
index 492a0e972600476207242985ee5a343e87c0dee8..0bd0a4e0acb87af04841091dfe88cd6c26e9fdd7 100644 (file)
Binary files a/INSTALL/tool/x86_64/V2DServer and b/INSTALL/tool/x86_64/V2DServer differ
index 7180adcecd53dd65000f314662cd372730a0a362..20ca6b3ee73934ca9cd4f0802a31a3349ac5691b 100644 (file)
Binary files a/INSTALL/tool/x86_64/Ventoy2Disk.gtk2 and b/INSTALL/tool/x86_64/Ventoy2Disk.gtk2 differ
index 8e4b11449f8b8143b01f92552ea0dccd76f73688..4d41ef294f0f75aee61d1aa58a4396cea0638fb2 100644 (file)
Binary files a/INSTALL/tool/x86_64/Ventoy2Disk.gtk3 and b/INSTALL/tool/x86_64/Ventoy2Disk.gtk3 differ
index 3bef337bfe6b52d13bdc4b3c0496032a628e061e..40becccf91a5e7ddcf9e5fd2ef6d272fc56573f3 100644 (file)
Binary files a/INSTALL/tool/x86_64/Ventoy2Disk.qt5 and b/INSTALL/tool/x86_64/Ventoy2Disk.qt5 differ
index 31131578f74c6b3d581dddddb62fe8a54de9b3b3..8344b05d8577da418350ff031aedb9d7e2819422 100644 (file)
@@ -685,6 +685,7 @@ static int ventoy_write_gpt_part_table(int fd, uint64_t disksize, VTOY_GPT_INFO
 static void * ventoy_update_thread(void *data)
 {
     int fd;
+    int updateMBR;
     ssize_t len;
     off_t offset;
     MBR_HEAD MBR;
@@ -742,17 +743,32 @@ static void * ventoy_update_thread(void *data)
     len = write(fd, disk->vtoydata.rsvdata, sizeof(disk->vtoydata.rsvdata));
     vlog("Writing reserve data offset:%llu len:%llu ...\n", (_ull)offset, (_ull)len);
 
+    updateMBR = 0;
     memcpy(&MBR, &(disk->vtoydata.gptinfo.MBR), 512);
+    
     if (disk->vtoydata.partition_style == 0 && MBR.PartTbl[0].Active == 0)
     {
         MBR.PartTbl[0].Active = 0x80;
         MBR.PartTbl[1].Active = 0;
         MBR.PartTbl[2].Active = 0;
         MBR.PartTbl[3].Active = 0;
-    
+        updateMBR = 1;
+        vlog("set MBR partition 1 active flag enabled\n");
+    }
+
+    if (MBR.BootCode[0x190] != 0x56 || MBR.BootCode[0x191] != 0x54)
+    {
+        vlog("set VT data %02x %02x\n", MBR.BootCode[0x190], MBR.BootCode[0x191]);
+        MBR.BootCode[0x190] = 0x56;
+        MBR.BootCode[0x191] = 0x54;
+        updateMBR = 1;
+    }
+
+    if (updateMBR)
+    {
         offset = lseek(fd, 0, SEEK_SET);
         len = write(fd, &MBR, 512);
-        vlog("set MBR partition 1 active flag enabled offset:%llu len:%llu\n", (_ull)offset, (_ull)len);
+        vlog("update MBR offset:%llu len:%llu\n", (_ull)offset, (_ull)len);
     }
     
     g_current_progress = PT_SYNC_DATA1;