Atlas - allmodconfig.py

Home / ext / kconfiglib Lines: 1 | Size: 1222 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1#!/usr/bin/env python3 2 3# Copyright (c) 2018-2019, Ulf Magnusson 4# SPDX-License-Identifier: ISC 5 6""" 7Writes a configuration file where as many symbols as possible are set to 'm'. 8 9The default output filename is '.config'. A different filename can be passed 10in the KCONFIG_CONFIG environment variable. 11 12Usage for the Linux kernel: 13 14 $ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/allmodconfig.py 15""" 16import kconfiglib 17 18 19def main(): 20 kconf = kconfiglib.standard_kconfig(__doc__) 21 22 # See allnoconfig.py 23 kconf.warn = False 24 25 for sym in kconf.unique_defined_syms: 26 if sym.orig_type == kconfiglib.BOOL: 27 # 'bool' choice symbols get their default value, as determined by 28 # e.g. 'default's on the choice 29 if not sym.choice: 30 # All other bool symbols get set to 'y', like for allyesconfig 31 sym.set_value(2) 32 elif sym.orig_type == kconfiglib.TRISTATE: 33 sym.set_value(1) 34 35 for choice in kconf.unique_choices: 36 choice.set_value(2 if choice.orig_type == kconfiglib.BOOL else 1) 37 38 kconf.warn = True 39 40 kconf.load_allconfig("allmod.config") 41 42 print(kconf.write_config()) 43 44 45if __name__ == "__main__": 46 main() 47
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.