summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/menuconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/devtool/menuconfig.py')
-rw-r--r--scripts/lib/devtool/menuconfig.py76
1 files changed, 0 insertions, 76 deletions
diff --git a/scripts/lib/devtool/menuconfig.py b/scripts/lib/devtool/menuconfig.py
deleted file mode 100644
index 1054960551..0000000000
--- a/scripts/lib/devtool/menuconfig.py
+++ /dev/null
@@ -1,76 +0,0 @@
1# OpenEmbedded Development tool - menuconfig command plugin
2#
3# Copyright (C) 2018 Xilinx
4# Written by: Chandana Kalluri <ckalluri@xilinx.com>
5#
6# SPDX-License-Identifier: MIT
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License version 2 as
10# published by the Free Software Foundation.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License along
18# with this program; if not, write to the Free Software Foundation, Inc.,
19# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21"""Devtool menuconfig plugin"""
22
23import os
24import bb
25import logging
26from devtool import setup_tinfoil, parse_recipe, DevtoolError, standard, exec_build_env_command
27from devtool import check_workspace_recipe
28logger = logging.getLogger('devtool')
29
30def menuconfig(args, config, basepath, workspace):
31 """Entry point for the devtool 'menuconfig' subcommand"""
32
33 rd = ""
34 pn_src = ""
35 localfilesdir = ""
36 workspace_dir = ""
37 tinfoil = setup_tinfoil(basepath=basepath)
38 try:
39 rd = parse_recipe(config, tinfoil, args.component, appends=True, filter_workspace=False)
40 if not rd:
41 return 1
42
43 check_workspace_recipe(workspace, args.component)
44 pn = rd.getVar('PN')
45
46 if not rd.getVarFlag('do_menuconfig','task'):
47 raise DevtoolError("This recipe does not support menuconfig option")
48
49 workspace_dir = os.path.join(config.workspace_path,'sources')
50 pn_src = os.path.join(workspace_dir,pn)
51
52 # add check to see if oe_local_files exists or not
53 localfilesdir = os.path.join(pn_src,'oe-local-files')
54 if not os.path.exists(localfilesdir):
55 bb.utils.mkdirhier(localfilesdir)
56 # Add gitignore to ensure source tree is clean
57 gitignorefile = os.path.join(localfilesdir,'.gitignore')
58 with open(gitignorefile, 'w') as f:
59 f.write('# Ignore local files, by default. Remove this file if you want to commit the directory to Git\n')
60 f.write('*\n')
61
62 finally:
63 tinfoil.shutdown()
64
65 logger.info('Launching menuconfig')
66 exec_build_env_command(config.init_path, basepath, 'bitbake -c menuconfig %s' % pn, watch=True)
67 fragment = os.path.join(localfilesdir, 'devtool-fragment.cfg')
68 standard._create_kconfig_diff(pn_src,rd,fragment)
69
70 return 0
71
72def register_commands(subparsers, context):
73 """register devtool subcommands from this plugin"""
74 parser_menuconfig = subparsers.add_parser('menuconfig',help='Alter build-time configuration for a recipe', description='Launches the make menuconfig command (for recipes where do_menuconfig is available), allowing users to make changes to the build-time configuration. Creates a config fragment corresponding to changes made.', group='advanced')
75 parser_menuconfig.add_argument('component', help='compenent to alter config')
76 parser_menuconfig.set_defaults(func=menuconfig,fixed_setup=context.fixed_setup)