Solved How to correctly detect if a program is running on an UEFI system?

For hardware autoconfiguration it is sometimes necessary to know whether the system is an UEFI system.

Maybe some information can be found in /var/run/dmesg.boot?
For example, do there appear messages from which you can deduce with certainty whether the system is an UEFI one?

I don't have an UEFI computer and so I cannot research myself.
Searching the forums didn't yield an answer.

So I'd be glad if somebody could help me, for example by posting the relevant dmesg messages, some sysctl readonly variable, or whatever solution!
 
sysctl machdep.bootmethod
Great! Big thanks!
Sadly, I have only non-UEFI computers, and these display:

Code:
# sysctl machdep.bootmethod
machdep.bootmethod: BIOS
#

Could please somebody, who has an UEFI computer, post what the output looks like on these?
 
Back
Top