[ui] add forced DD mode exceptions for Red Hat based distros

* Anaconda broke ISO compatibility, most likely with the following commit:
  84529204fe
* 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...
This commit is contained in:
Pete Batard 2021-04-23 17:04:55 +01:00
parent 16c0e8e2a2
commit 9c8fa40995
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
3 changed files with 27 additions and 7 deletions

View file

@ -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)))) {