jlobue10 / SteamDeck_rEFInd

Simple rEFInd install script for the Steam Deck (with GUI customization)
MIT License
521 stars 51 forks source link

rEFInd seems to be properly installed, but windows starts insted of rEFInd #12

Closed MeowCat280 closed 1 year ago

MeowCat280 commented 1 year ago

when I open the bootloader (minus+power), rEFInd shows up, and when clicked, works normally, it just doesn't boot on default. I'm using steam OS preview, and windows 11.i am using this guide. https://www.youtube.com/watch?v=KaviK55od6Y

jlobue10 commented 1 year ago

Please refer to the SteamOS branch considerations portion of the README. I'm assuming (based on your limited description) that you ran the rEFInd installation script after branching away from the stable branch of SteamOS. This is a known issue that I discuss in the README. Please also clone and use my version of the installation script, as it takes care of potential duplicate rEFInd EFI entries from successive script runs. Thanks.

MeowCat280 commented 1 year ago

Hey, swapped to you version, and used stable, but still isnt working. Sorry if my last message came off rude. rEFInd (the original, with grey background) works correctly, but windows is still booting first. any further troubleshooting?

jlobue10 commented 1 year ago

What branch and version of SteamOS are you on? There are issues on non-stable branch versions of SteamOS that prevent the efibootmgr command from properly disabling the Windows EFI entry (which is a necessary step). Whether this is intentional or a bug by Valve is something that I'm still uncertain about. Anyways, others have had success previously by reverting back to stable branch SteamOS, re-running the script and then going back to other non stable SteamOS branches afterwards.

MeowCat280 commented 1 year ago

Like I said before, I am using stabe, I reinstalled it on stable, it still does not work.

jlobue10 commented 1 year ago

So in your first post, you clearly state that you were using SteamOS preview (not the stable branch). You clearly ignored or disregarded Valve's disclaimer for the preview build that states, "Testing for new Steam and system-level features. Updates frequently. You may encounter issues." Well, you are encountering an issue that you would not be had you run the script initially from the Stable build like my README clearly (and explicitly) states. I agree that some formatting updates are in order though for the README. I just re-verified that this works even with the latest stable release 3.3.3, so had you followed my instructions, you would not be experiencing this issue. Check your tone when you are asking for help.

With all that being said, you are also not giving me too much information to assist in my debug. Clearly something is messed up in going from Preview back to stable without reimaging the Steam Deck. There are three things that I think you could try to fix your issue.

  1. Go to the Beta branch (boot into beta SteamOS and run all updates) and then go back to the stable branch (get the latest updates) and try re-running the script. You will know if it worked or not from the command line because you won't see an error, and you will see the * next to the Windows EFI entry is gone. If the asterisk is still there next to the Windows EFI entry after running efibootmgr after running the installation script, then something is still interfering with this necessary step.

  2. You can re-image the Steam Deck and stay on the latest stable build (3.3.3, and run all updates), reinstall Windows and the APU driver (at a minimum) and then run the rEFInd installation script. This SHOULD work for you, but I will add the disclaimer that I don't know all that's being changed with the Preview build (BIOS, firmware, etc.) that could still potentially interfere. There is a possibility that this would not work. If going this route, I'd suggest making a backup of your /home directory files in SteamOS and creating a Windows system image of its partition. Restoring Windows from its system image backup would potentially save you some reinstallation headaches. Even if not restoring from a Windows image backup, I think the Windows setup is fairly easy now with all of the guides and automated installers out there (to get you back up and running quickly).

  3. There is a workaround to force rEFInd to be the next active EFI boot entry from both Windows and SteamOS that requires proper bcdedit and efibootmgr commands from the respective OSes. If you're interested in more information about this method that should work for you, I'd consider writing up a more detailed guide and explanation if you apologize and ask nicely. :)

MeowCat280 commented 1 year ago

First, I'd like to apologize for how rude my previous messages were. I followed that YouTube guy before I had found the official rEFInd page. It was rude of me to behave like that, and for that I am sorry. If I have to fully reimage my steam deck it's not worth it to me at this point, if you're still willing to help me with that third option I'd be very appreciative.

jlobue10 commented 1 year ago

No worries. Apology accepted. Give me a little bit of time to do the write-up for option 3. The process is a bit convoluted.

jlobue10 commented 1 year ago

Can you paste what you see at your SteamOS command line when you run efibootmgr ?

MeowCat280 commented 1 year ago

I'm sorry, I'm not the most familiar with Linux or command lines. I can follow a guide pretty well tho. Are you asking me to redo the EFI install I followed from you git page? And copy paste what it responds with?

jlobue10 commented 1 year ago

No, I'm asking for you to run the command efibootmgr from a SteamOS desktop mode command line, and then paste the results here. I need to modify a command that a Reddit user had come up with for the workaround. His workaround was to boot SteamOS (as the next active EFI boot entry) by default though, so I need it to be modified for rEFInd instead. By providing me your results from running efibootmgr , I can ensure that my edits will work for you and your use case.

