Skip to content

Commit

Permalink
Iterate over filesystems in startup.nsh and choose first one with Win…
Browse files Browse the repository at this point in the history
…dows (#3)
  • Loading branch information
bedrin authored Feb 2, 2022
1 parent fd96c27 commit e9321f8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ build.bat
```

### Step 5
Copy the content of `EFI` folder to the folder of same name in your EFI partition. You can also copy the folder to an FAT32 formatted usb stick. If you use usb stick, you should replace `fs0` in `startup.nsh` to `fs1`.
Copy the content of `EFI` folder to the folder of same name in your EFI partition. You can also copy the folder to an FAT32 formatted usb stick.

### Step 6

Expand Down
3 changes: 1 addition & 2 deletions setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ cd EFI
mkdir Boot
cd Boot
curl -L https://github.com/tianocore/edk2/raw/UDK2018/ShellBinPkg/UefiShell/X64/Shell.efi --output shellx64.efi
echo fs0:\EFI\Boot\PowerMonkey.efi > startup.nsh
echo fs0:\EFI\Microsoft\Boot\bootmgfw.efi >> startup.nsh
copy ..\..\startup.nsh .
cd ..
cd ..

Expand Down
26 changes: 26 additions & 0 deletions startup.nsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
fs0:\EFI\Boot\PowerMonkey.efi

if exist fs0:\EFI\Microsoft\Boot\bootmgfw.efi then
fs0:\EFI\Microsoft\Boot\bootmgfw.efi
endif
if exist fs1:\EFI\Microsoft\Boot\bootmgfw.efi then
fs1:\EFI\Microsoft\Boot\bootmgfw.efi
endif
if exist fs2:\EFI\Microsoft\Boot\bootmgfw.efi then
fs2:\EFI\Microsoft\Boot\bootmgfw.efi
endif
if exist fs3:\EFI\Microsoft\Boot\bootmgfw.efi then
fs3:\EFI\Microsoft\Boot\bootmgfw.efi
endif
if exist fs4:\EFI\Microsoft\Boot\bootmgfw.efi then
fs4:\EFI\Microsoft\Boot\bootmgfw.efi
endif
if exist fs5:\EFI\Microsoft\Boot\bootmgfw.efi then
fs5:\EFI\Microsoft\Boot\bootmgfw.efi
endif
if exist fs6:\EFI\Microsoft\Boot\bootmgfw.efi then
fs6:\EFI\Microsoft\Boot\bootmgfw.efi
endif
if exist fs7:\EFI\Microsoft\Boot\bootmgfw.efi then
fs7:\EFI\Microsoft\Boot\bootmgfw.efi
endif

0 comments on commit e9321f8

Please sign in to comment.