From 9c8fa409959a4713f1a9c85043962e6cb4cc465b Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Fri, 23 Apr 2021 17:04:55 +0100 Subject: [PATCH] [ui] add forced DD mode exceptions for Red Hat based distros * Anaconda broke ISO compatibility, most likely with the following commit: https://github.com/rhinstaller/anaconda/commit/84529204fe02300b9829da41099a8254dc2a1c54 * However, Ret Hat, and its followers, have drunk the "DD only" kool aid, and appear to be blissfully unaware of the very real drawbacks that enforcing a "DD only" mode for ISOHybrid can actually place on distro users. * Rather than spend another wasted effort trying get people, who appear to be impervious to even remotely consider the idea that DD imaging can have flaws, to look into the possibility that Red Hat might indeed have introduced a regression, and given the downright hostility I have been subjected to from trying to state this *very verifiable* fact, we'll just force DD mode for the affected Red Hat and derivatives, whilst trusting that users will be smart enough to compare their more limited installation experience against the ones from other distros (such as Arch, Debian or Ubuntu, which, unlike Red Hat and co., appear to fully understand that the whole ISOHybrid vs DD mode situation is not all black and white), and see for themselves which distros do actually place *their* interests first, rather than just the interests of the distro maintainers... --- res/appstore/Package.appxmanifest | 2 +- src/rufus.c | 22 +++++++++++++++++++++- src/rufus.rc | 10 +++++----- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/res/appstore/Package.appxmanifest b/res/appstore/Package.appxmanifest index ccd6a2b4..1d4213ec 100644 --- a/res/appstore/Package.appxmanifest +++ b/res/appstore/Package.appxmanifest @@ -11,7 +11,7 @@ + Version="3.14.1780.0" /> Rufus diff --git a/src/rufus.c b/src/rufus.c index a99e352d..d8a20c14 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -44,6 +44,7 @@ #include "localization.h" #include "ui.h" +#include "re.h" #include "drive.h" #include "settings.h" #include "bled/bled.h" @@ -1202,7 +1203,18 @@ out: // The scanning process can be blocking for message processing => use a thread DWORD WINAPI ImageScanThread(LPVOID param) { - int i; + // Regexp patterns used to match ISO labels for distros whose + // maintainers have drunk the "ISOHybrid = DD only" kool aid... + const char* dd_koolaid_drinkers[] = { + "^CentOS-8-[3-9].*", // CentOS 8.3 or later + "^CentOS-9-.*", // CentOS 9.x + "^OL-.*-BaseOS-.*", // Oracle Linux + "^RHEL-8.[2-9].*", // Red Hat 8.2 or later + "^RHEL-9.*", // Red Hat 9.x + // Don't bother with Fedora for now, even as they use + // the same problematic Anaconda... + }; + int i, len; uint8_t arch; char tmp_path[MAX_PATH]; @@ -1262,6 +1274,14 @@ DWORD WINAPI ImageScanThread(LPVOID param) if (img_report.is_iso) { DisplayISOProps(); + + for (i = 0; i < ARRAYSIZE(dd_koolaid_drinkers); i++) { + if (re_match(dd_koolaid_drinkers[i], img_report.label, &len) >= 0) { + img_report.disable_iso = TRUE; + break; + } + } + // If we have an ISOHybrid, but without an ISO method we support, disable ISO support altogether if (IS_DD_BOOTABLE(img_report) && (img_report.disable_iso || (!IS_BIOS_BOOTABLE(img_report) && !IS_EFI_BOOTABLE(img_report)))) { diff --git a/src/rufus.rc b/src/rufus.rc index 4c510708..fedb954b 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.14.1779" +CAPTION "Rufus 3.14.1780" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -395,8 +395,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,14,1779,0 - PRODUCTVERSION 3,14,1779,0 + FILEVERSION 3,14,1780,0 + PRODUCTVERSION 3,14,1780,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -414,13 +414,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.14.1779" + VALUE "FileVersion", "3.14.1780" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2021 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.14.1779" + VALUE "ProductVersion", "3.14.1780" END END BLOCK "VarFileInfo"