n-d-k / OpenCorePkg

OpenCore front end
BSD 3-Clause "New" or "Revised" License
105 stars 11 forks source link

Select boot drives in Startup Disk preference panel #7

Closed darthsian closed 4 years ago

darthsian commented 4 years ago

On the original OpenCore fork this works without problem.

btw, good work with your customization :-)

btwise commented 4 years ago

It seems that the boot disk function can not be used, only the menu to remember the last boot disk, NVRAM function than the original problem

n-d-k commented 4 years ago

It seems that the boot disk function can not be used, only the menu to remember the last boot disk, NVRAM function than the original problem

The boot disk/Startup disk preference is only needed if you don't have the auto default to last booted entry function in place, and it will never work correctly if you have multiple oses or multiple version of the same os on the same disk. It will make more sense just to remember the last booted entry and keeping booting the same one until user decide to change via picker menu.

btwise commented 4 years ago

how to don'tuse the auto default to last booted entry function ? There were a lot of updates from OC yesterday, and your OC should be up-to-date as well

n-d-k commented 4 years ago

how to don'tuse the auto default to last booted entry function ?

If you don't want it to default to last booted entry, you can add a NVRAM->Block->7C436110-AB2A-4BBB-A880-FE41995C9F82->Item 0->efi-boot-device-data

Let me explain the disadvantage of not using auto default boot, if you set your show picker to off, when you reboot the system and don't touch the keyboard, before OC scanning all the drives and bootable partition and generating the boot entries, it will perform a check on that auto default last booted entry, if it exist it will just skip all the scanning and generating operation and boot using that info from last booted entry.

I still don't understand why one don't want to take advantage of this feature, and what is exactly the purpose of using Startup disk preference? The system will always start up using the disk that has OC on it regardless of whatever is set in there. And if it was used to choose a default OS to boot, then why not just use Picker Menu.

btwise commented 4 years ago

how to don'tuse the auto default to last booted entry function ?

If you don't want it to default to last booted entry, you can add a NVRAM->Block->7C436110-AB2A-4BBB-A880-FE41995C9F82->Item 0->efi-boot-device-data

Let me explain the disadvantage of not using auto default boot, if you set your show picker to off, when you reboot the system and don't touch the keyboard, before OC scanning all the drives and bootable partition and generating the boot entries, it will perform a check on that auto default last booted entry, if it exist it will just skip all the scanning and generating operation and boot using that info from last booted entry.

I still don't understand why one don't want to take advantage of this feature, and what is exactly the purpose of using Startup disk preference? The system will always start up using the disk that has OC on it regardless of whatever is set in there. And if it was used to choose a default OS to boot, then why not just use Picker Menu.

Everything in the design of OC seems to be more like Apple's native state, but many users are not necessarily like this, prefer the habit of CLOVER, so various problems have arisen!

btwise commented 4 years ago

In this update, what is NVRAM-> WriteFlash, how to understand and use it?

n-d-k commented 4 years ago

In this update, what is NVRAM-> WriteFlash, how to understand and use it?

it allows you or other applications writable permission or ability to change to those nvram variables that you added in Config.plist NVRAM->Add section when using OS.

btwise commented 4 years ago

In this update, what is NVRAM-> WriteFlash, how to understand and use it?

it allows you or other applications writable permission or ability to change to those nvram variables that you added in Config.plist NVRAM->Add section when using OS.

I don't understand. Is there an example!

Doesn't it make it possible for the operating system to read and write NVRAM on a motherboard that doesn't support Native Nvram? What does this have to do with analog Nvram

n-d-k commented 4 years ago

In this update, what is NVRAM-> WriteFlash, how to understand and use it?

it allows you or other applications writable permission or ability to change to those nvram variables that you added in Config.plist NVRAM->Add section when using OS.

I don't understand. Is there an example!

Doesn't it make it possible for the operating system to read and write NVRAM on a motherboard that doesn't support Native Nvram? What does this have to do with analog Nvram

If the motherboard don't have native nvram, then emulated one will take its place and fool the OS into thinking it's a native nvram one, the only difference is emulated nvram will store its data to the efi partition (nvram.plist).

btwise commented 4 years ago

So now if enabled this WriteFlash option, we can simply turn on Simulation NVRAM support option ? It doesn't take as many steps to create a login and logoit Nvram.plist? Is this correct?

n-d-k commented 4 years ago

This is just another unnecessary tiny security quirk, which only applied to those added nvram section as far as i can see, you can just simply ignore. It doesn't affect anything if you set it either way.

