1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[iso] relax isolinux cfg file detection for persistence and force DD mode for Pop_OS

This commit is contained in:
Pete Batard 2019-08-15 21:14:30 +01:00
parent 076b13c469
commit 1fa0aaf325
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
3 changed files with 16 additions and 15 deletions

View file

@ -63,7 +63,6 @@ typedef struct {
BOOLEAN is_syslinux_cfg; BOOLEAN is_syslinux_cfg;
BOOLEAN is_grub_cfg; BOOLEAN is_grub_cfg;
BOOLEAN is_menu_cfg; BOOLEAN is_menu_cfg;
BOOLEAN is_txt_cfg;
BOOLEAN is_old_c32[NB_OLD_C32]; BOOLEAN is_old_c32[NB_OLD_C32];
} EXTRACT_PROPS; } EXTRACT_PROPS;
@ -88,8 +87,7 @@ static const char* wininst_name[] = { "install.wim", "install.esd", "install.swm
static const char* grub_dirname = "/boot/grub/i386-pc"; static const char* grub_dirname = "/boot/grub/i386-pc";
static const char* grub_cfg = "grub.cfg"; static const char* grub_cfg = "grub.cfg";
static const char* menu_cfg = "menu.cfg"; static const char* menu_cfg = "menu.cfg";
static const char* txt_cfg = "txt.cfg"; static const char* syslinux_cfg[] = { "isolinux.cfg", "syslinux.cfg", "txt.cfg", "extlinux.conf" };
static const char* syslinux_cfg[] = { "isolinux.cfg", "syslinux.cfg", "extlinux.conf" };
static const char* isolinux_bin[] = { "isolinux.bin", "boot.bin" }; static const char* isolinux_bin[] = { "isolinux.bin", "boot.bin" };
static const char* pe_dirname[] = { "/i386", "/amd64", "/minint" }; static const char* pe_dirname[] = { "/i386", "/amd64", "/minint" };
static const char* pe_file[] = { "ntdetect.com", "setupldr.bin", "txtsetup.sif" }; static const char* pe_file[] = { "ntdetect.com", "setupldr.bin", "txtsetup.sif" };
@ -97,6 +95,7 @@ static const char* reactos_name = "setupldr.sys"; // TODO: freeldr.sys doesn't s
static const char* kolibri_name = "kolibri.img"; static const char* kolibri_name = "kolibri.img";
static const char* autorun_name = "autorun.inf"; static const char* autorun_name = "autorun.inf";
static const char* manjaro_marker = ".miso"; static const char* manjaro_marker = ".miso";
static const char* pop_os_name = "pop-os";
static const char* stupid_antivirus = " NOTE: This is usually caused by a poorly designed security solution. " static const char* stupid_antivirus = " NOTE: This is usually caused by a poorly designed security solution. "
"See https://goo.gl/QTobxX.\r\n This file will be skipped for now, but you should really " "See https://goo.gl/QTobxX.\r\n This file will be skipped for now, but you should really "
"look into using a *SMARTER* antivirus solution."; "look into using a *SMARTER* antivirus solution.";
@ -178,8 +177,6 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const
props->is_grub_cfg = TRUE; props->is_grub_cfg = TRUE;
} else if (safe_stricmp(psz_basename, menu_cfg) == 0) { } else if (safe_stricmp(psz_basename, menu_cfg) == 0) {
props->is_menu_cfg = TRUE; props->is_menu_cfg = TRUE;
} else if (safe_stricmp(psz_basename, txt_cfg) == 0) {
props->is_txt_cfg = TRUE;
} }
} }
@ -198,9 +195,11 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const
has_ldlinux_c32 = TRUE; has_ldlinux_c32 = TRUE;
} }
// Check for a /casper directory // Check for a '/casper#####' directory (non-empty)
if (safe_stricmp(psz_dirname, casper_dirname) == 0) { if (safe_strnicmp(psz_dirname, casper_dirname, strlen(casper_dirname)) == 0) {
img_report.uses_casper = TRUE; img_report.uses_casper = TRUE;
if (safe_strstr(psz_dirname, pop_os_name) != NULL)
img_report.disable_iso = TRUE;
} }
// Check for various files in root (psz_dirname = "") // Check for various files in root (psz_dirname = "")
@ -305,12 +304,13 @@ static void fix_config(const char* psz_fullpath, const char* psz_path, const cha
// Add persistence to the kernel options // Add persistence to the kernel options
if ((boot_type == BT_IMAGE) && HAS_PERSISTENCE(img_report) && persistence_size) { if ((boot_type == BT_IMAGE) && HAS_PERSISTENCE(img_report) && persistence_size) {
if ((props->is_grub_cfg) || (props->is_menu_cfg) || (props->is_txt_cfg)) { if ((props->is_grub_cfg) || (props->is_menu_cfg) || (props->is_syslinux_cfg)) {
// Ubuntu & derivatives are assumed to use '/casper/vmlinuz' // Ubuntu & derivatives are assumed to use '/casper/vmlinuz'
// in their kernel options and use 'persistent' as keyword. // in their kernel options and use 'persistent' as keyword.
if (replace_in_token_data(src, props->is_grub_cfg ? "linux" : "append", if (replace_in_token_data(src, props->is_grub_cfg ? "linux" : "append",
props->is_grub_cfg ? "/casper/vmlinuz" : "/casper/initrd", props->is_grub_cfg ? "/casper/vmlinuz" : "initrd=/casper/initrd",
props->is_grub_cfg ? "/casper/vmlinuz persistent" : "/casper/initrd persistent", TRUE) != NULL) // Of course, Mint has to use 'initrd=/casper/initrd.lz' instead of 'initrd=/casper/initrd'
props->is_grub_cfg ? "/casper/vmlinuz persistent" : "persistent initrd=/casper/initrd", TRUE) != NULL)
uprintf(" Added 'persistent' kernel option"); uprintf(" Added 'persistent' kernel option");
// Debian & derivatives are assumed to use 'boot=live' in // Debian & derivatives are assumed to use 'boot=live' in
// their kernel options and use 'persistence' as keyword. // their kernel options and use 'persistence' as keyword.

View file

@ -1086,6 +1086,7 @@ out:
* it with 'rep'. File can be ANSI or UNICODE and is overwritten. Parameters are UTF-8. * it with 'rep'. File can be ANSI or UNICODE and is overwritten. Parameters are UTF-8.
* The parsed line is of the form: [ ]token[ ]data * The parsed line is of the form: [ ]token[ ]data
* Returns a pointer to rep if replacement occurred, NULL otherwise * Returns a pointer to rep if replacement occurred, NULL otherwise
* TODO: We might have to end up with a regexp engine, so that we can do stuff like: "foo*" -> "bar\1"
*/ */
char* replace_in_token_data(const char* filename, const char* token, const char* src, const char* rep, BOOL dos2unix) char* replace_in_token_data(const char* filename, const char* token, const char* src, const char* rep, BOOL dos2unix)
{ {

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326 IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.7.1560" CAPTION "Rufus 3.7.1561"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0 FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -394,8 +394,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,7,1560,0 FILEVERSION 3,7,1561,0
PRODUCTVERSION 3,7,1560,0 PRODUCTVERSION 3,7,1561,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -413,13 +413,13 @@ BEGIN
VALUE "Comments", "https://akeo.ie" VALUE "Comments", "https://akeo.ie"
VALUE "CompanyName", "Akeo Consulting" VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.7.1560" VALUE "FileVersion", "3.7.1561"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html" VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus-3.7.exe" VALUE "OriginalFilename", "rufus-3.7.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.7.1560" VALUE "ProductVersion", "3.7.1561"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"