From 8719412667776c0be98c4036ee3fb562d008e7bc Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 22 Oct 2019 17:08:59 +0100 Subject: [PATCH] [iso] leave bootmgr and bootmgr.efi uncompressed on compressed NTFS * When using compressed NTFS, having a compressed bootmgr prevents BIOS boot, so we now call `compress -u` where needed to leave the relevant bootmgr files uncompressed. * Closes #1381 * Also fix a minor warning in ext2fs --- src/ext2fs/bmap.c | 5 +++-- src/iso.c | 5 ++++- src/rufus.rc | 10 +++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/ext2fs/bmap.c b/src/ext2fs/bmap.c index 478102d1..65c45c51 100644 --- a/src/ext2fs/bmap.c +++ b/src/ext2fs/bmap.c @@ -305,8 +305,9 @@ errcode_t ext2fs_bmap2(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode, { struct ext2_inode inode_buf; ext2_extent_handle_t handle = 0; + blk_t addr_per_block; blk_t b, blk32; - blk64_t b64, addr_per_block; + blk64_t b64; char *buf = 0; errcode_t retval = 0; int blocks_alloc = 0, inode_dirty = 0; @@ -330,7 +331,7 @@ errcode_t ext2fs_bmap2(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode, return retval; inode = &inode_buf; } - addr_per_block = (blk64_t) fs->blocksize >> 2; + addr_per_block = (blk_t) fs->blocksize >> 2; if (ext2fs_file_block_offset_too_big(fs, inode, block)) return EXT2_ET_FILE_TOO_BIG; diff --git a/src/iso.c b/src/iso.c index fc06dbdd..d2566828 100644 --- a/src/iso.c +++ b/src/iso.c @@ -68,7 +68,7 @@ typedef struct { RUFUS_IMG_REPORT img_report; int64_t iso_blocking_status = -1; -extern BOOL preserve_timestamps; +extern BOOL preserve_timestamps, enable_ntfs_compression; BOOL enable_iso = TRUE, enable_joliet = TRUE, enable_rockridge = TRUE, has_ldlinux_c32; #define ISO_BLOCKING(x) do {x; iso_blocking_status++; } while(0) static const char* psz_extract_dir; @@ -1013,6 +1013,9 @@ out: } if (fd != NULL) fclose(fd); + } else if (HAS_BOOTMGR(img_report) && enable_ntfs_compression) { + // bootmgr might need to be uncompressed: https://github.com/pbatard/rufus/issues/1381 + RunCommand("compact /u bootmgr bootmgr.efi", dest_dir, TRUE); } } if (p_iso != NULL) diff --git a/src/rufus.rc b/src/rufus.rc index 16d1c03b..ce61d2e8 100644 --- a/src/rufus.rc +++ b/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 3.9.1583" +CAPTION "Rufus 3.9.1584" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -394,8 +394,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,9,1583,0 - PRODUCTVERSION 3,9,1583,0 + FILEVERSION 3,9,1584,0 + PRODUCTVERSION 3,9,1584,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -413,13 +413,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.9.1583" + VALUE "FileVersion", "3.9.1584" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.9.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.9.1583" + VALUE "ProductVersion", "3.9.1584" END END BLOCK "VarFileInfo"