initial commit

This commit is contained in:
michirod 2021-04-06 14:32:24 +02:00
commit a244cc3127

View File

@ -0,0 +1,51 @@
import os
import sys
M4SS_VALID_MACHINES = [
'intel-corei7-64',
]
def __set_defaults_m4ss_embedded_linux_yocto():
global M4SS_VALID_MACHINES
global M4SS_VALID_DISTROS
local_conf_exists = os.path.isfile(os.path.join(build_dir, 'conf', 'local.conf'))
def required_var_error(varname, valid_vals):
sys.stderr.write("ERROR: You must set '%s' before setting up the environment.\n" % (varname,))
sys.stderr.write(" Set '%s' variable with one of the possible values.\n"
" Possible values are: %s\n\n" % (varname, valid_vals))
sys.exit(1)
def maybe_set_default(varname, valid_vals):
try:
val = os.environ[varname]
except KeyError:
val = None
if val:
if val in valid_vals:
set_default(varname, val)
return val
else:
required_var_error(varname, valid_vals)
elif not local_conf_exists:
required_var_error(varname, valid_vals)
maybe_set_default('MACHINE', M4SS_VALID_MACHINES)
set_default('DISTRO', 'm4ss')
def __after_init_m4ss_embedded_linux_yocto():
PLATFORM_ROOT_DIR = os.environ['PLATFORM_ROOT_DIR']
append_layers([os.path.join(PLATFORM_ROOT_DIR, 'sources', p) for p in [
'meta-openembedded/meta-oe',
'meta-openembedded/meta-filesystems',
'meta-openembedded/meta-networking',
'meta-openembedded/meta-python',
'meta-virtualization',
'meta-mender/meta-mender-core',
]])
run_set_defaults(__set_defaults_m4ss_embedded_linux_yocto)
run_after_init(__after_init_m4ss_embedded_linux_yocto)