darthsian commented 4 years ago

It seems that the boot disk function can not be used, only the menu to remember the last boot disk, NVRAM function than the original problem

The boot disk/Startup disk preference is only needed if you don't have the auto default to last booted entry function in place, and it will never work correctly if you have multiple oses or multiple version of the same os on the same disk. It will make more sense just to remember the last booted entry and keeping booting the same one until user decide to change via picker menu.

Im ok with "auto default to last booted entry function", i just want to report error if someone use "Startup disk". I think that its ok if Startup disk wont work if auto default is used, but it shouldn't lead to unbootable state.

btwise commented 4 years ago

Yes, both methods should work best without breaking the core functionality

n-d-k commented 4 years ago

Yes, both methods should work best without breaking the core functionality

Ok, let me ask everyone this, a macOS is installed on a M2 nvme drive, which needed a nvme driver to load in order to see this drive, the system has to use another sata drive and its efi partition to install OC and boot OC from there, load nvme driver, scan the system and see the macOS installed on M2 nvme drive and now it can boot the macOS in the M2 nvme drive. Now if someone go in the start up disk in preference pane, and choose to set that macOS as start up disk, what do you think it will happen? It will generate a broken variable efi-boot-device-data that lead to breaking the boot. That's why I said the startup disk in preference pane is there for real mac, and it will never work correctly in hackintosh world. So it's better be left alone untouch. I am not gonna discuss this topic any longer, since i already tried to explain it over and over, so people can understand. I am gonna close this topic and will not answer any inquiry about this anymore.

mhaeuser commented 4 years ago

it will never work correctly if you have multiple oses or multiple version of the same os on the same disk.

Wrong.

I still don't understand why one don't want to take advantage of this feature, and what is exactly the purpose of using Startup disk preference?

If a default changes every time you select something different, it is not a default. The option to always boot the OS last started might be handy for a few people, but design-wise it makes no sense at all except wearing your flash memory. Infact, macOS updates and such use bless and the default boot option value for a seamless installation process, so you're much more likely to bork things with your approach. There had been various such issues with Clover and Catalina.

The system will always start up using the disk that has OC on it regardless of whatever is set in there.

Wrong.

it allows you or other applications writable permission or ability to change to those nvram variables that you added in Config.plist NVRAM->Add section when using OS.

Wrong, that should work out of the box, however some UEFI firmwares have a bug where volatile to non-volatile promotion does not work at runtime. As all quirks, it's a workaround and not a feature.

a macOS is installed on a M2 nvme drive, which needed a nvme driver to load in order to see this drive, the system has to use another sata drive and its efi partition to install OC and boot OC from there [...] Now if someone go in the start up disk in preference pane, and choose to set that macOS as start up disk, what do you think it will happen? It will generate a broken variable efi-boot-device-data that lead to breaking the boot. That's why I said the startup disk in preference pane is there for real mac, and it will never work correctly in hackintosh world.

Wrong entirely, this will work just fine if configured correctly.

Design things whatever way you like to, but please try to not misinform or misadvice users.

n-d-k commented 4 years ago

It's easy for you to just say wrong, but i did test all the thing that mention above. And for wearing the flash memory, it's only write when switching to a different OS, all other times, it's just a read only.

For window OS that reside on the same drive as MacOS will never show up in Start up preference pane for you to select as default.

mhaeuser commented 4 years ago

Then you either have a firmware that creates borked Device Paths (REF https://github.com/acidanthera/bugtracker/issues/664) or you did not read both the documentation and the code. Whatever you select in Startup Disk panel will be the default when RequestBootVarRouting is on and the FW is not broken. This working has been confirmed literally dozens of times on various Intel and AMD machines across firmware generations (Aptio 4 and 5) and vendors.

For window OS that reside on the same drive as MacOS will never show up in Start up preference pane for you to select as default.

Sorry, but wrong again, if both your partition table and your SMBIOS are configured correctly, it works perfectly fine. It literally works like on Macs, where Boot Camp obviously uses the same drive as destination as well. I don't know what kind of tests you run, but they are not representative at all.

n-d-k commented 4 years ago
Screen Shot 2020-01-16 at 2 12 18 PM

I do have more than those 2 OSes, and it doesn't show all of them. And i don't see Windows at all.

mhaeuser commented 4 years ago

Then very likely you either have 1) a valid UEFI partition setup (GPT and ESP first) and UEFI Windows support is not reported by FirmwareFeatures or 2) an invalid UEFI partition setup (MBR or ESP not first) and CSM support is not reported by FirmwareFeatures.