unraid / usb-creator-next

The home of the Next-Gen Unraid USB Creator, a fork of the Raspberry Pi Imager
https://unraid.net/getting-started
Other
9 stars 4 forks source link

Allow Legacy Boot #8

Open elibosley opened 9 months ago

elibosley commented 9 months ago

This may not be possible w/ the Raspberry PI Creator, but if it is possible, add an option in the settings menu for this called "Enable Legacy Boot"

If Legacy Boot is selected, rename "EFI" to "EFI-" (depending on the version of Unraid, this may already be done) and run the make_bootable.bat|make_bootable_linux|make_bootable_mac script

jlre249 commented 7 months ago

just to make sure i understand - it looks like, in the current usb creator, there is a checkbox called "allow uefi boot", and if that checkbox is checked, we rename "EFI-" to "EFI". but it sounds like, in conjunction with #7, we want to default to UEFI boot, and only keep "EFI-" if this new legacy boot checkbox is checked. does that sound right?

elibosley commented 7 months ago

Not quite.

On new Releases of Unraid the folder EFI- is named EFI by default, so we'd want to keep that folder unless the "Allow Legacy Boot" is checked.

Here are the rules:

  1. legacy boot unchecked (default) a. if EFI exists on Zip file, do nothing b. if -EFI exists on Zip file, rename to EFI

  2. legacy boot checked a. If EFI exists on Zip file, rename to -EFI b. if -EFI exists, do not change it c. ensure raspberry pi can create a legacy bootable drive in the first place, as it requires some weird partition trickery d. Run make bootable script after flashing (as in description above)

We also need to make sure that the raspberry pi formatter even formats properly for legacy boot, I'm not sure if it does what is necessary to allow a legacy boot to work.

elibosley commented 7 months ago

Just a follow up from this, we chatted today and I'm going to make the part 2c -> 2d. Optional for delivery as it may introduce a lot of additional variables.

elibosley commented 7 months ago

Here's some more context if you look at this again:

In looking at the three make_bootable scripts:

For make_bootable.bat (windows): if neither EFI nor EFI- directories exist then the script jumps directly to running the 'syslinux' command. In this case USB Creator can rename EFI to EFI-save (for example), run 'make_bootable.bat' then rename EFI-save to whatever is should be.

For make_bootable_linux unfortunately it's going to prompt no matter what. I don't know how QT is invoking external scripts. i know if 'bash' is used then a construct like this would work to feed the 'N' to the script: make_bootable <<< "N" or 'Y' make_bootable <<< "Y" (the triple '<' chars are a bash'ism)

For make_bootable_mac - same thing, it's going to prompt and not sure what shell MacOS uses.

elibosley commented 6 months ago

Our dev tested this working :)

elibosley commented 4 months ago

This has been reopened due to escalation issues with the script on Linux / Mac