rayromeo1 commented 1 year ago

i'm on the steamos stable channel

just updated to the new steamos 3.4 today

the boot option for steamos disappeared from the boot menu (vol - and power menu), after the update, it would boot manually by choosing the efi file from the other boot menu, but it would not repopulate it like it used to, it just would show my win10 boot entry

I got your rEFInd installed using the new nopacman install and it works if I pull up the boot menu and select it, but its booting to windows by default

do you know of a fix for this?

rayromeo1 commented 1 year ago

by the way, i just got a 2nd 3.4 update and it fixed the boot menu, it put back the steamos entry, so i guess other people reached out to valve and they quickly patched it.

it still boots to windows by default, but now my boot menu has the windows, steamos and refind entries

jlobue10 commented 1 year ago

What I suspect is happening is that the known issue of 3.4 (on preview and beta channels) preventing the efibootmgr step of disabling the Windows EFI boot entry has made it into the stable release. I know of a more complicated workaround for this, but I was holding off on coding it and uploading it until I knew whether this was going to be an issue with the stable release or not. I'd be interested in knowing if they're blocking this on purpose or if it's a bug. Either way, I am home from work now and actually have some free time tonight to look into this. I plan to re-image a fresh Steam Deck to latest stable build 3.4, install Windows and see if the script works or not, or if I experience the same issue. If I encounter the same issue, then I have my answer and I will work on coding the workaround. It will require a script run in SteamOS and Windows, which is partially why I held off. It's more complicated, but it seems to work from what I've read from Reddit. Credit goes to Reddit user lucidludic for the workaround method. Here's to hoping the efibootmgr next boot option is not blocked, or this workaround is DOA for 3.4. Either way, I should know tonight whether it's needed or not and if it actually works.

jlobue10 commented 1 year ago

With the update to 3.4 today on the Stable branch, I am seeing the same issue. The firmware seems to be forcing the Windows EFI entry to supersede all others. I've started working on the workaround.

jlobue10 commented 1 year ago

Alright, I figured out a working "fix." The problem is that with the 3.4 update, the firmware is forcing the Windows EFI file to become active and supersede every other EFI entry. This interferes with rEFInd working properly. since it can't take over the boot priority unless the Windows EFI entry is disabled. Something with system permissions is preventing this from being possible from SteamOS desktop mode, where previously it worked fine. The "fix" is actually quite simple, but requires the SteamOS recovery image or another bootable Linux (from a USB drive). My test case was using the SteamOS recovery image. Boot from the SteamOS recovery image (or other Linux distro of choice). Run these commands and take note of any Windows EFI boot entry number. It is possible with the 3.4 update that there are multiple Windows EFI entry numbers, so perform the disabling command for all of them. Something funky is up with the 3.4 firmware. I'm not sure if this is a bug or intentional on Valve's behalf. Run this from Konsole.

efibootmgr

Jot down or remember any Windows EFI boot entry numbers. Run the following command for each Windows EFI entry, replacing XXXX with the actual Windows EFI entry numbers (one at a time if multiple, and then run the command multiple times if necessary).

sudo efibootmgr -b XXXX -A

This will successfully disable the Windows EFI entry, the necessary step that is not working for some reason in 3.4. Reboot and rEFInd should be active. You will know the Windows EFI entries are disabled if you see the asterisk disappear from the onscreen efibootmgr printout after running the command(s). Let me know how it goes. This process was successful for me on my main Steam Deck.

rayromeo1 commented 1 year ago

hey thanks buddy il test that out in the morning, thanks for the quick work on a fix if you need a tester for any further improvements, im game, as im in the it field and beta test stuff a lot

similarion commented 1 year ago

I ran the rEFInd script again to have access to dual booting, but forgot to change the background this time around. Is there a way to change the background afterwards?

schiffy91 commented 1 year ago

Presumably only folks with Windows are having this issue, so here's a potentially easier solution for those experiencing this problem that requires nothing but Windows and an internet connection. Note, I'm not too familiar with Win32, so my solution uses a freeware 3P app EasyUEFI Trial that's unfortunately not open source.

  1. Boot into Windows
  2. Install EasyUEFI Trial
  3. Follow the instructions here to disable the Windows Boot Loader.
  4. Enjoy SteamDeck_rEFInd

This should basically do the equivalent of sudo efibootmgr -b XXXX -A in the recovery OS. If anyone knows how to do this via command prompt in Windows, let us know! I'm pretty sure you can use bcdedit, but I'm not familiar enough with DOS to take a stab.

jlobue10 commented 1 year ago

Yes, good addition. I can look into figuring out the equivalent bcdedit command and testing it. Over the next few days, I plan to reimage a fresh Steam Deck and test what this experience is like with brand new 3.4 and Windows. I'm assuming that the efibootmgr command will still be blocked, but I will look into it. It's also possible that the sudo steamos-readonly disable command is not setting permissions adequately in 3.4, so there may be a different method needed if that's the case. In any event, I need to do more testing, and I will have time to do so over the next few days / next week.

