mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-14 04:38:20 +10:00
23 lines
602 B
Python
23 lines
602 B
Python
# Probe for OS data
|
|
|
|
import platform
|
|
import subprocess
|
|
|
|
|
|
def detect_kernel_major():
|
|
# Return Major Kernel Version
|
|
# Example Output: 21 (integer)
|
|
return int(platform.uname().release.partition(".")[0])
|
|
|
|
|
|
def detect_kernel_minor():
|
|
# Return Minor Kernel Version
|
|
# Example Output: 1 (integer)
|
|
return int(platform.uname().release.partition(".")[2].partition(".")[0])
|
|
|
|
|
|
def detect_kernel_build():
|
|
# Return OS build
|
|
# Example Output: 21A5522h (string)
|
|
return subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
|