jlobue10 / SteamDeck_rEFInd

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

The boot order is changed every time I enter Windows #22

Closed JeFeRoJo closed 1 year ago

JeFeRoJo commented 1 year ago

Hello! Thanks for your work, works great.

I have Steam OS 3.4.4 and Windows 11 installed. Both work fine.

My problem is that when I install the script on SteamOS and reboot, it works. It shows me the OS selection and I can enter without problems But when I enter Windows for the first time and restart, the selection screen no longer appears, it always enters Windows from that moment. If I press - and Power button, the order is

Windows rEFInd Steam OS

I don't understand why the boot order changes when entering Windows.

Thanks

jlobue10 commented 1 year ago

Yes, thank you for the kind words and appreciation. I think I understand what's happening, and I will do my best to explain it to you.

The reason why it seems to be working fine from the SteamOS side and not from Windows is due to a couple of reasons. The Windows EFI entry is likely active. If the Windows EFI entry is active, it will try to assume highest boot priority. SteamOS is bypassing this with its newly added systemctl daemon that the updated script is installing and enabling. You can tell if the Windows EFI entry is active or not by running efibootmgr from the SteamOS desktop command line. If the Windows EFI entry has an asterisk ( * ) on the line, then it is indeed active. This can no longer be disabled (how it could previously) from a regular SteamOS command line, or if it can, I'm not sure how right now. It can luckily be disabled from a SteamOS recovery command line, or from Windows using EasyUEFI. Disabling the Windows EFI entry is no longer a strict requirement if you complete the full setup by installing the bootsequence-rEFInd-first.ps1 script as a Windows scheduled task. The README goes over this in more detail. It is a one time setup (temporarily undo it if initiating a BIOS update from Windows). I still strongly recommend disabling the Windows EFI entry though, especially if you're doing a triple boot option with Batocera or something else as a 3rd option. This Windows scheduled task basically performs the same task from Windows side, that the newly added systemctl daemon is doing on the SteamOS side: setting rEFInd as the next boot's top priority (a one time setting that needs to be refreshed every OS log in). This is based on a pretty clever workaround from user lucidludic on Reddit. Let's hope Valve doesn't also block this in a future update. :)

Please let me know if you have further questions or issues. If this solves your issue, please comment and close.

jlobue10 commented 1 year ago

@johnrkriter I'm seeing (maybe a deleted?) comment from you on my e-mail here. I pushed a merge that should be language agnostic for the powershell scripts today (thank you @icetard ). Syntax wise, it looks solid, but I still need to test it a bit more thoroughly at home tonight. I would suggest making sure that the file size is around 1KB or so roughly (for the powershell scripts) and not the 120 - 130KB that the improperly formatted webpage version of the .ps1 file would be. The easiest way to do this is to just freshly clone the repo from Windows. Once I can thoroughly vet these .ps1 script updates tonight, I may make one more minor release, v1.0.9. Then I'd expect v1.1.0 should be with the initial version of the GUI, hopefully in the coming weeks.

johnrkriter commented 1 year ago

@johnrkriter I'm seeing (maybe a deleted?) comment from you on my e-mail here. I pushed a merge that should be language agnostic for the powershell scripts today (thank you @Icetard ). Syntax wise, it looks solid, but I still need to test it a bit more thoroughly at home tonight. I would suggest making sure that the file size is around 1KB or so roughly (for the powershell scripts) and not the 120 - 130KB that the improperly formatted webpage version of the .ps1 file would be. The easiest way to do this is to just freshly clone the repo from Windows. Once I can thoroughly vet these .ps1 script updates tonight, I may make one more minor release, v1.0.9. Then I'd expect v1.1.0 should be with the initial version of the GUI, hopefully in the coming weeks.

I made a mistake and was too embarrassed to admit it was because of trying to pipe the file from github incorrectly :) The script works as intended and I look forward to the GUI release.

jlobue10 commented 1 year ago

Oh no worries. Nothing to be ashamed of or embarrassed about. I just wanted to make sure that your issue was resolved. Thank you for your detailed response on the other issue.

malaguer commented 1 year ago

I've logged on Github just to express my gratitude for such an excellent work. I've installed your UEFI bootloader and everything is working like a charm. It took me a while to make it work but it totally worth it. Thanks a lot for sharing your code.

Kudos. :)

jlobue10 commented 1 year ago

Thank you @malaguer . It's people like you and comments like that, that encourage me to keep working on the GUI. I think I'm finally satisfied with how the GUI looks after last night. Since I'm not a full fledged Qt / C++ developer (haven't touched C++ since college...), the going is a little bit slow, but I feel I am still making good progress when I can. I can start working on the behind the scenes function calls for forms and button presses now.

Getting a little bit off topic here though... @JeFeRoJo has you problem been solved by this comment chain, or did you figure it out another way?

malaguer commented 1 year ago

@jlobue10 Sorry if this is not the best place to write this but I didn't find any Private Message option here on Github and didn't want to open a new Issue if there is no need for it.

I've been testing some changes in your Windows-side solution to retain the right boot order that you might find useful.

I wanted to be able to restart Windows and come back to Windows without having to interact with rEFInd bootloader, but still keep it working on every Windows shutdown in order to change OS whenever I want. It is a little change in the behaviour just for convenience for the time that I want to work only in Windows.

It is not a perfect or even elegant solution, it's a bit messy to say the truth... but it works, which is what I was looking for.

If you think that it could help your project I'd be glad sharing the patch with you and the community. Or you might consider the idea as a suggestion in case you want to elaborate your own solution.

I just wanted to let you know that it is possible to make rEFInd work that way (at least with my Windows 10 version) and I find it very practical for the time when I need to work with Windows only.

Let me know what you think about it. And whatever the answer, I congrat you again for your work. My Steam Deck works much better thanks to rEFInd. :)

jlobue10 commented 1 year ago

@malaguer feel free to message me on Reddit with the same username. I think you can get exactly what you want with just the right refind.conf settings, if I'm thinking correctly about what you're trying to accomplish here.

jlobue10 commented 1 year ago

Closing this, as methods and workarounds are known to block Windows from assuming the highest boot priority. These are documented in the README.