lewis2e commented 1 year ago

Just to add more information to this (maybe).

I also had this issue. Attempting to disable the Windows boot entry via SteamOS desktop mode failed. efibootmgr kept complaining "boot entry not found", even though running it without any command line options shows all the expected boot entries. It felt a bit like it was gaslighting me...

I thought I was being super clever, as I actually have a Manjaro installation on my SteamDeck's SD card which I use when I want to do some personal stuff at work. So I booted into that and tried to use efibootmgr again. Based on the comments in this thread, I really thought this would be the solution. But it didn't work. Exact same error.

Then I tried the EasyUEFI solution from Windows. This seems to have worked, so thank you @schiffy91.

I'm documenting all this just for information in case it is helpful.

rayromeo1 commented 1 year ago

hey buddy i followed your guide, i used the steamos recovery image, went to konsole and ran those commands and when i finished i noticed the boot order had refind like 3rd on the list so i fixed that and it now boots directly to refind :)

here is how i changed the order: sudo efibootmgr -o 000,002,001

the numbers i filled in, inorder are: refind,steamos,windows

jlobue10 commented 1 year ago

hey buddy i followed your guide, i used the steamos recovery image, went to konsole and ran those commands and when i finished i noticed the boot order had refind like 3rd on the list so i fixed that and it now boots directly to refind :)

here is how i changed the order: sudo efibootmgr -o 000,002,001

the numbers i filled in, inorder are: refind,steamos,windows

Sounds good. This is another normally not possible thing to accomplish from the SteamOS desktop mode, as the firmware does not respect manually changing the boot order. The script automatically does this though by "installing" the rEFInd entry last, making it first in the bootorder in a way that the firmware respects and does not block.

Long story short, if re-running the rEFInd installation script from SteamOS desktop mode does not work for people, since the 3.4 updated firmware force reinstalls and re-enables a Windows EFI boot entry (for some users), then just boot from the SteamOS recovery image and run the installation script from there. I think this will be simplest for most people, and have the same effect as what you describe.

rayromeo1 commented 1 year ago

hey buddy i followed your guide, i used the steamos recovery image, went to konsole and ran those commands and when i finished i noticed the boot order had refind like 3rd on the list so i fixed that and it now boots directly to refind :) here is how i changed the order: sudo efibootmgr -o 000,002,001 the numbers i filled in, inorder are: refind,steamos,windows

Sounds good. This is another normally not possible thing to accomplish from the SteamOS desktop mode, as the firmware does not respect manually changing the boot order. The script automatically does this though by "installing" the rEFInd entry last, making it first in the bootorder in a way that the firmware respects and does not block.

Long story short, if re-running the rEFInd installation script from SteamOS desktop mode does not work for people, since the 3.4 updated firmware force reinstalls and re-enables a Windows EFI boot entry (for some users), then just boot from the SteamOS recovery image and run the installation script from there. I think this will be simplest for most people, and have the same effect as what you describe.

thanks for the help buddy, by the way i got a 2nd patched version of 3.4 this morning, not sure what they changed today, ik the first patch was supposed to revert the sdcard mount point

jlobue10 commented 1 year ago

I think this issue can be closed now. It's clear to me that Valve pushed firmware changes with 3.4 that force Windows to assume boot priority, even when the EFI entry was previously disabled. SteamOS desktop mode cannot successfully disable the Windows EFI entry any more (blocked by firmware or other system permissions). Two workarounds exist, and both are adequate. If you already had a functioning rEFInd installation, just boot into the SteamOS recovery image from USB. Either manually disable the Windows EFI entry (with a proper efibootmgr command) or just re-clone my repository and run the main script one last time. I may consider making a version of the script that can do everything properly when booted from the SteamOS recovery image, but for now I have not done this. This would require some manual partition mounts and edits to some of the commands, so I think a separate script would be justified (if people wanted it).

I'm hoping in a future release that Valve reverses this firmware change. It is obtrusive, and seems completely unnecessary.

The other possible workaround is do to what schiffy91 described up above from Windows with EasyUEFI Trial.

Closed, since two acceptable workarounds exist.

francisvel commented 1 year ago

Presumably only folks with Windows are having this issue, so here's a potentially easier solution for those experiencing this problem that requires nothing but Windows and an internet connection. Note, I'm not too familiar with Win32, so my solution uses a freeware 3P app EasyUEFI Trial that's unfortunately not open source.

  1. Boot into Windows
  2. Install EasyUEFI Trial
  3. Follow the instructions here to disable the Windows Boot Loader.
  4. Enjoy SteamDeck_rEFInd

This should basically do the equivalent of sudo efibootmgr -b XXXX -A in the recovery OS. If anyone knows how to do this via command prompt in Windows, let us know! I'm pretty sure you can use bcdedit, but I'm not familiar enough with DOS to take a stab.

Thank you sir, and thanks jlobue10, your way worked as well on my friends steamdeck and Schiffy91 worked as well on mine.

Also with the EASY UEFI Trial, you can also move rEFInd up to be the first boot option just to be safe.