From 256126c29434a93584b6043b1c1d1c6dbbc340db Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 11 Jul 2022 19:04:06 -0600 Subject: [PATCH] buildman: Replace the Options column with config name This appears in boards.cfg but we want to remove it. Drop support for generating it and reading it. Detect an old boards.cfg file that has this field and regenerate it, to avoid problems. Instead, add the config name in that place. This fixes a subtle bug in the generation code, since it uses 'target' for the config name and then overwrites the value in scan() by setting params['target'] to the name of the defconfig. The defconfig name is not the same as the SYS_CONFIG_NAME variable. With this change, we still have the config name and it can be searched by buildman, e.g. with: buildman -nv sun5i Signed-off-by: Simon Glass Reported-by: Tom Rini --- tools/buildman/board.py | 8 ++++---- tools/buildman/boards.py | 19 ++++++------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/tools/buildman/board.py b/tools/buildman/board.py index 3268b39..8ef905b 100644 --- a/tools/buildman/board.py +++ b/tools/buildman/board.py @@ -6,7 +6,7 @@ class Board: """A particular board that we can build""" - def __init__(self, status, arch, cpu, soc, vendor, board_name, target, options): + def __init__(self, status, arch, cpu, soc, vendor, board_name, target, cfg_name): """Create a new board type. Args: @@ -17,7 +17,7 @@ class Board: vendor: Name of vendor (e.g. armltd) board_name: Name of board (e.g. integrator) target: Target name (use make _defconfig to configure) - options: board-specific options (e.g. integratorcp:CM1136) + cfg_name: Config name """ self.target = target self.arch = arch @@ -25,7 +25,7 @@ class Board: self.board_name = board_name self.vendor = vendor self.soc = soc - self.options = options + self.cfg_name = cfg_name self.props = [self.target, self.arch, self.cpu, self.board_name, - self.vendor, self.soc, self.options] + self.vendor, self.soc, self.cfg_name] self.build_it = False diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index e16f326..8832e40 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -28,7 +28,7 @@ COMMENT_BLOCK = f'''# # List of boards # Automatically generated by {__file__}: don't edit # -# Status, Arch, CPU, SoC, Vendor, Board, Target, Options, Maintainers +# Status, Arch, CPU, SoC, Vendor, Board, Target, Config, Maintainers ''' @@ -98,6 +98,8 @@ def output_is_new(output): # was generated with open(output, encoding="utf-8") as inf: for line in inf: + if 'Options,' in line: + return False if line[0] == '#' or line == '\n': continue defconfig = line.split()[6] + '_defconfig' @@ -186,7 +188,7 @@ class KconfigScanner: 'vendor' : 'SYS_VENDOR', 'board' : 'SYS_BOARD', 'config' : 'SYS_CONFIG_NAME', - 'options' : 'SYS_EXTRA_OPTIONS' + # 'target' is added later } def __init__(self): @@ -216,7 +218,7 @@ class KconfigScanner: defconfig (str): path to the defconfig file to be processed Returns: - Dictionary of board parameters. It has a form: + A dictionary of board parameters. It has a form of: { 'arch': , 'cpu': , @@ -225,7 +227,6 @@ class KconfigScanner: 'board': , 'target': , 'config': , - 'options': } """ # strip special prefixes and save it in a temporary file @@ -262,14 +263,6 @@ class KconfigScanner: if params['arch'] == 'arm' and params['cpu'] == 'armv8': params['arch'] = 'aarch64' - # fix-up options field. It should have the form: - # [:comma separated config options] - if params['options'] != '-': - params['options'] = params['config'] + ':' + \ - params['options'].replace(r'\"', '"') - elif params['config'] != params['target']: - params['options'] = params['config'] - return params @@ -708,7 +701,7 @@ class Boards: output (str): The path to the output file """ fields = ('status', 'arch', 'cpu', 'soc', 'vendor', 'board', 'target', - 'options', 'maintainers') + 'config', 'maintainers') # First, decide the width of each column max_length = {f: 0 for f in fields} -- 2.7.4