diff options
| -rw-r--r-- | meta/classes/populate_sdk_ext.bbclass | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass index 5dd60515d5..fa36a9168e 100644 --- a/meta/classes/populate_sdk_ext.bbclass +++ b/meta/classes/populate_sdk_ext.bbclass | |||
| @@ -15,7 +15,9 @@ SDK_RDEPENDS_append_task-populate-sdk-ext = " ${SDK_TARGETS}" | |||
| 15 | 15 | ||
| 16 | SDK_RELOCATE_AFTER_INSTALL_task-populate-sdk-ext = "0" | 16 | SDK_RELOCATE_AFTER_INSTALL_task-populate-sdk-ext = "0" |
| 17 | 17 | ||
| 18 | SDK_META_CONF_WHITELIST ?= "MACHINE DISTRO PACKAGE_CLASSES" | 18 | SDK_LOCAL_CONF_WHITELIST ?= "" |
| 19 | SDK_LOCAL_CONF_BLACKLIST ?= "CONF_VERSION BB_NUMBER_THREADS PARALLEL_MAKE PRSERV_HOST" | ||
| 20 | SDK_INHERIT_BLACKLIST ?= "buildhistory icecc" | ||
| 19 | 21 | ||
| 20 | SDK_TARGETS ?= "${PN}" | 22 | SDK_TARGETS ?= "${PN}" |
| 21 | OE_INIT_ENV_SCRIPT ?= "oe-init-build-env" | 23 | OE_INIT_ENV_SCRIPT ?= "oe-init-build-env" |
| @@ -109,15 +111,35 @@ python copy_buildsystem () { | |||
| 109 | f.write(' "\n') | 111 | f.write(' "\n') |
| 110 | 112 | ||
| 111 | # Create local.conf | 113 | # Create local.conf |
| 114 | local_conf_whitelist = (d.getVar('SDK_LOCAL_CONF_WHITELIST', True) or '').split() | ||
| 115 | local_conf_blacklist = (d.getVar('SDK_LOCAL_CONF_BLACKLIST', True) or '').split() | ||
| 116 | def handle_var(varname, origvalue, op, newlines): | ||
| 117 | if varname in local_conf_blacklist or (origvalue.strip().startswith('/') and not varname in local_conf_whitelist): | ||
| 118 | newlines.append('# Removed original setting of %s\n' % varname) | ||
| 119 | return None, op, 0, True | ||
| 120 | else: | ||
| 121 | return origvalue, op, 0, True | ||
| 122 | varlist = ['[^#=+ ]*'] | ||
| 123 | builddir = d.getVar('TOPDIR', True) | ||
| 124 | with open(builddir + '/conf/local.conf', 'r') as f: | ||
| 125 | oldlines = f.readlines() | ||
| 126 | (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var) | ||
| 127 | |||
| 112 | with open(baseoutpath + '/conf/local.conf', 'w') as f: | 128 | with open(baseoutpath + '/conf/local.conf', 'w') as f: |
| 113 | f.write('# WARNING: this configuration has been automatically generated and in\n') | 129 | f.write('# WARNING: this configuration has been automatically generated and in\n') |
| 114 | f.write('# most cases should not be edited. If you need more flexibility than\n') | 130 | f.write('# most cases should not be edited. If you need more flexibility than\n') |
| 115 | f.write('# this configuration provides, it is strongly suggested that you set\n') | 131 | f.write('# this configuration provides, it is strongly suggested that you set\n') |
| 116 | f.write('# up a proper instance of the full build system and use that instead.\n\n') | 132 | f.write('# up a proper instance of the full build system and use that instead.\n\n') |
| 133 | for line in newlines: | ||
| 134 | if line.strip() and not line.startswith('#'): | ||
| 135 | f.write(line) | ||
| 117 | 136 | ||
| 118 | f.write('INHERIT += "%s"\n\n' % 'uninative') | 137 | f.write('INHERIT += "%s"\n\n' % 'uninative') |
| 119 | f.write('CONF_VERSION = "%s"\n\n' % d.getVar('CONF_VERSION', False)) | 138 | f.write('CONF_VERSION = "%s"\n\n' % d.getVar('CONF_VERSION', False)) |
| 120 | 139 | ||
| 140 | # Some classes are not suitable for SDK, remove them from INHERIT | ||
| 141 | f.write('INHERIT_remove = "%s"\n' % d.getVar('SDK_INHERIT_BLACKLIST')) | ||
| 142 | |||
| 121 | # This is a bit of a hack, but we really don't want these dependencies | 143 | # This is a bit of a hack, but we really don't want these dependencies |
| 122 | # (we're including them in the SDK as nativesdk- versions instead) | 144 | # (we're including them in the SDK as nativesdk- versions instead) |
| 123 | f.write('POKYQEMUDEPS_forcevariable = ""\n\n') | 145 | f.write('POKYQEMUDEPS_forcevariable = ""\n\n') |
| @@ -134,8 +156,6 @@ python copy_buildsystem () { | |||
| 134 | # Ensure locked sstate cache objects are re-used without error | 156 | # Ensure locked sstate cache objects are re-used without error |
| 135 | f.write('SIGGEN_LOCKEDSIGS_CHECK_LEVEL = "warn"\n\n') | 157 | f.write('SIGGEN_LOCKEDSIGS_CHECK_LEVEL = "warn"\n\n') |
| 136 | 158 | ||
| 137 | for varname in d.getVar('SDK_META_CONF_WHITELIST', True).split(): | ||
| 138 | f.write('%s = "%s"\n' % (varname, d.getVar(varname, True))) | ||
| 139 | f.write('require conf/locked-sigs.inc\n') | 159 | f.write('require conf/locked-sigs.inc\n') |
| 140 | f.write('require conf/work-config.inc\n') | 160 | f.write('require conf/work-config.inc\n') |
| 141 | 161 | ||
