<div dir="ltr"><div dir="ltr"><div>Hi, <br></div><div><br></div><div>This probably has documentation ramifications yes?  See <a href="https://yoctoproject.org/docs/2.6/mega-manual/mega-manual.html#ref-devtool-reference">https://yoctoproject.org/docs/2.6/mega-manual/mega-manual.html#ref-devtool-reference</a>.</div><div><br></div><div>Thanks, <br></div><div>Scott<br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 5, 2018 at 8:27 AM Sai Hari Chandana Kalluri &lt;<a href="mailto:chandana.kalluri@xilinx.com">chandana.kalluri@xilinx.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">All packages that support the menuconfig task will be able to run devtool<br>
menuconfig command. This would allow the user to modify the current<br>
configure options and create a config fragment which can be added to a<br>
recipe using devtool finish.<br>
<br>
1. The patch checks if devtool menuconfig command is called for a valid<br>
package.<br>
2. It checks for oe-local-files dir within source and creates one<br>
if needed, this directory is needed to store the final generated config<br>
fragment so that devtool finish can update the recipe.<br>
3. Menuconfig command is called for users to make necessary changes. After<br>
saving the changes, diffconfig command is run to generate the fragment.<br>
<br>
Syntax:<br>
        devtool menuconfig &lt;package name&gt;<br>
         Ex: devtool menuconfig linux-yocto<br>
<br>
The config fragment is saved as devtool-fragment.cfg within<br>
oe-local-files dir.<br>
<br>
        Ex: &lt;workspace_path&gt;/sources/linux-yocto/oe-local-files/devtool-fragment.cfg<br>
<br>
Run devtool finish to update the recipe by appending the config fragment<br>
to SRC_URI and place a copy of the fragment within the layer where the<br>
recipe resides.<br>
        Ex: devtool finish linux-yocto meta<br>
<br>
[YOCTO #10416]<br>
<br>
Signed-off-by: Sai Hari Chandana Kalluri &lt;<a href="mailto:chandana.kalluri@xilinx.com" target="_blank">chandana.kalluri@xilinx.com</a>&gt;<br>
Signed-off-by: Alejandro Enedino Hernandez Samaniego &lt;<a href="mailto:alejandr@xilinx.com" target="_blank">alejandr@xilinx.com</a>&gt;<br>
---<br>
 scripts/lib/devtool/menuconfig.py | 80 +++++++++++++++++++++++++++++++++++++++<br>
 1 file changed, 80 insertions(+)<br>
 create mode 100644 scripts/lib/devtool/menuconfig.py<br>
<br>
diff --git a/scripts/lib/devtool/menuconfig.py b/scripts/lib/devtool/menuconfig.py<br>
new file mode 100644<br>
index 0000000..38133db<br>
--- /dev/null<br>
+++ b/scripts/lib/devtool/menuconfig.py<br>
@@ -0,0 +1,80 @@<br>
+# OpenEmbedded Development tool - menuconfig command plugin<br>
+#<br>
+# Copyright (C) 2018 Xilinx<br>
+# Written by: Chandana Kalluri &lt;<a href="mailto:ckalluri@xilinx.com" target="_blank">ckalluri@xilinx.com</a>&gt;<br>
+#<br>
+# This program is free software; you can redistribute it and/or modify<br>
+# it under the terms of the GNU General Public License version 2 as<br>
+# published by the Free Software Foundation.<br>
+#<br>
+# This program is distributed in the hope that it will be useful,<br>
+# but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>
+# GNU General Public License for more details.<br>
+#<br>
+# You should have received a copy of the GNU General Public License along<br>
+# with this program; if not, write to the Free Software Foundation, Inc.,<br>
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.<br>
+<br>
+&quot;&quot;&quot;Devtool menuconfig plugin&quot;&quot;&quot;<br>
+<br>
+import os<br>
+import bb<br>
+import logging<br>
+import argparse<br>
+import re<br>
+import glob<br>
+from devtool import setup_tinfoil, parse_recipe, DevtoolError, standard, exec_build_env_command<br>
+<br>
+logger = logging.getLogger(&#39;devtool&#39;)<br>
+<br>
+def menuconfig(args, config, basepath, workspace):<br>
+    &quot;&quot;&quot;Entry point for the devtool &#39;menuconfig&#39; subcommand&quot;&quot;&quot;<br>
+<br>
+    rd = &quot;&quot; <br>
+    kconfigpath = &quot;&quot;<br>
+    pn_src = &quot;&quot;<br>
+    localfilesdir = &quot;&quot;<br>
+    workspace_dir = &quot;&quot;<br>
+    tinfoil = setup_tinfoil(basepath=basepath)<br>
+    try:<br>
+      rd = parse_recipe(config, tinfoil, args.component, appends=True, filter_workspace=False)<br>
+      if not rd:<br>
+         return 1<br>
+<br>
+      pn =  rd.getVar(&#39;PN&#39;, True)<br>
+      if pn not in workspace:<br>
+         raise DevtoolError(&quot;Run devtool modify before calling menuconfig for %s&quot; %pn)<br>
+<br>
+      if not rd.getVarFlag(&#39;do_menuconfig&#39;,&#39;task&#39;):<br>
+         raise DevtoolError(&quot;This package does not support menuconfig option&quot;)<br>
+<br>
+      workspace_dir = os.path.join(basepath,&#39;workspace/sources&#39;)<br>
+      kconfigpath = rd.getVar(&#39;B&#39;)<br>
+      pn_src = os.path.join(workspace_dir,pn)<br>
+<br>
+      #add check to see if oe_local_files exists or not<br>
+      localfilesdir = os.path.join(pn_src,&#39;oe-local-files&#39;) <br>
+      if not os.path.exists(localfilesdir):<br>
+          bb.utils.mkdirhier(localfilesdir)<br>
+          #Add gitignore to ensure source tree is clean<br>
+          gitignorefile = os.path.join(localfilesdir,&#39;.gitignore&#39;)<br>
+          with open(gitignorefile, &#39;w&#39;) as f:<br>
+                  f.write(&#39;# Ignore local files, by default. Remove this file if you want to commit the directory to Git\n&#39;)<br>
+                  f.write(&#39;*\n&#39;)<br>
+<br>
+    finally:<br>
+      tinfoil.shutdown()<br>
+<br>
+    <a href="http://logger.info" rel="noreferrer" target="_blank">logger.info</a>(&#39;Launching menuconfig&#39;)<br>
+    exec_build_env_command(config.init_path, basepath, &#39;bitbake -c menuconfig %s&#39; % pn, watch=True) <br>
+    fragment = os.path.join(localfilesdir, &#39;devtool-fragment.cfg&#39;)<br>
+    res = standard._create_kconfig_diff(pn_src,rd,fragment)<br>
+<br>
+    return 0<br>
+<br>
+def register_commands(subparsers, context):<br>
+    &quot;&quot;&quot;register devtool subcommands from this plugin&quot;&quot;&quot;<br>
+    parser_menuconfig = subparsers.add_parser(&#39;menuconfig&#39;,help=&#39;allows altering the system component configuration&#39;, description=&#39;launches the make menuconfig command, allows user to make changes to configuration. creates a config fragment&#39;, group=&#39;advanced&#39;) <br>
+    parser_menuconfig.add_argument(&#39;component&#39;, help=&#39;compenent to alter config&#39;)<br>
+    parser_menuconfig.set_defaults(func=menuconfig,fixed_setup=context.fixed_setup)<br>
-- <br>
2.7.4<br>
<br>
-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div>