All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Rifenbark <srifenbark@gmail.com>
To: chandana.kalluri@xilinx.com
Cc: "Eggleton, Paul" <paul.eggleton@intel.com>,
	openembedded-core <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 3/3] devtool: provide support for devtool menuconfig command.
Date: Wed, 5 Dec 2018 08:38:07 -0800	[thread overview]
Message-ID: <CAFNP8Ous2ZkGuxWQ=z3FyCOG39AGX4KGZF7FzUcztyKoCaNCoA@mail.gmail.com> (raw)
In-Reply-To: <1543953282-1856-4-git-send-email-chandana.kalluri@xilinx.com>

[-- Attachment #1: Type: text/plain, Size: 5873 bytes --]

Hi,

This probably has documentation ramifications yes?  See
https://yoctoproject.org/docs/2.6/mega-manual/mega-manual.html#ref-devtool-reference
.

Thanks,
Scott

On Wed, Dec 5, 2018 at 8:27 AM Sai Hari Chandana Kalluri <
chandana.kalluri@xilinx.com> wrote:

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

[-- Attachment #2: Type: text/html, Size: 7485 bytes --]

  reply	other threads:[~2018-12-05 16:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 19:54 [PATCH 0/3] Devtool: provide easy means of reconfiguring the kernel Sai Hari Chandana Kalluri
2018-12-04 19:54 ` [PATCH 1/3] devtool modify: Update devtool modify to copy source from work-shared if its already downloaded Sai Hari Chandana Kalluri
2018-12-04 19:54 ` [PATCH 3/3] devtool: provide support for devtool menuconfig command Sai Hari Chandana Kalluri
2018-12-05 16:38   ` Scott Rifenbark [this message]
2018-12-05 17:26     ` Alejandro Hernandez
2018-12-05  0:37 [PATCH 0/3] Devtool: provide easy means of reconfiguring the kernel Sai Hari Chandana Kalluri
2018-12-05  0:37 ` [PATCH 3/3] devtool: provide support for devtool menuconfig command Sai Hari Chandana Kalluri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFNP8Ous2ZkGuxWQ=z3FyCOG39AGX4KGZF7FzUcztyKoCaNCoA@mail.gmail.com' \
    --to=srifenbark@gmail.com \
    --cc=chandana.kalluri@xilinx.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=paul.eggleton@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.