From 41ebb9d9caf74b3939f31b1bdb984be28e74b2f8 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sat, 22 Apr 2023 12:46:45 +0100 Subject: [PATCH] [iso] fix persistence support for Ubuntu 23.04 * Closes #2231 --- src/iso.c | 11 ++++++++--- src/rufus.rc | 10 +++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/iso.c b/src/iso.c index 9d719e4b..bd3889b7 100644 --- a/src/iso.c +++ b/src/iso.c @@ -322,7 +322,7 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const // Apply various workarounds to Linux config files static void fix_config(const char* psz_fullpath, const char* psz_path, const char* psz_basename, EXTRACT_PROPS* props) { - BOOL modified = FALSE; + BOOL modified; size_t nul_pos; char *iso_label = NULL, *usb_label = NULL, *src, *dst; @@ -338,19 +338,23 @@ static void fix_config(const char* psz_fullpath, const char* psz_path, const cha if (replace_in_token_data(src, props->is_grub_cfg ? "linux" : "append", "file=/cdrom/preseed", "persistent file=/cdrom/preseed", TRUE) != NULL) { // Ubuntu & derivatives are assumed to use 'file=/cdrom/preseed/...' + // or 'layerfs-path=minimal.standard.live.squashfs' (see below) // somewhere in their kernel options and use 'persistent' as keyword. uprintf(" Added 'persistent' kernel option"); - modified = TRUE; // Also remove Ubuntu's "maybe-ubiquity" to avoid splash screen (GRUB only) if ((props->is_grub_cfg) && replace_in_token_data(src, "linux", "maybe-ubiquity", "", TRUE)) uprintf(" Removed 'maybe-ubiquity' kernel option"); + } else if (replace_in_token_data(src, "linux", "layerfs-path=minimal.standard.live.squashfs", + "persistent layerfs-path=minimal.standard.live.squashfs", TRUE) != NULL) { + uprintf(" Added 'persistent' kernel option"); + if (replace_in_token_data(src, "linux", "maybe-ubiquity", "", TRUE)) + uprintf(" Removed 'maybe-ubiquity' kernel option"); } 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 // their kernel options and use 'persistence' as keyword. uprintf(" Added 'persistence' kernel option"); - modified = TRUE; } // Other distros can go to hell. Seriously, just check all partitions for // an ext volume with the right label and use persistence *THEN*. I mean, @@ -375,6 +379,7 @@ static void fix_config(const char* psz_fullpath, const char* psz_path, const cha iso_label = replace_char(img_report.label, ' ', "\\x20"); usb_label = replace_char(img_report.usb_label, ' ', "\\x20"); if ((iso_label != NULL) && (usb_label != NULL)) { + modified = FALSE; for (int i = 0; i < ARRAYSIZE(cfg_token); i++) { if (replace_in_token_data(src, cfg_token[i], iso_label, usb_label, TRUE) != NULL) modified = TRUE; diff --git a/src/rufus.rc b/src/rufus.rc index e8972c71..873f75a7 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.23.2026" +CAPTION "Rufus 3.23.2027" 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 3,23,2026,0 - PRODUCTVERSION 3,23,2026,0 + FILEVERSION 3,23,2027,0 + PRODUCTVERSION 3,23,2027,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", "3.23.2026" + VALUE "FileVersion", "3.23.2027" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2023 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.23.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.23.2026" + VALUE "ProductVersion", "3.23.2027" END END BLOCK "VarFileInfo"