mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-05 07:29:54 +00:00
tools: Support sdkconfig.rename files from outside IDF in confgen.py
This commit is contained in:

committed by
Angus Gratton

parent
ba0f4f17ed
commit
a8e8919bbf
@@ -29,6 +29,10 @@ def main():
|
||||
help='KConfig file with config item definitions',
|
||||
required=True)
|
||||
|
||||
parser.add_argument('--sdkconfig-rename',
|
||||
help='File with deprecated Kconfig options',
|
||||
required=False)
|
||||
|
||||
parser.add_argument('--env', action='append', default=[],
|
||||
help='Environment to set when evaluating the config file', metavar='NAME=VAL')
|
||||
|
||||
@@ -62,12 +66,14 @@ def main():
|
||||
env = json.load(args.env_file)
|
||||
os.environ.update(env)
|
||||
|
||||
run_server(args.kconfig, args.config)
|
||||
run_server(args.kconfig, args.config, args.sdkconfig_rename)
|
||||
|
||||
|
||||
def run_server(kconfig, sdkconfig, default_version=MAX_PROTOCOL_VERSION):
|
||||
def run_server(kconfig, sdkconfig, sdkconfig_rename, default_version=MAX_PROTOCOL_VERSION):
|
||||
config = kconfiglib.Kconfig(kconfig)
|
||||
deprecated_options = confgen.DeprecatedOptions(config.config_prefix, path_rename_files=os.environ["IDF_PATH"])
|
||||
sdkconfig_renames = [sdkconfig_rename] if sdkconfig_rename else []
|
||||
sdkconfig_renames += os.environ.get("COMPONENT_SDKCONFIG_RENAMES", "").split()
|
||||
deprecated_options = confgen.DeprecatedOptions(config.config_prefix, path_rename_files=sdkconfig_renames)
|
||||
with tempfile.NamedTemporaryFile(mode='w+b') as f_o:
|
||||
with open(sdkconfig, mode='rb') as f_i:
|
||||
f_o.write(f_i.read())
|
||||
|
Reference in New Issue
Block a user