mirror of
				https://github.com/pbatard/rufus.git
				synced 2024-08-14 23:57:05 +00:00 
			
		
		
		
	[ext2fs] set a minimum ext partition size of 256 MB
* Not gonna bother with computing the effective minimum size so 256 MB will have to do. * Closes #1576
This commit is contained in:
		
							parent
							
								
									68a5a26956
								
							
						
					
					
						commit
						e6ac3782fe
					
				
					 4 changed files with 21 additions and 7 deletions
				
			
		
							
								
								
									
										12
									
								
								src/rufus.c
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								src/rufus.c
									
										
									
									
									
								
							|  | @ -500,7 +500,7 @@ static BOOL SetFileSystemAndClusterSize(char* fs_name) | ||||||
| 		SelectedDrive.ClusterSize[FS_UDF].Default = 1; | 		SelectedDrive.ClusterSize[FS_UDF].Default = 1; | ||||||
| 
 | 
 | ||||||
| 		// ext2/ext3/ext4
 | 		// ext2/ext3/ext4
 | ||||||
| 		if (advanced_mode_format) { | 		if (advanced_mode_format && (SelectedDrive.DiskSize >= MIN_EXT_SIZE)) { | ||||||
| 			SelectedDrive.ClusterSize[FS_EXT2].Allowed = SINGLE_CLUSTERSIZE_DEFAULT; | 			SelectedDrive.ClusterSize[FS_EXT2].Allowed = SINGLE_CLUSTERSIZE_DEFAULT; | ||||||
| 			SelectedDrive.ClusterSize[FS_EXT2].Default = 1; | 			SelectedDrive.ClusterSize[FS_EXT2].Default = 1; | ||||||
| 			SelectedDrive.ClusterSize[FS_EXT3].Allowed = SINGLE_CLUSTERSIZE_DEFAULT; | 			SelectedDrive.ClusterSize[FS_EXT3].Allowed = SINGLE_CLUSTERSIZE_DEFAULT; | ||||||
|  | @ -2280,6 +2280,16 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA | ||||||
| 					static_sprintf(tmp, "0 (%s)", lmprintf(MSG_124)); | 					static_sprintf(tmp, "0 (%s)", lmprintf(MSG_124)); | ||||||
| 					app_changed_size = TRUE; | 					app_changed_size = TRUE; | ||||||
| 					SetWindowTextU(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), tmp); | 					SetWindowTextU(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), tmp); | ||||||
|  | 				} else if (persistence_size < MIN_EXT_SIZE) { | ||||||
|  | 					persistence_size = MIN_EXT_SIZE; | ||||||
|  | 					uint64_t pos = persistence_size / MB; | ||||||
|  | 					for (i = 0; i < persistence_unit_selection; i++) | ||||||
|  | 						pos /= 1024; | ||||||
|  | 					lPos = (LONG)pos; | ||||||
|  | 					SendMessage(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SLIDER), TBM_SETPOS, TRUE, lPos); | ||||||
|  | 					static_sprintf(tmp, "%ld", lPos); | ||||||
|  | 					app_changed_size = TRUE; | ||||||
|  | 					SetWindowTextU(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), tmp); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			break; | 			break; | ||||||
|  |  | ||||||
|  | @ -62,6 +62,7 @@ | ||||||
| #define DRIVE_INDEX_MAX             0x000000C0 | #define DRIVE_INDEX_MAX             0x000000C0 | ||||||
| #define MIN_DRIVE_SIZE              8			// Minimum size a drive must have, to be formattable (in MB)
 | #define MIN_DRIVE_SIZE              8			// Minimum size a drive must have, to be formattable (in MB)
 | ||||||
| #define MIN_EXTRA_PART_SIZE         (1024*1024)	// Minimum size of the extra partition, in bytes
 | #define MIN_EXTRA_PART_SIZE         (1024*1024)	// Minimum size of the extra partition, in bytes
 | ||||||
|  | #define MIN_EXT_SIZE                (256*1024*1024)	// Minimum size we allow for ext formatting
 | ||||||
| #define MAX_ARCHS                   9			// Number of arhitectures we recognize
 | #define MAX_ARCHS                   9			// Number of arhitectures we recognize
 | ||||||
| #define MAX_DRIVES                  (DRIVE_INDEX_MAX - DRIVE_INDEX_MIN) | #define MAX_DRIVES                  (DRIVE_INDEX_MAX - DRIVE_INDEX_MIN) | ||||||
| #define MAX_TOOLTIPS                128 | #define MAX_TOOLTIPS                128 | ||||||
|  |  | ||||||
							
								
								
									
										10
									
								
								src/rufus.rc
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								src/rufus.rc
									
										
									
									
									
								
							|  | @ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL | ||||||
