How do I programmatically invoke Startup Manager at subsequent boot?

As "https://sourceforge.net/p/refind/discussion/general/thread/05965d36c2/#d8df" partially describes, I am attempting to programmatically invoke Startup Manager at subsequent boot, and ideally reboot immediately subsequently. This is similar to what "http://github.com/OpenRC/openrc/issues/539#issue-1324331600" describes performs, but ideally I'd like a way to be able to set macOS to invoke the Startup Manager without needing to force a reboot immediately, because I can always invoke manually reinitialize the device by invoking “reboot”, obviously.

I, as is true for most, am unable to observe the macOS source-code, so I obviously am unable to emulate how macOS performs this. However, I am additionally unable to locate any relevant documentation.

I am thankful for any assistance.

Accepted Answer
  1. Access the EFI shell, potentially as "http://stackoverflow.com/a/70191983" describes, or via the UEFI.
  2. Access startup.nsh as "https://forums.freebsd.org/threads/startup-nsh.79973/post-507479" describes, or via the UEFI.
  3. Modify startup.nsh (this includes what the EFI automatically invokes) to include reset -c -fwui (as "https://sourceforge.net/p/refind/discussion/general/thread/05965d36c2/#ae25" describes) because that command invokes the interface for the firmware.

I have not evaluated this. It is mere consolidation of research.

How do I programmatically invoke Startup Manager at subsequent boot?
 
 
Q