public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [flasher PATCH 1/2] Fix typo in variable name
@ 2013-10-03 20:51 Stephen Warren
       [not found] ` <1380833470-32189-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Warren @ 2013-10-03 20:51 UTC (permalink / raw)
  To: swarren-3lzwWm7+Weoh9ZMKESR00Q
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

For some reason (likely cut/paste), all the ArgParser subparsers were
stored in a variable named parser_list_configs. That variable name is at
most appropriate for one subcommand, and in fact the subcommand it would
be relevant for is not implemented by "build" but rather
"tegra-uboot-flasher". Replace this variable name with something more
appropriate and generic.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 build | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/build b/build
index b0587f5..134d6de 100755
--- a/build
+++ b/build
@@ -222,21 +222,21 @@ parser.add_argument('--boards', type=str,
 
 subparsers = parser.add_subparsers()
 
-parser_list_configs = subparsers.add_parser('build-uboots',
+subparser = subparsers.add_parser('build-uboots',
     help='Build U-Boot binaries')
-parser_list_configs.set_defaults(func = cmd_build_uboots)
+subparser.set_defaults(func = cmd_build_uboots)
 
-parser_list_configs = subparsers.add_parser('build-bcts-imgs',
+subparser = subparsers.add_parser('build-bcts-imgs',
     help='Build BCT and flash images')
-parser_list_configs.set_defaults(func = cmd_build_bcts_imgs)
+subparser.set_defaults(func = cmd_build_bcts_imgs)
 
-parser_list_configs = subparsers.add_parser('build-configs',
+subparser = subparsers.add_parser('build-configs',
     help='Build config files')
-parser_list_configs.set_defaults(func = cmd_build_configs)
+subparser.set_defaults(func = cmd_build_configs)
 
-parser_list_configs = subparsers.add_parser('build',
+subparser = subparsers.add_parser('build',
     help='Build everything')
-parser_list_configs.set_defaults(func = cmd_build)
+subparser.set_defaults(func = cmd_build)
 
 if __name__ == '__main__':
     args = parser.parse_args()
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [flasher PATCH 2/2] Add command to import U-Boot binaries from an external location
       [not found] ` <1380833470-32189-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-10-03 20:51   ` Stephen Warren
  2013-10-04 19:35   ` [flasher PATCH 1/2] Fix typo in variable name Stephen Warren
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2013-10-03 20:51 UTC (permalink / raw)
  To: swarren-3lzwWm7+Weoh9ZMKESR00Q
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

This option is useful if the user already builds U-Boot in a directory
not managed by the tegra-uboot-flasher manifest. This may happen when
an active U-Boot developer wishes to use the flasher scripts without
relocating their U-Boot development, or when performing separate
automated builds of U-Boot and the flasher, with the flasher build
picking up the result of an abitrary U-Boot build under the control of
the automated build system.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 build | 36 ++++++++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 8 deletions(-)

diff --git a/build b/build
index 134d6de..6142f31 100755
--- a/build
+++ b/build
@@ -127,17 +127,10 @@ def dtb_filename(config):
     boardname = configs[config]['board']
     return boards[boardname]['soc'] + '-' + boardname + extra + '.dtb'
 
-def build_uboot_one_board(boardname):
-    build_board_dir = gen_build_board_dir(boardname)
-    build_uboot_dir = gen_build_uboot_dir(build_board_dir)
-    mkdir(build_uboot_dir)
-
+def import_uboot_one_board(boardname, build_uboot_dir):
     out_board_dir = gen_out_board_dir(boardname)
     mkdir(out_board_dir)
 
-    run(uboot_dir, 'make BUILD_DIR=' + build_uboot_dir + ' ' + boardname + '_config')
-    run(uboot_dir, 'make BUILD_DIR=' + build_uboot_dir + ' -s ' + makejobs)
-
     src = os.path.join(build_uboot_dir, 'u-boot-nodtb-tegra.bin')
     dst = os.path.join(out_board_dir, 'u-boot-nodtb-tegra.bin')
     cp(src, dst)
@@ -150,6 +143,27 @@ def build_uboot_one_board(boardname):
     dst = os.path.join(out_board_dir, 'u-boot-dtb-tegra.bin')
     cp(src, dst)
 
+def cmd_import_uboot():
+    boardname = None
+    for i in all_enabled_boardnames():
+        if boardname:
+            raise Exception('import-uboot only allows one enabled board')
+        boardname = i
+    import_uboot_one_board(boardname, args.builddir)
+
+def build_uboot_one_board(boardname):
+    build_board_dir = gen_build_board_dir(boardname)
+    build_uboot_dir = gen_build_uboot_dir(build_board_dir)
+    mkdir(build_uboot_dir)
+
+    out_board_dir = gen_out_board_dir(boardname)
+    mkdir(out_board_dir)
+
+    run(uboot_dir, 'make BUILD_DIR=' + build_uboot_dir + ' ' + boardname + '_config')
+    run(uboot_dir, 'make BUILD_DIR=' + build_uboot_dir + ' -s ' + makejobs)
+
+    import_uboot_one_board(boardname, build_uboot_dir)
+
 def cmd_build_uboots():
     for boardname in all_enabled_boardnames():
         build_uboot_one_board(boardname)
@@ -222,6 +236,12 @@ parser.add_argument('--boards', type=str,
 
 subparsers = parser.add_subparsers()
 
+subparser = subparsers.add_parser('import-uboot',
+    help='Import U-Boot binaries from an external build tree')
+subparser.add_argument('builddir', type=str,
+    help='The external build directory to import from.')
+subparser.set_defaults(func = cmd_import_uboot)
+
 subparser = subparsers.add_parser('build-uboots',
     help='Build U-Boot binaries')
 subparser.set_defaults(func = cmd_build_uboots)
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [flasher PATCH 1/2] Fix typo in variable name
       [not found] ` <1380833470-32189-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  2013-10-03 20:51   ` [flasher PATCH 2/2] Add command to import U-Boot binaries from an external location Stephen Warren
@ 2013-10-04 19:35   ` Stephen Warren
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2013-10-04 19:35 UTC (permalink / raw)
  To: Stephen Warren; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

On 10/03/2013 02:51 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> 
> For some reason (likely cut/paste), all the ArgParser subparsers were
> stored in a variable named parser_list_configs. That variable name is at
> most appropriate for one subcommand, and in fact the subcommand it would
> be relevant for is not implemented by "build" but rather
> "tegra-uboot-flasher". Replace this variable name with something more
> appropriate and generic.

Applied (the series).

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-04 19:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-03 20:51 [flasher PATCH 1/2] Fix typo in variable name Stephen Warren
     [not found] ` <1380833470-32189-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-10-03 20:51   ` [flasher PATCH 2/2] Add command to import U-Boot binaries from an external location Stephen Warren
2013-10-04 19:35   ` [flasher PATCH 1/2] Fix typo in variable name Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox