From eda1f59a3818cec0c5c30650ea41f8c616201314 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 28 Jul 2022 15:47:05 +0100 Subject: [PATCH] [iso] fix GRUB version detection for Fedora Rawhide * How nice of "Open Source proponent" IBM/Red-Hat/Fedora to fix double space typos while making sure the provenance of the software they are using is hidden: https://src.fedoraproject.org/rpms/grub2/blob/rawhide/f/0024-Don-t-say-GNU-Linux-in-generated-menus.patch * Long story short: Fedora fixed the double space in "GRUB version", but of course they didn't upstream this change since it is part of a patch that removes every possible mention of GNU. This made our GRUB version detection break, since it relies on finding a "GRUB version" string. * Fix this by looking for both "GRUB version" and "GRUB version". * This, however, does not fix Fedora Rawhide BIOS boot, since they also added custom GRUB calls such as 'grub_debug_is_enabled', which we don't have in our vanilla produced GRUB binary. * Closes #2002. --- ChangeLog.txt | 5 +++-- src/iso.c | 25 +++++++++++++++++-------- src/rufus.rc | 10 +++++----- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index cbd8b322..146b99a2 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,16 +1,17 @@ o Version 3.20 (2022.08.??) Enable applicable Windows User Experience options for Windows 10 - Make Windows User Experience options persist between sessions + Remember last Windows User Experience selection between sessions Add automatic local account creation and regional options duplication (NB: This is limited to creating an account with the same name as the current user and with an empty password that the user will be prompted to change after first reboot) Add a workaround for ISOs that have a 'syslinux' symbolic link to '/isolinux/' (Knoppix) - Revert to inserting registry keys for the TPM/SB/RAM bypass where possible + Revert to offline insertion of registry keys for the TPM/SB/RAM bypass where possible Remove storage bypass, since this is a bogus bypass that doesn't do anything Improve BIOS compatibility when displaying the "UEFI boot only" alert message Fix Windows User Experience dialog appearing twice for Windows To Go Fix Windows User Experience options not being applied for ARM64 Fix Microsoft Account bypass not being applied unless TPM/SB/RAM bypass is selected + Fix overeager detection of GRUB2 bootloaders with nonstandard prefixes o Version 3.19 (2022.07.01) Add a new selection dialog for Windows 11 setup customization: diff --git a/src/iso.c b/src/iso.c index b563e464..9571ed8e 100644 --- a/src/iso.c +++ b/src/iso.c @@ -847,19 +847,28 @@ out: void GetGrubVersion(char* buf, size_t buf_size) { + // In typical "I'll make my own Open Source... with blackjack and hookers!" fashion, + // IBM/Red-Hat/Fedora took it upon themselves to "fix" the double space typo from the + // GRUB version string. But of course, just like their introduction of GRUB calls like + // 'grub_debug_is_enabled', they didn't want to bother upstreaming their changes... + // On the other hand, boy do they want to leech of FSF/GNU developed software, while + // not having it mention GNU anywhere. See: + // https://src.fedoraproject.org/rpms/grub2/blob/rawhide/f/0024-Don-t-say-GNU-Linux-in-generated-menus.patch + const char* grub_version_str[] = { "GRUB version %s", "GRUB version %s" }; char *p, unauthorized[] = {'<', '>', ':', '|', '*', '?', '\\', '/'}; - size_t i; - const char grub_version_str[] = "GRUB version %s"; + size_t i, j; - for (i=0; i= 1 ? " with NONSTANDARD prefix" : ""); + img_report.has_grub2 > 1 ? " with NONSTANDARD prefix" : ""); for (k = 0; k < ARRAYSIZE(grub_patch); k++) { if (strcmp(img_report.grub2_version, grub_patch[k].version) == 0) break; diff --git a/src/rufus.rc b/src/rufus.rc index 9258ef2d..e9a00350 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.20.1926" +CAPTION "Rufus 3.20.1927" 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,20,1926,0 - PRODUCTVERSION 3,20,1926,0 + FILEVERSION 3,20,1927,0 + PRODUCTVERSION 3,20,1927,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.20.1926" + VALUE "FileVersion", "3.20.1927" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.20.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.20.1926" + VALUE "ProductVersion", "3.20.1927" END END BLOCK "VarFileInfo"