jlobue10 / SteamDeck_rEFInd

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

Is it possible to change the boot order so Windows is the default OS? #11

Closed Shadimar closed 1 year ago

Shadimar commented 1 year ago

Is it possible to change the boot order so Windows is the default OS? Thanks for this awesome script!

jlobue10 commented 1 year ago

Thank you for the kind words. Yes, this is actually just a simple edit to the refind.conf file. Just change the default_selection 1 line to be default_selection 2, and this should have Windows boot by default with the way I have the refind.conf file setup.

Shadimar commented 1 year ago

If I have already run the script, there shouldn't be any problems just running it again, right? :) Thanks for the super-fast response!!

jlobue10 commented 1 year ago

Good question. I think this part gets lost in the README. There are two ways to edit: you choose. Either after the rEFInd script has already been ran, you can do the sudo nano /esp/efi/refind/refind.conf route and edit and save from the command line, or you can open the cloned directory and find the refind.conf file there and use a GUI editor like Kate or Emacs. After editing the cloned directory version, you would just re-run the ./SteamDeck_rEFInd_install.sh command.

Shadimar commented 1 year ago

I was able to do this! Thank you so much for the explanation! Happy Holidays!

lilpetamoix commented 1 year ago

Hi, I tried the default_selection 2 but it didn't work. Upon typing efibootmgr, it looks like windows boot manager is in boot 3. The bootorder shows windows boot manager (disabled-without asterik), rEFInd, SteamOS. In order to change the bootorder within rEFInd, do i change to default_selection 3 instead to the disabled windows boot manager? sorry i'm a little confused.

jlobue10 commented 1 year ago

@lilpetamoix The default_selection 2 in this instance is actually due to how I have the manual boot stanzas at the end of the default refind.conf file (not boot number from efibootmgr). With the default config provided, the order left to right is SteamOS (1) and Windows (2). How did you edit the config file? Did you edit it directly in the installed directory with sudo nano /esp/efi/refind/refind.conf or did you edit the config file in the cloned directory? A setting of default_selection Microsoft should also work.

lilpetamoix commented 1 year ago

@lilpetamoix The default_selection 2 in this instance is actually due to how I have the manual boot stanzas at the end of the default refind.conf file (not boot number from efibootmgr). With the default config provided, the order left to right is SteamOS (1) and Windows (2). How did you edit the config file? Did you edit it directly in the installed directory with sudo nano /esp/efi/refind.refind.conf or did you edit the config file in the cloned directory? A setting of default_selection Microsoft should also work.

I edited via Windows 11 via notepad. The EFI partition in the D drive allowed me to access the refind.conf. Would this not work? Is this file only allowed to be edited via recovery mode? I thought Windows route would work since I was able to reduce the timeout this way.

I also tried default_selection Microsoft which was commented out. I removed the # but this didn't work either along with default_selection 1.

Could it be all the issues I've been having is due to edits being made in Windows as opposed to Linux environment? But if all I'm doing is changing syntax I wonder why that would matter. Or does editing in Windows doesn't flow through the permissions within Linux?

jlobue10 commented 1 year ago

Oh okay, I see what is going on here. I think you edited the wrong config file. Those 2 EFI partitions that Windows sees and mounts are not actually the proper EFI system partition (/esp). SteamOS uses those redundant EFI-A and EFI-B partitions for some reason (possibly branch changes but I'm unsure). I would suggest either making the edit in the cloned directory from SteamOS and then re-running the script to install it, or just edit from the command line with sudo nano /esp/efi/refind.refind.conf and then press Ctrl+x followed by y and then Enter. Either default_selection 2 or default_selection Microsoft should work, as long as you are editing the correct config file. Hopefully this makes sense.

lilpetamoix commented 1 year ago

Yes got it working. the path was actually /esp/efi/refind/refind.conf and not /esp/efi/refind.refind.conf. I couldn't figure out why the window opened but showed nothing until I made that change. I also didn't realize Ctrl+x was to save the file after making the change to default_selection 2.

It now works flawlessly.

Thank you for your help and fast turn around! Much appreciated from a noob Linux environment user. Thx again!!

jlobue10 commented 1 year ago

Yes, that was a typo from me. README has correct path. Happy you got it working how you like it. Happy to help. :)