installmacos.py: install_product: set CM_BUILD

Set CM_BUILD env var in install_product()

This makes it possible to install machine-specific OS builds on 'non-supported' hardware
for example, 10.14.4 (18E2034) on machines that aren't iMac19,1 or iMac19,2.
This commit is contained in:
shinjukumiku 2020-01-31 11:19:53 +00:00 committed by GitHub
parent 0276ddd1ba
commit 96bb710d85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,6 +208,9 @@ def unmountdmg(mountpoint):
def install_product(dist_path, target_vol):
'''Install a product to a target volume.
Returns a boolean to indicate success or failure.'''
# set CM_BUILD env var to make Installer bypass eligibilty checks
# when installing packages (for machine-specific OS builds)
os.environ["CM_BUILD"] = "CM_BUILD"
cmd = ['/usr/sbin/installer', '-pkg', dist_path, '-target', target_vol]
try:
subprocess.check_call(cmd)