| IDD_DIALOG DIALOGEX 12, 12, 232, 326 | IDD_DIALOG DIALOGEX 12, 12, 232, 326 | ||||||
| STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||||
| EXSTYLE WS_EX_ACCEPTFILES | EXSTYLE WS_EX_ACCEPTFILES | ||||||
| CAPTION "Rufus 3.12.1704" | CAPTION "Rufus 3.12.1706" | ||||||
| FONT 9, "Segoe UI Symbol", 400, 0, 0x0 | FONT 9, "Segoe UI Symbol", 400, 0, 0x0 | ||||||
| BEGIN | BEGIN | ||||||
|     LTEXT           "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP |     LTEXT           "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP | ||||||
|  | @ -395,8 +395,8 @@ END | ||||||
| // | // | ||||||
| 
 | 
 | ||||||
| VS_VERSION_INFO VERSIONINFO | VS_VERSION_INFO VERSIONINFO | ||||||
|  FILEVERSION 3,12,1704,0 |  FILEVERSION 3,12,1706,0 | ||||||
|  PRODUCTVERSION 3,12,1704,0 |  PRODUCTVERSION 3,12,1706,0 | ||||||
|  FILEFLAGSMASK 0x3fL |  FILEFLAGSMASK 0x3fL | ||||||
| #ifdef _DEBUG | #ifdef _DEBUG | ||||||
|  FILEFLAGS 0x1L |  FILEFLAGS 0x1L | ||||||
|  | @ -414,13 +414,13 @@ BEGIN | ||||||
|             VALUE "Comments", "https://rufus.ie" |             VALUE "Comments", "https://rufus.ie" | ||||||
|             VALUE "CompanyName", "Akeo Consulting" |             VALUE "CompanyName", "Akeo Consulting" | ||||||
|             VALUE "FileDescription", "Rufus" |             VALUE "FileDescription", "Rufus" | ||||||
|             VALUE "FileVersion", "3.12.1704" |             VALUE "FileVersion", "3.12.1706" | ||||||
|             VALUE "InternalName", "Rufus" |             VALUE "InternalName", "Rufus" | ||||||
|             VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)" |             VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)" | ||||||
|             VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" |             VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" | ||||||
|             VALUE "OriginalFilename", "rufus-3.12.exe" |             VALUE "OriginalFilename", "rufus-3.12.exe" | ||||||
|             VALUE "ProductName", "Rufus" |             VALUE "ProductName", "Rufus" | ||||||
|             VALUE "ProductVersion", "3.12.1704" |             VALUE "ProductVersion", "3.12.1706" | ||||||
|         END |         END | ||||||
|     END |     END | ||||||
|     BLOCK "VarFileInfo" |     BLOCK "VarFileInfo" | ||||||
|  |  | ||||||
							
								
								
									
										5
									
								
								src/ui.c
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								src/ui.c
									
										
									
									
									
								
							|  | @ -671,7 +671,7 @@ void ToggleAdvancedFormatOptions(BOOL enable) | ||||||
| 	InvalidateRect(hMainDialog, NULL, TRUE); | 	InvalidateRect(hMainDialog, NULL, TRUE); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // Toggle the display of peristence unit dropdown and resize the size field
 | // Toggle the display of persistence unit dropdown and resize the size field
 | ||||||
| void TogglePersistenceControls(BOOL display) | void TogglePersistenceControls(BOOL display) | ||||||
| { | { | ||||||
| 	RECT rc; | 	RECT rc; | ||||||
|  | @ -747,12 +747,15 @@ void SetPersistenceSize(void) | ||||||
| 			persistence_unit_selection = proposed_unit_selection; | 			persistence_unit_selection = proposed_unit_selection; | ||||||
| 
 | 
 | ||||||
| 		IGNORE_RETVAL(ComboBox_SetCurSel(hCtrl, persistence_unit_selection)); | 		IGNORE_RETVAL(ComboBox_SetCurSel(hCtrl, persistence_unit_selection)); | ||||||
|  | 		if ((pos != 0) && (pos < MIN_EXT_SIZE)) | ||||||
|  | 			pos = MIN_EXT_SIZE; | ||||||
| 		pos /= MB; | 		pos /= MB; | ||||||
| 		max /= MB; | 		max /= MB; | ||||||
| 		for (i = 0; i < persistence_unit_selection; i++) { | 		for (i = 0; i < persistence_unit_selection; i++) { | ||||||
| 			pos /= 1024; | 			pos /= 1024; | ||||||
| 			max /= 1024; | 			max /= 1024; | ||||||
| 		} | 		} | ||||||
|  | 
 | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	hCtrl = GetDlgItem(hMainDialog, IDC_PERSISTENCE_SLIDER); | 	hCtrl = GetDlgItem(hMainDialog, IDC_PERSISTENCE_SLIDER); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue