Commit 4df793e0 authored by longpanda's avatar longpanda
Browse files

1. Add new options for Windows CLI mode.

2. Add tip message for 4k native disk.
parent e0132ac4
......@@ -492,7 +492,7 @@ format_ventoy_disk_gpt() {
for i in 0 1 2 3 4 5 6 7 8 9; do
check_umount_disk "$PART2"
if mkfs.vfat -F 16 -n VTOYEFI $PART2; then
if mkfs.vfat -F 16 -n VTOYEFI -s 1 $PART2; then
echo 'success'
break
else
......
No preview for this file type
......@@ -169,8 +169,27 @@ sed 's/.*SCRIPT_DEL_THIS \(.*\)/\1/g' -i $tmpdir/WebUI/index.html
#32MB disk img
dd status=none if=$LOOP of=$tmpdir/ventoy/ventoy.disk.img bs=512 count=$VENTOY_SECTOR_NUM skip=$part2_start_sector
#4k image
# echo "make 4K img ..."
# dd status=none if=/dev/zero of=$tmpdir/ventoy/ventoy_4k.disk.img bs=1M count=32
# mkfs.vfat -F 16 -n VTOYEFI -s 1 -S 4096 $tmpdir/ventoy/ventoy_4k.disk.img
# vDIR1=$(mktemp -d)
# vDIR2=$(mktemp -d)
# mount $tmpdir/ventoy/ventoy.disk.img $vDIR1
# mount $tmpdir/ventoy/ventoy_4k.disk.img $vDIR2
# cp -a $vDIR1/* $vDIR2/
# umount $vDIR1
# umount $vDIR2
# rm -rf $vDIR1 $vDIR2
# xz --check=crc32 $tmpdir/ventoy/ventoy_4k.disk.img
xz --check=crc32 $tmpdir/ventoy/ventoy.disk.img
losetup -d $LOOP && rm -f img.bin
rm -f ventoy-${curver}-linux.tar.gz
......
......@@ -60,6 +60,7 @@
"STR_PART_CLUSTER":"حجم الكتلة",
"STR_PART_CLUSTER_DEFAULT":"القيمة الافتراضية للنظام",
"STR_DONATE":"يتبرع",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
......@@ -124,7 +125,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"Ianə",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -188,6 +190,7 @@
"STR_PART_CLUSTER":"클러스터 크기",
"STR_PART_CLUSTER_DEFAULT":"시스템 기본값",
"STR_DONATE":"기부",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
......@@ -252,6 +255,7 @@
"STR_PART_CLUSTER":"簇大小",
"STR_PART_CLUSTER_DEFAULT":"系统默认值",
"STR_DONATE":"捐助",
"STR_4KN_UNSUPPORTED":"目前 Ventoy 不支持原生 4K 扇区的磁盘。",
"STRXXX":""
},
......@@ -316,7 +320,8 @@
"STR_PART_CLUSTER":"Klynge størrelse",
"STR_PART_CLUSTER_DEFAULT":"System Standard Værdi",
"STR_DONATE":"Donering",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -380,7 +385,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"Donate",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -444,7 +450,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"შემოწირულობა",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX": ""
},
{
......@@ -508,7 +515,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"اهداء",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -572,7 +580,8 @@
"STR_PART_CLUSTER":"Wielkość klastra",
"STR_PART_CLUSTER_DEFAULT":"Wartość domyślna systemu",
"STR_DONATE":"Podarować",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -636,7 +645,8 @@
"STR_PART_CLUSTER":"Tamanho do cluster",
"STR_PART_CLUSTER_DEFAULT":"Valor padrão do sistema",
"STR_DONATE":"Doar",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -700,7 +710,8 @@
"STR_PART_CLUSTER":"Sektör Boyutu",
"STR_PART_CLUSTER_DEFAULT":"Sistem varsayılan değeri",
"STR_DONATE":"Ventoy'a Bağış yap",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -764,7 +775,8 @@
"STR_PART_CLUSTER":"Clustergröße",
"STR_PART_CLUSTER_DEFAULT":"Systemstandardwert",
"STR_DONATE":"Spenden",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -828,7 +840,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"Donate",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -892,7 +905,8 @@
"STR_PART_CLUSTER":"Taille de cluster",
"STR_PART_CLUSTER_DEFAULT":"Valeur par défaut du système",
"STR_DONATE":"Faire un don",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -956,7 +970,8 @@
"STR_PART_CLUSTER":"Velikost clusteru",
"STR_PART_CLUSTER_DEFAULT":"Výchozí hodnota systému",
"STR_DONATE":"Darovat",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1019,7 +1034,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"Darovať",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1083,7 +1099,8 @@
"STR_PART_CLUSTER":"Tamaño de cluster",
"STR_PART_CLUSTER_DEFAULT":"Valor predeterminado del sistema",
"STR_DONATE":"Donar",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1147,7 +1164,8 @@
"STR_PART_CLUSTER":"Tamaño de cluster",
"STR_PART_CLUSTER_DEFAULT":"Valor predeterminado del sistema",
"STR_DONATE":"Donar",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1211,7 +1229,8 @@
"STR_PART_CLUSTER":"Размер кластера:",
"STR_PART_CLUSTER_DEFAULT":"Системное значение по умолчанию",
"STR_DONATE":"Пожертвовать",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1275,7 +1294,8 @@
"STR_PART_CLUSTER":"ক্লাস্টারের আকার",
"STR_PART_CLUSTER_DEFAULT":"সিস্টেমের ডিফল্ট মান",
"STR_DONATE":"দান করুন",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1339,7 +1359,8 @@
"STR_PART_CLUSTER":"क्लस्टर साइज",
"STR_PART_CLUSTER_DEFAULT":"सिस्टम डिफ़ॉल्ट मान",
"STR_DONATE":"दान करें",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1403,6 +1424,7 @@
"STR_PART_CLUSTER":"Clustergrootte",
"STR_PART_CLUSTER_DEFAULT":"Standaardwaarde systeem",
"STR_DONATE":"Doneer",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
......@@ -1467,6 +1489,7 @@
"STR_PART_CLUSTER":"Dimensiunea clusterului",
"STR_PART_CLUSTER_DEFAULT":"Valoarea implicită a sistemului",
"STR_DONATE":"Donează",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
......@@ -1531,7 +1554,8 @@
"STR_PART_CLUSTER":"クラスターサイズ",
"STR_PART_CLUSTER_DEFAULT":"システムのデフォルト値",
"STR_DONATE":"寄付",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1595,7 +1619,8 @@
"STR_PART_CLUSTER":"Dimensione del cluster",
"STR_PART_CLUSTER_DEFAULT":"Valore predefinito di sistema",
"STR_DONATE":"Donare",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1659,7 +1684,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"Donirajte",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1723,7 +1749,8 @@
"STR_PART_CLUSTER":"Klaszter méret",
"STR_PART_CLUSTER_DEFAULT":"Rendszer alapérték",
"STR_DONATE":"Adományoz",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1787,7 +1814,8 @@
"STR_PART_CLUSTER":"簇的大小",
"STR_PART_CLUSTER_DEFAULT":"系統默認值",
"STR_DONATE":"捐助",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1851,7 +1879,8 @@
"STR_PART_CLUSTER":"Veličina klastera",
"STR_PART_CLUSTER_DEFAULT":"Podrazumevana sistemska vrednost",
"STR_DONATE":"Donirajte",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1915,7 +1944,8 @@
"STR_PART_CLUSTER":"Величина кластера",
"STR_PART_CLUSTER_DEFAULT":"Подразумевана системска вредност",
"STR_DONATE":"Донирајте",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -1979,7 +2009,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"บริจาค",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2043,7 +2074,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"donere",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2107,7 +2139,8 @@
"STR_PART_CLUSTER":"Cỡ Cluster",
"STR_PART_CLUSTER_DEFAULT":"Theo mặc định hệ thống",
"STR_DONATE":"Thưởng tác giả",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2171,7 +2204,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"paaukoti",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2235,7 +2269,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"донира",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2299,7 +2334,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"לִתְרוֹם",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2363,7 +2399,8 @@
"STR_PART_CLUSTER":"Tamanho do cluster",
"STR_PART_CLUSTER_DEFAULT":"Valor predefinido do sistema",
"STR_DONATE":"Doar",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2427,7 +2464,8 @@
"STR_PART_CLUSTER":"Ukuran Kelompok",
"STR_PART_CLUSTER_DEFAULT":"Nilai Standar Sistem",
"STR_DONATE":"Donasi sukarela",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2491,7 +2529,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"Donere",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2555,7 +2594,8 @@
"STR_PART_CLUSTER":"Розмір кластера",
"STR_PART_CLUSTER_DEFAULT":"Системне значення за умовчанням",
"STR_DONATE":"Пожертвуйте",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2619,7 +2659,8 @@
"STR_PART_CLUSTER":"Μέγεθος συμπλέγματος",
"STR_PART_CLUSTER_DEFAULT":"Προεπιλεγμένη τιμή συστήματος",
"STR_DONATE":"Προσφέρω",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
......@@ -2684,7 +2725,8 @@
"STR_PART_CLUSTER":"Klusterstorlek",
"STR_PART_CLUSTER_DEFAULT":"Systemets standardvärde",
"STR_DONATE":"Donera",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2748,7 +2790,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"Donirajte",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2812,7 +2855,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"Дарете",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2876,7 +2920,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"Նվիրաբերել",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -2940,7 +2985,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"Lahjoittaa",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -3004,7 +3050,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"Doa",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -3068,7 +3115,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"Donar",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
......@@ -3133,7 +3181,8 @@
"STR_PART_CLUSTER":"Cluster Size",
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
"STR_DONATE":"შემოწირულობა",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -3197,7 +3246,8 @@
"STR_PART_CLUSTER":"கொத்து அளவு",
"STR_PART_CLUSTER_DEFAULT":"கணினி இயல்புநிலை மதிப்பு",
"STR_DONATE":"தானம் செய்",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
},
{
......@@ -3261,6 +3311,7 @@
"STR_PART_CLUSTER":"Памер кластара",
"STR_PART_CLUSTER_DEFAULT":"Сістэмнае значэнне па змаўчанні",
"STR_DONATE":"Ахвяраваць",
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native device.",
"STRXXX":""
}
......
......@@ -137,6 +137,7 @@ typedef struct ventoy_disk
char disk_model[256]; // Sandisk/Kingston ...
char human_readable_size[32];
int is4kn;
int major;
int minor;
int type;
......
......@@ -260,6 +260,33 @@ static int ventoy_is_possible_blkdev(const char *name)
return 1;
}
int ventoy_is_disk_4k_native(const char *disk)
{
int fd;
int rc = 0;
int logsector = 0;
int physector = 0;
char diskpath[256] = {0};
snprintf(diskpath, sizeof(diskpath) - 1, "/dev/%s", disk);
fd = open(diskpath, O_RDONLY | O_BINARY);
if (fd >= 0)
{
ioctl(fd, BLKSSZGET, &logsector);
ioctl(fd, BLKPBSZGET, &physector);
if (logsector == 4096 && physector == 4096)
{
rc = 1;
}
close(fd);
}
vdebug("is 4k native disk <%s> <%d>\n", disk, rc);
return rc;
}
uint64_t ventoy_get_disk_size_in_byte(const char *disk)
{
int fd;
......@@ -591,6 +618,7 @@ int ventoy_get_disk_info(const char *name, ventoy_disk *info)
scnprintf(info->part2_path, "/dev/%s2", name);
}
info->is4kn = ventoy_is_disk_4k_native(name);
info->size_in_byte = ventoy_get_disk_size_in_byte(name);
ventoy_get_disk_devnum(name, &info->major, &info->minor);
......
......@@ -58,6 +58,7 @@
#define VTOY_JSON_NOT_READY_RET "{ \"result\" : \"notready\" }"
#define VTOY_JSON_NOT_SUPPORT_RET "{ \"result\" : \"notsupport\" }"
#define VTOY_JSON_MBR_2TB_RET "{ \"result\" : \"mbr2tb\" }"
#define VTOY_JSON_4KN_RET "{ \"result\" : \"4kn\" }"
#define VTOY_JSON_INVALID_RSV_RET "{ \"result\" : \"reserve_invalid\" }"
#define VTOY_JSON_FILE_NOT_FOUND_RET "{ \"result\" : \"file_not_found\" }"
......
......@@ -579,3 +579,68 @@ int ventoy_fill_mbr(uint64_t size, uint64_t reserve, int align4k, MBR_HEAD *pMBR
return 0;
}
int ventoy_fill_mbr_4k(uint64_t size, uint64_t reserve, int align4k, MBR_HEAD *pMBR)
{
ventoy_guid Guid;
uint32_t DiskSignature;
uint32_t DiskSectorCount;
uint32_t PartSectorCount;
uint32_t PartStartSector;
uint32_t ReservedSector;
VentoyGetLocalBootImg(pMBR);
ventoy_gen_preudo_uuid(&Guid);
memcpy(&DiskSignature, &Guid, sizeof(uint32_t));
vdebug("Disk signature: 0x%08x\n", DiskSignature);
memcpy(pMBR->BootCode + 0x1B8, &DiskSignature, 4);
memcpy(pMBR->BootCode + 0x180, &Guid, 16);
if (size / 4096 > 0xFFFFFFFF)
{
DiskSectorCount = 0xFFFFFFFF;
}
else
{
DiskSectorCount = (uint32_t)(size / 4096);
}
if (reserve <= 0)
{
ReservedSector = 0;
}
else
{
ReservedSector = (uint32_t)(reserve / 4096);
}
// check aligned with 4KB
vdebug("no need to align with 4KB for 4K native disk\n");
vlog("ReservedSector: %u\n", ReservedSector);
//Part1
PartStartSector = VTOYIMG_PART_START_SECTOR >> 3;
PartSectorCount = DiskSectorCount - ReservedSector - VTOYEFI_PART_BYTES / 4096 - PartStartSector;
VentoyFillMBRLocation(size, PartStartSector, PartSectorCount, pMBR->PartTbl);
pMBR->PartTbl[0].Active = 0x80; // bootable
pMBR->PartTbl[0].FsFlag = 0x07; // exFAT/NTFS/HPFS
//Part2
PartStartSector += PartSectorCount;
PartSectorCount = VTOYEFI_PART_BYTES / 4096;
VentoyFillMBRLocation(size, PartStartSector, PartSectorCount, pMBR->PartTbl + 1);
pMBR->PartTbl[1].Active = 0x00;
pMBR->PartTbl[1].FsFlag = 0xEF; // EFI System Partition
pMBR->Byte55 = 0x55;
pMBR->ByteAA = 0xAA;
return 0;
}
......@@ -51,6 +51,7 @@ const char * ventoy_get_local_version(void);
int ventoy_fill_gpt(uint64_t size, uint64_t reserve, int align4k, VTOY_GPT_INFO *gpt);
int ventoy_fill_mbr(uint64_t size, uint64_t reserve, int align4k, MBR_HEAD *pMBR);
int VentoyGetLocalBootImg(MBR_HEAD *pMBR);
int ventoy_fill_mbr_4k(uint64_t size, uint64_t reserve, int align4k, MBR_HEAD *pMBR);
#endif /* __VENTOY_UTIL_H__ */
......@@ -661,6 +661,12 @@ void on_button_install_clicked(GtkWidget *widget, gpointer data)
cur = g_disk_list + active;
if (cur->is4kn)
{
msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "STR_4KN_UNSUPPORTED");
return;
}
if (ventoy_code_get_cur_part_style() == 0 && cur->size_in_byte > 2199023255552ULL)
{
msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "STR_DISK_2TB_MBR_ERROR");
......
......@@ -512,6 +512,14 @@ void Ventoy2DiskWindow::on_ButtonInstall_clicked()
}
cur = g_disk_list + index;
if (cur->is4kn)
{
lang_string("STR_4KN_UNSUPPORTED", msg);
QMessageBox::critical(NULL, title_err, msg);
return;
}
if (ventoy_code_get_cur_part_style() == 0 && cur->size_in_byte > 2199023255552ULL)
{
lang_string("STR_DISK_2TB_MBR_ERROR", msg);
......
......@@ -1122,6 +1122,13 @@ static int ventoy_api_install(struct mg_connection *conn, VTOY_JSON *json)
return 0;
}
if (disk->is4kn)
{
vlog("disk %s is 4k native, not supported.\n", diskname);
ventoy_json_result(conn, VTOY_JSON_4KN_RET);
return 0;
}
scnprintf(path, "/sys/block/%s", diskname);
if (access(path, F_OK) < 0)
{
......
......@@ -761,6 +761,8 @@
vtoy_in_progress = true;
progressDisableItem(vtoy_in_progress);
queryProgress(1);
}else if (data.result === '4kn') {
ventoy_display_alert('error', vtoy_cur_language.STR_4KN_UNSUPPORTED);
} else {
ventoy_display_alert('error', vtoy_cur_language.STR_INSTALL_FAILED);
}
......
......@@ -86,9 +86,10 @@ build_func() {
}
build_func "gcc" '64' 'x86_64' 'gtk2'
build_func "gcc" '64' 'x86_64' 'gtk3'
build_func "gcc" '64' 'x86_64' 'gtk2'
build_func "gcc -m32" '32' 'i386' 'gtk2'
build_func "gcc -m32" '32' 'i386' 'gtk3'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment