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

Conversation

DarkFire01
Copy link
Contributor

reactos/reactos@764881a
Follow this commit rufus no longer works with ReactOS's newer ISOs. This PR just aims to quickly fix this by checking for both setupldr.sys and freeldr.sys.

@DarkFire01 DarkFire01 force-pushed the PR-Freeloader branch 3 times, most recently from 9e44851 to dbdcef5 Compare October 17, 2024 21:10
src/iso.c Outdated Show resolved Hide resolved
@DarkFire01 DarkFire01 force-pushed the PR-Freeloader branch 3 times, most recently from a79ce6f to df25f75 Compare October 17, 2024 21:21
src/iso.c Outdated Show resolved Hide resolved
@DarkFire01 DarkFire01 force-pushed the PR-Freeloader branch 3 times, most recently from 899ffc7 to d1c1da5 Compare October 17, 2024 21:27
src/iso.c Outdated Show resolved Hide resolved
@DarkFire01 DarkFire01 force-pushed the PR-Freeloader branch 2 times, most recently from 03b5b3f to 8b2f4c1 Compare October 17, 2024 21:40
@DarkFire01
Copy link
Contributor Author

Sorry I had never done commit signing before this so it took a ... few tries to figure out :D

src/iso.c Show resolved Hide resolved
Signed-off-by: Justin Miller <justin.miller@reactos.org>
Comment on lines +279 to +282
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);
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.

@pbatard
Copy link
Owner

pbatard commented Oct 18, 2024

@archeYR, I'm afraid I'm not planning to add extra searches that cater specifically for ISOs that are unlikely to be used that commonly, such as ISOs that use both .sys.

Also the way I am planning to rework this PR (to be consistent with what I do elsewhere is):

static const char* reactos_name[] = { "setupldr.sys", "freeldr.sys" };

(...)

if (img_report.reactos_path[0] == 0) {
    for (i = 0; i < ARRAYSIZE(reactos_name); i++)
        if (safe_stricmp(psz_basename, reactos_name[i]) == 0)
            static_strcpy(img_report.reactos_path, psz_fullpath);
}

This way, if you guys switch the names of the .sys files again, it'll be a simple matter of adding a new string to the array.

Also, I guess that means it is actually possible to create bootable USB drives from ReactOS ISOs?
Last time I tried, which I admit was years ago, I wasn't too successful with it, but I decided to add the code anyway, in the hope that USB boot would eventually be sorted out. So it's nice to hear that this has finally happened.

@archeYR
Copy link

archeYR commented Oct 18, 2024

@archeYR, I'm afraid I'm not planning to add extra searches that cater specifically for ISOs that are unlikely to be used that commonly, such as ISOs that use both .sys.

It's okay, I don't care about these old versions that much either.

Also, I guess that means it is actually possible to create bootable USB drives from ReactOS ISOs?
Last time I tried, which I admit was years ago, I wasn't too successful with it, but I decided to add the code anyway, in the hope that USB boot would eventually be sorted out. So it's nice to hear that this has finally happened.

0.4.15 will include some USB and PnPMgr fixes that allow ReactOS to boot from USB on some real hardware. Also there is a HybridCD build target that has an option to boot ReactOS from RAM disk and it already works reliably.

@pbatard
Copy link
Owner

pbatard commented Oct 18, 2024

Applied, thanks! This will be part of the upcoming 4.6 release.

@pbatard pbatard closed this in accc7c0 Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants