Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iso] Switch the ReactOS path to freeldr.sys - Allow ReactOS to boot from a flash rufus usb again #2589

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ static const char* syslinux_cfg[] = { "isolinux.cfg", "syslinux.cfg", "extlinux.
static const char* isolinux_bin[] = { "isolinux.bin", "boot.bin" };
static const char* pe_dirname[] = { "/i386", "/amd64", "/minint" };
static const char* pe_file[] = { "ntdetect.com", "setupldr.bin", "txtsetup.sif" };
static const char* reactos_name = "setupldr.sys"; // TODO: freeldr.sys doesn't seem to work
static const char* reactos_name = "freeldr.sys";
static const char* reactos_old_name = "setupldr.sys";
static const char* kolibri_name = "kolibri.img";
static const char* autorun_name = "autorun.inf";
static const char* manjaro_marker = ".miso";
Expand Down Expand Up @@ -274,9 +275,12 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const
}
}

// Check for ReactOS' setupldr.sys anywhere
if ((img_report.reactos_path[0] == 0) && (safe_stricmp(psz_basename, reactos_name) == 0))
static_strcpy(img_report.reactos_path, psz_fullpath);
// Check for ReactOS presence
if (img_report.reactos_path[0] == 0) {
if ((safe_stricmp(psz_basename, reactos_name) == 0) ||
(safe_stricmp(psz_basename, reactos_old_name) == 0))
DarkFire01 marked this conversation as resolved.
Show resolved Hide resolved
static_strcpy(img_report.reactos_path, psz_fullpath);
Comment on lines +279 to +282
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there was a comment suggesting a problem with using freeldr.sys in (probably older?) ReactOS ISOs. Maybe it could make sense to ensure that setupldr.sys is always used whenever it exists, and check for it until it is found or we went through all files on ISO.

Suggested change
if (img_report.reactos_path[0] == 0) {
if ((safe_stricmp(psz_basename, reactos_name) == 0) ||
(safe_stricmp(psz_basename, reactos_old_name) == 0))
static_strcpy(img_report.reactos_path, psz_fullpath);
if ((safe_strstr(img_report.reactos_path, reactos_old_name) == NULL) &&
((safe_stricmp(psz_basename, reactos_name) == 0) ||
(safe_stricmp(psz_basename, reactos_old_name) == 0)))
static_strcpy(img_report.reactos_path, psz_fullpath);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem was that freeldr.sys file was absent from livecd, only setupldr was there, but both files have the same content, so it should be fine ...

Now, I should add, that in much older reactors versions (like the 0.3.x ones), setupldr contained only the startup code to start the bootcd usetup, and it was different from the regular freeldr used in the livecd or in a regular ReactOS installation on a HDD.

}

// Check for the first 'efi*.img' we can find (that hopefully contains EFI boot files)
if (!HAS_EFI_IMG(img_report) && (safe_strlen(psz_basename) >= 7) &&
Expand Down