Atlas - allnoconfig.py

Home / ext / kconfiglib Lines: 1 | Size: 1218 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 'n'. 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/allnoconfig.py 15""" 16 17# See examples/allnoconfig_walk.py for another way to implement this script 18 19import kconfiglib 20 21 22def main(): 23 kconf = kconfiglib.standard_kconfig(__doc__) 24 25 # Avoid warnings that would otherwise get printed by Kconfiglib for the 26 # following: 27 # 28 # 1. Assigning a value to a symbol without a prompt, which never has any 29 # effect 30 # 31 # 2. Assigning values invalid for the type (only bool/tristate symbols 32 # accept 0/1/2, for n/m/y). The assignments will be ignored for other 33 # symbol types, which is what we want. 34 kconf.warn = False 35 for sym in kconf.unique_defined_syms: 36 sym.set_value(2 if sym.is_allnoconfig_y else 0) 37 kconf.warn = True 38 39 kconf.load_allconfig("allno.config") 40 41 print(kconf.write_config()) 42 43 44if __name__ == "__main__": 45 main() 46
[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.