From 15e3886499d19de6842001e6a5fad944b77427f8 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Fri, 9 Feb 2024 16:59:28 +0000 Subject: [PATCH] [iso] enable persistence support for Linux Mint * Mint users sure are lucky that one of them *lied their way through* pretending that persistence actually used to work with previous version of Mint, when it never did, because they got us going through a whole refactor of the partition creation process just so we could make Mint persistence work. * Closes #2428. * Also fix a Coverity warning. --- src/drive.c | 2 +- src/iso.c | 5 +++++ src/rufus.rc | 10 +++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/drive.c b/src/drive.c index d558befd..c4f56cf8 100644 --- a/src/drive.c +++ b/src/drive.c @@ -2383,7 +2383,7 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m // Compute the offsets of the extra partitions (which we always align to a track) last_offset = SelectedDrive.DiskSize; if (partition_style == PARTITION_STYLE_GPT) - last_offset -= 33 * SelectedDrive.SectorSize; + last_offset -= 33ULL * SelectedDrive.SectorSize; for (i = pi - 1; i > mi; i--) { assert(SelectedDrive.Partition[i].Size < last_offset); SelectedDrive.Partition[i].Offset = LO_ALIGN_X_TO_Y(last_offset - SelectedDrive.Partition[i].Size, bytes_per_track); diff --git a/src/iso.c b/src/iso.c index e03dd9b1..f59fb149 100644 --- a/src/iso.c +++ b/src/iso.c @@ -380,6 +380,11 @@ static void fix_config(const char* psz_fullpath, const char* psz_path, const cha // Ubuntu 23.04 uses GRUB only with the above and does not use "maybe-ubiquity" uprintf(" Added 'persistent' kernel option"); modified = TRUE; + } else if (replace_in_token_data(src, props->is_grub_cfg ? "linux" : "append", + "boot=casper", "boot=casper persistent", TRUE) != NULL) { + // Linux Mint uses boot=casper. + uprintf(" Added 'persistent' kernel option"); + modified = TRUE; } else if (replace_in_token_data(src, props->is_grub_cfg ? "linux" : "append", "boot=live", "boot=live persistence", TRUE) != NULL) { // Debian & derivatives are assumed to use 'boot=live' in diff --git a/src/rufus.rc b/src/rufus.rc index abe32f55..46642bd6 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 4.5.2110" +CAPTION "Rufus 4.5.2111" 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,5,2110,0 - PRODUCTVERSION 4,5,2110,0 + FILEVERSION 4,5,2111,0 + PRODUCTVERSION 4,5,2111,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.5.2110" + VALUE "FileVersion", "4.5.2111" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.5.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.5.2110" + VALUE "ProductVersion", "4.5.2111" END END BLOCK "VarFileInfo"