def mconfig(argv): kconfig = os.path.join("tools", "menuconfig", "extra", "Configs", "Config.in") display_style = "default selection=fg:white,bg:blue" target_conf = os.path.join(".config") header = "# Generated by Huawei LiteOS Kconfig Tool" mconf_set_env(display_style, target_conf, header) kconf = Kconfig(filename=kconfig) if len(argv) == 2 and argv[1] == 'savemenuconfig': kconf.load_config() print(kconf.write_config()) # savemenuconfig elif len(argv) == 2 and argv[1] == 'defconfig': kconf.load_allconfig("alldef.config") print(kconf.write_config()) # defconfig elif len(argv) == 2 and argv[1] == 'allyesconfig': kconf.warn = False for sym in kconf.unique_defined_syms: sym.set_value(1 if sym.choice else 2) for choice in kconf.unique_choices: choice.set_value(2) kconf.warn = True kconf.load_allconfig("allyes.config") print(kconf.write_config()) # allyesconfig elif len(argv) == 2 and argv[1] == 'allnoconfig': kconf.warn = False for sym in kconf.unique_defined_syms: sym.set_value(2 if sym.is_allnoconfig_y else 0) kconf.warn = True kconf.load_allconfig("allno.config") print(kconf.write_config()) # allnoconfig else: menuconfig(kconf) # menuconfig kconf.write_autoconf()
def main(): parse_args() print("Parsing Kconfig tree in {}".format(args.kconfig_root)) kconf = Kconfig(args.kconfig_root, warn_to_stderr=False) # Enable warnings for assignments to undefined symbols kconf.enable_undef_warnings() # This script uses alldefconfig as the base. Other starting states could be set # up here as well. The approach in examples/allnoconfig_simpler.py could # provide an allnoconfig starting state for example. print("Using {} as base".format(args.conf_fragments[0])) for config in args.conf_fragments[1:]: print("Merging {}".format(config)) # Create a merged configuration by loading the fragments with replace=False for config in args.conf_fragments: kconf.load_config(config, replace=False) # Write the merged configuration and the C header. This will evaluate all # symbols, which might generate additional warnings, so do it before # checking for warnings. kconf.write_config(args.dotconfig) kconf.write_autoconf(args.autoconf) # Print warnings for symbols whose actual value doesn't match the assigned # value for sym in kconf.defined_syms: # Was the symbol assigned to? Choice symbols are checked separately. if sym.user_value is not None and not sym.choice: verify_assigned_sym_value(sym) # Print warnings for choices whose actual selection doesn't match the user # selection for choice in kconf.choices: if choice.user_selection: verify_assigned_choice_value(choice) # We could roll this into the loop below, but it's nice to always print all # warnings, even if one of them turns out to be fatal for warning in kconf.warnings: if enabled(warning): print(warning, file=sys.stderr) # Turn all warnings except for explicity whitelisted ones into errors. In # particular, this will turn assignments to undefined Kconfig variables # into errors. # # A warning is generated by this script whenever a symbol gets a different # value than the one it was assigned. Keep that one as just a warning for # now as well. for warning in kconf.warnings: if fatal(warning): sys.exit("Error: Aborting due to non-whitelisted Kconfig " "warning '{}'.\nNote: If this warning doesn't point " "to an actual problem, you can add it to the " "whitelist at the top of {}.".format( warning, sys.argv[0]))
def main(): parser = argparse.ArgumentParser(description="Merge .config files.") parser.add_argument("--outfile", required=True) parser.add_argument("config_files", nargs="+") args = parser.parse_args() config = Kconfig("Kconfig") config.warn_assign_override = False config.warn_assign_redun = False for config_file in args.config_files: config.load_config(config_file, replace=False) config.write_config(args.outfile)
def main(): kconf = Kconfig(KCONFIG_FILE, warn=False) kconf.load_config(DEFCONFIG) if sys.argv[1] == "GDB_INTERNAL": try: for opt in open("../config_append", "r").readlines(): enable_opt(kconf, opt) except: pass set_debug(kconf) disable_opt(kconf, 'SMP') # enable_opt(kconf, 'BLK_DEV_INITRD') # enable_opt(kconf, 'BLK_DEV_RAM') kconf.write_config(CONFIG_FILE)
# set up here as well. The approach in examples/allnoconfig_simpler.py could # provide an allnoconfig starting state for example.) # Disable warnings generated for multiple assignments to the same symbol within # a (set of) configuration files. Assigning a symbol multiple times might be # done intentionally when merging configuration files. kconf.warn_assign_override = False kconf.warn_assign_redun = False # Create a merged configuration by loading the fragments with replace=False. # load_config() and write_config() returns a message to print. for config in sys.argv[3:]: print(kconf.load_config(config, replace=False)) # Write the merged configuration print(kconf.write_config(sys.argv[2])) # Print warnings for symbols whose actual value doesn't match the assigned # value for sym in kconf.defined_syms: # Was the symbol assigned to? if sym.user_value is not None: # Tristate values are represented as 0, 1, 2. Having them as # "n", "m", "y" is more convenient here, so convert. if sym.type in (BOOL, TRISTATE): user_value = TRI_TO_STR[sym.user_value] else: user_value = sym.user_value if user_value != sym.str_value: print("warning: {} was assigned the value '{}' but got the "
def main(): args = parse_args() print("Parsing " + args.kconfig_file) kconf = Kconfig(args.kconfig_file, warn_to_stderr=False, suppress_traceback=True) if args.handwritten_input_configs: # Warn for assignments to undefined symbols, but only for handwritten # fragments, to avoid warnings-turned-errors when using an old # configuration file together with updated Kconfig files kconf.warn_assign_undef = True # prj.conf may override settings from the board configuration, so # disable warnings about symbols being assigned more than once kconf.warn_assign_override = False kconf.warn_assign_redun = False # Load configuration files print(kconf.load_config(args.configs_in[0])) for config in args.configs_in[1:]: # replace=False creates a merged configuration print(kconf.load_config(config, replace=False)) if args.handwritten_input_configs: # Check that there are no assignments to promptless symbols, which # have no effect. # # This only makes sense when loading handwritten fragments and not when # loading zephyr/.config, because zephyr/.config is configuration # output and also assigns promptless symbols. check_no_promptless_assign(kconf) # Print warnings for symbols that didn't get the assigned value. Only # do this for handwritten input too, to avoid likely unhelpful warnings # when using an old configuration and updating Kconfig files. check_assigned_sym_values(kconf) check_assigned_choice_values(kconf) # Hack: Force all symbols to be evaluated, to catch warnings generated # during evaluation. Wait till the end to write the actual output files, so # that we don't generate any output if there are warnings-turned-errors. # # Kconfiglib caches calculated symbol values internally, so this is still # fast. kconf.write_config(os.devnull) if kconf.warnings: # Put a blank line between warnings to make them easier to read for warning in kconf.warnings: print("\n" + warning, file=sys.stderr) # Turn all warnings into errors, so that e.g. assignments to undefined # Kconfig symbols become errors. # # A warning is generated by this script whenever a symbol gets a # different value than the one it was assigned. Keep that one as just a # warning for now. err("Aborting due to Kconfig warnings") # Write the merged configuration and the C header print(kconf.write_config(args.config_out)) kconf.write_autoconf(args.header_out) # Write the list of parsed Kconfig files to a file write_kconfig_filenames(kconf, args.kconfig_list_out)
class MPConfig(TreeSelectionListener): """The MPConfig component initializes the KConfig library with the requested configuration, and buildst the GUI, consisting of a "Load" and a "Save as" buttons, a search field, "show all" checkbox, tree view and information text view.""" def __init__(self, kconfig_file="Kconfig", config_file=".config", systemLogger=None): """[summary] Parameters ---------- kconfig_file : string (default: "Kconfig") The Kconfig configuration file config_file : string (default: ".config") The save file which will be used for loading and saving the settings systemLogger (default: None) A system logger object. If None then print statements are used for logging. """ global log if systemLogger: log = systemLogger # Load Kconfig configuration files self.kconfig = Kconfig(kconfig_file) setKConfig(self.kconfig) if os.path.isfile(config_file): log.info(self.kconfig.load_config(config_file)) elif os.path.isfile(".config"): log.info(self.kconfig.load_config(".config")) self.tree = KConfigTree(self.kconfig) self.tree.addTreeSelectionListener(self.treeSelectionChanged) jTreeSP = JScrollPane(self.tree) self.jta = JTextArea() self.jta.setEditable(False) jTextSP = JScrollPane(self.jta) toolPanel = JPanel() toolPanel.setLayout(BoxLayout(toolPanel, BoxLayout.X_AXIS)) toolPanel.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0)) toolPanel.add(JLabel("Search: ")) jSearchPanel = JPanel() jSearchPanel.setLayout(BoxLayout(jSearchPanel, BoxLayout.X_AXIS)) self.jSearchField = JTextField() jSearchPanel.setBackground(self.jSearchField.getBackground()) jSearchPanel.setBorder(self.jSearchField.getBorder()) self.jSearchField.setBorder(None) self.jSearchField.getDocument().addDocumentListener( SearchListener(self.tree)) jSearchPanel.add(self.jSearchField) clearSearchButton = JButton(u'\u00d7', actionPerformed=self.clearSearch) d = clearSearchButton.getPreferredSize() clearSearchButton.setPreferredSize(Dimension(d.height, d.height)) clearSearchButton.setBackground(self.jSearchField.getBackground()) clearSearchButton.setBorder(None) clearSearchButton.setOpaque(False) clearSearchButton.setContentAreaFilled(False) clearSearchButton.setFocusPainted(False) jSearchPanel.add(clearSearchButton) toolPanel.add(jSearchPanel) self.showAllCheckBox = JCheckBox("Show all", actionPerformed=self.OnShowAllCheck) toolPanel.add(self.showAllCheckBox) splitPane = JSplitPane(JSplitPane.VERTICAL_SPLIT, jTreeSP, jTextSP) splitPane.setOneTouchExpandable(True) splitPane.setDividerLocation(300) treePanel = JPanel(BorderLayout()) treePanel.add(toolPanel, BorderLayout.NORTH) treePanel.add(splitPane, BorderLayout.CENTER) loadSavePanel = JPanel() loadSavePanel.setLayout(BoxLayout(loadSavePanel, BoxLayout.X_AXIS)) loadSavePanel.add( JButton("Load", actionPerformed=self.loadConfigDialog)) loadSavePanel.add( JButton("Save as", actionPerformed=self.writeConfigDialog)) self.rootPanel = JPanel() self.rootPanel.setLayout(BorderLayout()) self.rootPanel.add(loadSavePanel, BorderLayout.PAGE_START) self.rootPanel.add(treePanel, BorderLayout.CENTER) def clearSearch(self, event): self.jSearchField.setText("") def OnShowAllCheck(self, event): self.tree.setShowAll(self.showAllCheckBox.isSelected()) self.tree.doSearch(self.jSearchField.getText() ) # Must repeat the search if one is active def treeSelectionChanged(self, event): """When the user selects a new node in the tree, show info about the selected node in the info text area below the tree.""" path = event.getNewLeadSelectionPath() if path: comp = path.getLastPathComponent() if isinstance(comp, DefaultMutableTreeNode): nodeData = comp.getUserObject() if isinstance(nodeData, TreeNodeData): self.jta.setText(getNodeInfoString(nodeData.knode)) self.jta.setCaretPosition(0) def getPane(self): """Return the panel containing all the other components that is set up in __init__().""" return self.rootPanel def writeConfig(self, fileName): """Write the current configuration to the file specified.""" self.kconfig.write_config(fileName) # Save full configuration #self.kconfig.write_min_config(fileName) # Save minimal configuration def loadConfig(self, fileName): """Load configuration settings from the file specified.""" if os.path.isfile(fileName): log.info(self.kconfig.load_config(fileName)) self.tree.createKconfShadowModel(self.kconfig) self.tree.updateTree() def writeConfigDialog(self, e): """Open a file dialog to save configuration""" fileChooser = JFileChooser(os.getcwd()) retval = fileChooser.showSaveDialog(None) if retval == JFileChooser.APPROVE_OPTION: f = fileChooser.getSelectedFile() self.writeConfig(f.getPath()) def loadConfigDialog(self, e): """Open a file dialog to select configuration to load""" fileChooser = JFileChooser(os.getcwd()) retval = fileChooser.showOpenDialog(None) if retval == JFileChooser.APPROVE_OPTION: f = fileChooser.getSelectedFile() log.info("Selected file: " + f.getPath()) self.loadConfig(f.getPath())
# Recursively lower children if node.list: do_allnoconfig(node.list) node = node.next # Parse the Kconfig files kconf = Kconfig(sys.argv[1]) # Do an initial pass to set 'option allnoconfig_y' symbols to y for sym in kconf.unique_defined_syms: if sym.is_allnoconfig_y: sym.set_value(2) while True: # Changing later symbols in the configuration can sometimes allow earlier # symbols to be lowered, e.g. if a later symbol 'select's an earlier # symbol. To handle such situations, we do additional passes over the tree # until we're no longer able to change the value of any symbol in a pass. changed = False do_allnoconfig(kconf.top_node) # Did the pass change any symbols? if not changed: break kconf.write_config()
# Enable warnings for assignments to undefined symbols kconf.enable_undef_warnings() # (This script uses alldefconfig as the base. Other starting states could be # set up here as well. The approach in examples/allnoconfig_simpler.py could # provide an allnoconfig starting state for example.) print("Using {} as base".format(sys.argv[4])) for config in sys.argv[5:]: print("Merging {}".format(config)) # Create a merged configuration by loading the fragments with replace=False for config in sys.argv[4:]: kconf.load_config(config, replace=False) # Write the merged configuration kconf.write_config(sys.argv[2]) # Output autoconf kconf.write_autoconf(sys.argv[3]) # Print warnings for symbols whose actual value doesn't match the assigned # value def name_and_loc(sym): # Helper for printing symbol names and Kconfig file location(s) in warnings if not sym.nodes: return sym.name + " (undefined)" return "{} (defined at {})".format(
def main(): args = parse_args() print("Parsing Kconfig tree in " + args.kconfig_root) kconf = Kconfig(args.kconfig_root, warn_to_stderr=False) # Warn for assignments to undefined symbols kconf.warn_assign_undef = True # prj.conf may override settings from the board configuration, so disable # warnings about symbols being assigned more than once kconf.warn_assign_override = False kconf.warn_assign_redun = False print(kconf.load_config(args.conf_fragments[0])) for config in args.conf_fragments[1:]: # replace=False creates a merged configuration print(kconf.load_config(config, replace=False)) # Print warnings for symbols whose actual value doesn't match the assigned # value for sym in kconf.unique_defined_syms: # Was the symbol assigned to? Choice symbols are checked separately. if sym.user_value is not None and not sym.choice: verify_assigned_sym_value(sym) # Print warnings for choices whose actual selection doesn't match the user # selection for choice in kconf.unique_choices: if choice.user_selection: verify_assigned_choice_value(choice) # Hack: Force all symbols to be evaluated, to catch warnings generated # during evaluation. Wait till the end to write the actual output files, so # that we don't generate any output if there are warnings-turned-errors. # # Kconfiglib caches calculated symbol values internally, so this is still # fast. kconf.write_config(os.devnull) # Print warnings ourselves so that we can put a blank line between them for # readability. We could roll this into the loop below, but it's nice to # always print all warnings, even if one of them turns out to be fatal. for warning in kconf.warnings: print("\n" + warning, file=sys.stderr) # Turn all warnings except for explicitly whitelisted ones into errors. In # particular, this will turn assignments to undefined Kconfig variables # into errors. # # A warning is generated by this script whenever a symbol gets a different # value than the one it was assigned. Keep that one as just a warning for # now as well. for warning in kconf.warnings: if fatal(warning): sys.exit("\n" + textwrap.fill( "Error: Aborting due to non-whitelisted Kconfig " "warning '{}'.\nNote: If this warning doesn't point " "to an actual problem, you can add it to the " "whitelist at the top of {}.".format(warning, sys.argv[0]), 100) + "\n") # Write the merged configuration and the C header print(kconf.write_config(args.dotconfig)) kconf.write_autoconf(args.autoconf) # Write the list of processed Kconfig sources to a file write_kconfig_filenames(kconf.kconfig_filenames, kconf.srctree, args.sources)
def main(): parse_args() print("Parsing Kconfig tree in {}".format(args.kconfig_root)) kconf = Kconfig(args.kconfig_root, warn_to_stderr=False) # Enable warnings for assignments to undefined symbols kconf.enable_undef_warnings() for i, config in enumerate(args.conf_fragments): print( ("Loading {} as base" if i == 0 else "Merging {}").format(config)) # replace=False creates a merged configuration kconf.load_config(config, replace=False) # Print warnings for symbols whose actual value doesn't match the assigned # value for sym in kconf.unique_defined_syms: # Was the symbol assigned to? Choice symbols are checked separately. if sym.user_value is not None and not sym.choice: verify_assigned_sym_value(sym) # Print warnings for choices whose actual selection doesn't match the user # selection for choice in kconf.unique_choices: if choice.user_selection: verify_assigned_choice_value(choice) # Hack: Force all symbols to be evaluated, to catch warnings generated # during evaluation. Wait till the end to write the actual output files, so # that we don't generate any output if there are warnings-turned-errors. # # Kconfiglib caches calculated symbol values internally, so this is still # fast. kconf.write_config(os.devnull) # We could roll this into the loop below, but it's nice to always print all # warnings, even if one of them turns out to be fatal for warning in kconf.warnings: if enabled(warning): print("\n" + warning, file=sys.stderr) # Turn all warnings except for explicity whitelisted ones into errors. In # particular, this will turn assignments to undefined Kconfig variables # into errors. # # A warning is generated by this script whenever a symbol gets a different # value than the one it was assigned. Keep that one as just a warning for # now as well. for warning in kconf.warnings: if fatal(warning): sys.exit("\n" + textwrap.fill( "Error: Aborting due to non-whitelisted Kconfig " "warning '{}'.\nNote: If this warning doesn't point " "to an actual problem, you can add it to the " "whitelist at the top of {}.".format(warning, sys.argv[0]), 100) + "\n") # Write the merged configuration and the C header kconf.write_config(args.dotconfig) kconf.write_autoconf(args.autoconf)
# Recursively lower children if node.list: do_allnoconfig(node.list) node = node.next # Parse the Kconfig files kconf = Kconfig(sys.argv[1]) # Do an initial pass to set 'option allnoconfig_y' symbols to y for sym in kconf.unique_defined_syms: if sym.is_allnoconfig_y: sym.set_value(2) while True: # Changing later symbols in the configuration can sometimes allow earlier # symbols to be lowered, e.g. if a later symbol 'select's an earlier # symbol. To handle such situations, we do additional passes over the tree # until we're no longer able to change the value of any symbol in a pass. changed = False do_allnoconfig(kconf.top_node) # Did the pass change any symbols? if not changed: break print(kconf.write_config())
try: kconf.load_config(config_filename) except IOError as e: # Print the (spammy) error from Kconfiglib itself print(e.message + "\n") else: print("Configuration loaded from " + config_filename) print_menuconfig(kconf) continue if cmd == "write_config": config_filename = input("To this file: ") try: kconf.write_config(config_filename) except IOError as e: print(e.message) else: print("Configuration written to " + config_filename) continue # Assume 'cmd' is the name of a symbol or choice if it isn't one of the # commands above, prompt the user for a value for it, and print the new # configuration tree if cmd in kconf.syms: if get_value_from_user(kconf.syms[cmd]): print_menuconfig(kconf)
def main(): args = parse_args() print("Parsing " + args.kconfig_file) kconf = Kconfig(args.kconfig_file, warn_to_stderr=False, suppress_traceback=True) if args.handwritten_input_configs: # Warn for assignments to undefined symbols, but only for handwritten # fragments, to avoid warnings-turned-errors when using an old # configuration file together with updated Kconfig files kconf.warn_assign_undef = True # prj.conf may override settings from the board configuration, so # disable warnings about symbols being assigned more than once kconf.warn_assign_override = False kconf.warn_assign_redun = False # Load configuration files print(kconf.load_config(args.configs_in[0])) for config in args.configs_in[1:]: # replace=False creates a merged configuration print(kconf.load_config(config, replace=False)) if args.handwritten_input_configs: # Check that there are no assignments to promptless symbols, which # have no effect. # # This only makes sense when loading handwritten fragments and not when # loading zephyr/.config, because zephyr/.config is configuration # output and also assigns promptless symbols. check_no_promptless_assign(kconf) # Print warnings for symbols that didn't get the assigned value. Only # do this for handwritten input too, to avoid likely unhelpful warnings # when using an old configuration and updating Kconfig files. check_assigned_sym_values(kconf) check_assigned_choice_values(kconf) # Hack: Force all symbols to be evaluated, to catch warnings generated # during evaluation. Wait till the end to write the actual output files, so # that we don't generate any output if there are warnings-turned-errors. # # Kconfiglib caches calculated symbol values internally, so this is still # fast. kconf.write_config(os.devnull) # Print warnings ourselves so that we can put a blank line between them for # readability. We could roll this into the loop below, but it's nice to # always print all warnings, even if one of them turns out to be fatal. for warning in kconf.warnings: print("\n" + warning, file=sys.stderr) # Turn all warnings except for explicitly whitelisted ones into errors. In # particular, this will turn assignments to undefined Kconfig variables # into errors. # # A warning is generated by this script whenever a symbol gets a different # value than the one it was assigned. Keep that one as just a warning for # now as well. for warning in kconf.warnings: if fatal(warning): err(f"""\ Aborting due to non-whitelisted Kconfig warning '{warning}'. If this warning doesn't point to an actual problem, you can add it to the whitelist at the top of {sys.argv[0]}.""") # Write the merged configuration and the C header print(kconf.write_config(args.config_out)) kconf.write_autoconf(args.header_out) # Write the list of parsed Kconfig files to a file write_kconfig_filenames(kconf, args.kconfig_list_out)
if not conf_changed: break def do_oldconfig_rec(node): while node: do_oldconfig_for_node(node) if node.list: do_oldconfig_rec(node.list) node = node.next if __name__ == "__main__": if len(sys.argv) != 2: eprint("error: pass name of base Kconfig file as argument") sys.exit(1) if not os.path.exists(".config"): eprint("error: no existing .config") sys.exit(1) kconf = Kconfig(sys.argv[1]) kconf.load_config(".config") do_oldconfig(kconf) kconf.write_config(".config") print("Configuration written to .config")
def main(): parse_args() print("Parsing Kconfig tree in {}".format(args.kconfig_root)) kconf = Kconfig(args.kconfig_root) # Enable warnings for assignments to undefined symbols kconf.enable_undef_warnings() # This script uses alldefconfig as the base. Other starting states could be set # up here as well. The approach in examples/allnoconfig_simpler.py could # provide an allnoconfig starting state for example. print("Using {} as base".format(args.conf_fragments[0])) for config in args.conf_fragments[1:]: print("Merging {}".format(config)) # Create a merged configuration by loading the fragments with replace=False for config in args.conf_fragments: kconf.load_config(config, replace=False) # Print warnings for symbols whose actual value doesn't match the assigned # value def name_and_loc(sym): # Helper for printing symbol names and Kconfig file location(s) in warnings if not sym.nodes: return sym.name + " (undefined)" return "{} (defined at {})".format( sym.name, ", ".join("{}:{}".format(node.filename, node.linenr) for node in sym.nodes)) for sym in kconf.defined_syms: # Was the symbol assigned to? if sym.user_value is not None: # Tristate values are represented as 0, 1, 2. Having them as # "n", "m", "y" is more convenient here, so convert. if sym.type in (BOOL, TRISTATE): user_value = TRI_TO_STR[sym.user_value] else: user_value = sym.user_value if user_value != sym.str_value: print('warning: {} was assigned the value "{}" but got the ' 'value "{}" -- check dependencies'.format( name_and_loc(sym), user_value, sym.str_value ), file=sys.stderr) # Turn the warning for malformed .config lines into an error for warning in kconf.warnings: if "ignoring malformed line" in warning: print("Aborting due to malformed configuration settings", file=sys.stderr) sys.exit(1) # Write the merged configuration kconf.write_config(args.dotconfig) # Write the C header kconf.write_autoconf(args.autoconf)
if cmd == "load_config": config_filename = input(".config file to load: ") try: # Returns a message telling which file got loaded print(kconf.load_config(config_filename)) except EnvironmentError as e: print(e, file=sys.stderr) print_menuconfig(kconf) continue if cmd == "write_config": config_filename = input("To this file: ") try: # Returns a message telling which file got saved print(kconf.write_config(config_filename)) except EnvironmentError as e: print(e, file=sys.stderr) continue # Assume 'cmd' is the name of a symbol or choice if it isn't one of the # commands above, prompt the user for a value for it, and print the new # configuration tree if cmd in kconf.syms: if get_value_from_user(kconf.syms[cmd]): print_menuconfig(kconf) continue
# (This script uses alldefconfig as the base. Other starting states could be # set up here as well. The approach in examples/allnoconfig_simpler.py could # provide an allnoconfig starting state for example.) # Disable warnings generated for multiple assignments to the same symbol within # a (set of) configuration files. Assigning a symbol multiple times might be # done intentionally when merging configuration files. kconf.disable_override_warnings() kconf.disable_redun_warnings() # Create a merged configuration by loading the fragments with replace=False for config in sys.argv[3:]: kconf.load_config(config, replace=False) # Write the merged configuration kconf.write_config(sys.argv[2]) # Print warnings for symbols whose actual value doesn't match the assigned # value def name_and_loc(sym): # Helper for printing symbol names and Kconfig file location(s) in warnings if not sym.nodes: return sym.name + " (undefined)" return "{} (defined at {})".format( sym.name, ", ".join("{}:{}".format(node.filename, node.linenr) for node in sym.nodes))