mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[iso] add exception for Mint's LMDE
* Mint have decided to make their installation rely on a working /live/ ➔ /casper/ symlink for LMDE thereby breaking the promise of File System Transposition that all Debian derivatives should have. * Because of this, trying to use FAT32 with LMDE will fail, as reported in linuxmint/live-installer#152. * Therefore, now that we can replicate symlinks on NTFS, we add an exception to always enforce the use of NTFS for LMDE.
This commit is contained in:
parent
e9d588a6e0
commit
1630e912d4
4 changed files with 90 additions and 78 deletions
122
src/iso.c
122
src/iso.c
|
@ -464,6 +464,62 @@ static void fix_config(const char* psz_fullpath, const char* psz_path, const cha
|
|||
free(src);
|
||||
}
|
||||
|
||||
// This updates the MD5SUMS/md5sum.txt file that some distros (Ubuntu, Mint...)
|
||||
// use to validate the media. Because we may alter some of the validated files
|
||||
// to add persistence and whatnot, we need to alter the MD5 list as a result.
|
||||
// The format of the file is expected to always be "<MD5SUM> <FILE_PATH>" on
|
||||
// individual lines.
|
||||
static void update_md5sum(void)
|
||||
{
|
||||
BOOL display_header = TRUE;
|
||||
intptr_t pos;
|
||||
uint32_t i, j, size, md5_size;
|
||||
uint8_t* buf = NULL, sum[16];
|
||||
char md5_path[64], * md5_data = NULL, * str_pos;
|
||||
|
||||
if (!img_report.has_md5sum)
|
||||
goto out;
|
||||
|
||||
assert(img_report.has_md5sum <= ARRAYSIZE(md5sum_name));
|
||||
if (img_report.has_md5sum > ARRAYSIZE(md5sum_name))
|
||||
goto out;
|
||||
|
||||
static_sprintf(md5_path, "%s\\%s", psz_extract_dir, md5sum_name[img_report.has_md5sum - 1]);
|
||||
md5_size = read_file(md5_path, (uint8_t**)&md5_data);
|
||||
if (md5_size == 0)
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < modified_path.Index; i++) {
|
||||
str_pos = strstr(md5_data, &modified_path.String[i][2]);
|
||||
if (str_pos == NULL)
|
||||
// File is not listed in md5 sums
|
||||
continue;
|
||||
if (display_header) {
|
||||
uprintf("Updating %s:", md5_path);
|
||||
display_header = FALSE;
|
||||
}
|
||||
uprintf("● %s", &modified_path.String[i][2]);
|
||||
pos = str_pos - md5_data;
|
||||
size = read_file(modified_path.String[i], &buf);
|
||||
if (size == 0)
|
||||
continue;
|
||||
HashBuffer(HASH_MD5, buf, size, sum);
|
||||
free(buf);
|
||||
while ((pos > 0) && (md5_data[pos - 1] != '\n'))
|
||||
pos--;
|
||||
for (j = 0; j < 16; j++) {
|
||||
md5_data[pos + 2 * j] = ((sum[j] >> 4) < 10) ? ('0' + (sum[j] >> 4)) : ('a' - 0xa + (sum[j] >> 4));
|
||||
md5_data[pos + 2 * j + 1] = ((sum[j] & 15) < 10) ? ('0' + (sum[j] & 15)) : ('a' - 0xa + (sum[j] & 15));
|
||||
}
|
||||
}
|
||||
|
||||
write_file(md5_path, md5_data, md5_size);
|
||||
free(md5_data);
|
||||
|
||||
out:
|
||||
StrArrayDestroy(&modified_path);
|
||||
}
|
||||
|
||||
static void print_extracted_file(char* psz_fullpath, uint64_t file_length)
|
||||
{
|
||||
size_t nul_pos;
|
||||
|
@ -644,62 +700,6 @@ out:
|
|||
return 1;
|
||||
}
|
||||
|
||||
// This updates the MD5SUMS/md5sum.txt file that some distros (Ubuntu, Mint...)
|
||||
// use to validate the media. Because we may alter some of the validated files
|
||||
// to add persistence and whatnot, we need to alter the MD5 list as a result.
|
||||
// The format of the file is expected to always be "<MD5SUM> <FILE_PATH>" on
|
||||
// individual lines.
|
||||
static void update_md5sum(void)
|
||||
{
|
||||
BOOL display_header = TRUE;
|
||||
intptr_t pos;
|
||||
uint32_t i, j, size, md5_size;
|
||||
uint8_t *buf = NULL, sum[16];
|
||||
char md5_path[64], *md5_data = NULL, *str_pos;
|
||||
|
||||
if (!img_report.has_md5sum)
|
||||
goto out;
|
||||
|
||||
assert(img_report.has_md5sum <= ARRAYSIZE(md5sum_name));
|
||||
if (img_report.has_md5sum > ARRAYSIZE(md5sum_name))
|
||||
goto out;
|
||||
|
||||
static_sprintf(md5_path, "%s\\%s", psz_extract_dir, md5sum_name[img_report.has_md5sum - 1]);
|
||||
md5_size = read_file(md5_path, (uint8_t**)&md5_data);
|
||||
if (md5_size == 0)
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < modified_path.Index; i++) {
|
||||
str_pos = strstr(md5_data, &modified_path.String[i][2]);
|
||||
if (str_pos == NULL)
|
||||
// File is not listed in md5 sums
|
||||
continue;
|
||||
if (display_header) {
|
||||
uprintf("Updating %s:", md5_path);
|
||||
display_header = FALSE;
|
||||
}
|
||||
uprintf("● %s", &modified_path.String[i][2]);
|
||||
pos = str_pos - md5_data;
|
||||
size = read_file(modified_path.String[i], &buf);
|
||||
if (size == 0)
|
||||
continue;
|
||||
HashBuffer(HASH_MD5, buf, size, sum);
|
||||
free(buf);
|
||||
while ((pos > 0) && (md5_data[pos - 1] != '\n'))
|
||||
pos--;
|
||||
for (j = 0; j < 16; j++) {
|
||||
md5_data[pos + 2 * j] = ((sum[j] >> 4) < 10) ? ('0' + (sum[j] >> 4)) : ('a' - 0xa + (sum[j] >> 4));
|
||||
md5_data[pos + 2 * j + 1] = ((sum[j] & 15) < 10) ? ('0' + (sum[j] & 15)) : ('a' - 0xa + (sum[j] & 15));
|
||||
}
|
||||
}
|
||||
|
||||
write_file(md5_path, md5_data, md5_size);
|
||||
free(md5_data);
|
||||
|
||||
out:
|
||||
StrArrayDestroy(&modified_path);
|
||||
}
|
||||
|
||||
// Returns 0 on success, >0 on error, <0 to ignore current dir
|
||||
static int iso_extract_files(iso9660_t* p_iso, const char *psz_path)
|
||||
{
|
||||
|
@ -793,14 +793,20 @@ static int iso_extract_files(iso9660_t* p_iso, const char *psz_path)
|
|||
} else {
|
||||
file_length = p_statbuf->total_size;
|
||||
if (check_iso_props(psz_path, file_length, psz_basename, psz_fullpath, &props)) {
|
||||
if (is_symlink && (file_length == 0)) {
|
||||
// Add symlink duplicated files to total_size at scantime
|
||||
if (is_symlink && (file_length == 0) && (strcmp(psz_path, "/firmware") == 0)) {
|
||||
if ((strcmp(psz_path, "/firmware") == 0)) {
|
||||
static_sprintf(target_path, "%s/%s", psz_path, p_statbuf->rr.psz_symlink);
|
||||
iso9660_stat_t *p_statbuf2 = iso9660_ifs_stat_translate(p_iso, target_path);
|
||||
iso9660_stat_t* p_statbuf2 = iso9660_ifs_stat_translate(p_iso, target_path);
|
||||
if (p_statbuf2 != NULL) {
|
||||
extra_blocks += (p_statbuf2->total_size + ISO_BLOCKSIZE - 1) / ISO_BLOCKSIZE;
|
||||
iso9660_stat_free(p_statbuf2);
|
||||
}
|
||||
} else if ((strcmp(p_statbuf->filename, "live") == 0) &&
|
||||
(strcmp(p_statbuf->rr.psz_symlink, "casper") == 0)) {
|
||||
// Mint LMDE requires working symbolic links and therefore requires the use of NTFS
|
||||
img_report.needs_ntfs = TRUE;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
11
src/rufus.c
11
src/rufus.c
|
@ -184,8 +184,8 @@ static void SetAllowedFileSystems(void)
|
|||
break;
|
||||
case BT_IMAGE:
|
||||
allowed_filesystem[FS_NTFS] = TRUE;
|
||||
// Don't allow anything besides NTFS if the image has a >4GB file
|
||||
if ((image_path != NULL) && (img_report.has_4GB_file))
|
||||
// Don't allow anything besides NTFS if the image has a >4GB file or explicitly requires NTFS
|
||||
if ((image_path != NULL) && (img_report.has_4GB_file || img_report.needs_ntfs))
|
||||
break;
|
||||
if (!HAS_WINDOWS(img_report) || (target_type != TT_BIOS) || allow_dual_uefi_bios) {
|
||||
if (!HAS_WINTOGO(img_report) || (ComboBox_GetCurItemData(hImageOption) != IMOP_WIN_TO_GO)) {
|
||||
|
@ -1134,13 +1134,18 @@ static void DisplayISOProps(void)
|
|||
(img_report.wininst_version >> 16) & 0xff, (img_report.wininst_version >> 8) & 0xff,
|
||||
(img_report.wininst_version >= SPECIAL_WIM_VERSION) ? "+": "");
|
||||
}
|
||||
if (img_report.needs_ntfs) {
|
||||
uprintf(" Note: This ISO uses symbolic links and was not designed to work without them.\r\n"
|
||||
" Because of this, only NTFS will be allowed as the target file system.");
|
||||
} else {
|
||||
PRINT_ISO_PROP(img_report.has_symlinks,
|
||||
" Note: This ISO uses symbolic links, which will not be replicated due to file system");
|
||||
" Note: This ISO uses symbolic links, which may not be replicated due to file system");
|
||||
PRINT_ISO_PROP((img_report.has_symlinks == SYMLINKS_RR),
|
||||
" limitations. Because of this, some features from this image may not work...");
|
||||
PRINT_ISO_PROP((img_report.has_symlinks == SYMLINKS_UDF),
|
||||
" limitations. Because of this, the size required for the target media may be much\r\n"
|
||||
" larger than size of the ISO...");
|
||||
}
|
||||
}
|
||||
|
||||
// Insert the image name into the Boot selection dropdown and (re)populate the Image option dropdown
|
||||
|
|
|
@ -412,11 +412,12 @@ typedef struct {
|
|||
BOOLEAN has_old_c32[NB_OLD_C32];
|
||||
BOOLEAN has_old_vesamenu;
|
||||
BOOLEAN has_efi_syslinux;
|
||||
BOOLEAN needs_syslinux_overwrite;
|
||||
BOOLEAN has_grub4dos;
|
||||
uint8_t has_grub2;
|
||||
BOOLEAN has_compatresources_dll;
|
||||
BOOLEAN has_kolibrios;
|
||||
BOOLEAN needs_syslinux_overwrite;
|
||||
BOOLEAN needs_ntfs;
|
||||
BOOLEAN uses_casper;
|
||||
BOOLEAN uses_minint;
|
||||
uint8_t compression_type;
|
||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
|||
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_ACCEPTFILES
|
||||
CAPTION "Rufus 4.3.2087"
|
||||
CAPTION "Rufus 4.3.2088"
|
||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||
|
@ -392,8 +392,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 4,3,2087,0
|
||||
PRODUCTVERSION 4,3,2087,0
|
||||
FILEVERSION 4,3,2088,0
|
||||
PRODUCTVERSION 4,3,2088,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -411,13 +411,13 @@ BEGIN
|
|||
VALUE "Comments", "https://rufus.ie"
|
||||
VALUE "CompanyName", "Akeo Consulting"
|
||||
VALUE "FileDescription", "Rufus"
|
||||
VALUE "FileVersion", "4.3.2087"
|
||||
VALUE "FileVersion", "4.3.2088"
|
||||
VALUE "InternalName", "Rufus"
|
||||
VALUE "LegalCopyright", "© 2011-2023 Pete Batard (GPL v3)"
|
||||
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
||||
VALUE "OriginalFilename", "rufus-4.3.exe"
|
||||
VALUE "ProductName", "Rufus"
|
||||
VALUE "ProductVersion", "4.3.2087"
|
||||
VALUE "ProductVersion", "4.3.2088"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
Loading…
Reference in a new issue