Patchwork [flasher,3/4] build: restrict cmd_build_configs() to enabled objects

login
register
mail settings
Submitter Stephen Warren
Date June 14, 2013, 7:52 p.m.
Message ID <1371239544-26165-3-git-send-email-swarren@wwwdotorg.org>
Download mbox | patch
Permalink /patch/251518/
State Accepted, archived
Headers show

Comments

Stephen Warren - June 14, 2013, 7:52 p.m.
From: Stephen Warren <swarren@nvidia.com>

Only install enabled SoC/board/config files in _out/configs. This may
be useful if you want to create a _out directory containing a limited
set of binaries; this way, only the relevant limited set of config
files are installed too.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 build | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

Patch

diff --git a/build b/build
index 924ac88..8f86d32 100755
--- a/build
+++ b/build
@@ -183,7 +183,26 @@  def cmd_build_bcts_imgs():
         build_bct_img_one_board(boardname)
 
 def cmd_build_configs():
-    run(scripts_dir, 'cp -rp configs ' + out_dir)
+    mkdir(os.path.join(out_dir, 'configs'))
+    boardnames = {}
+    for configname in all_enabled_confignames():
+        fn = configname + '.config'
+        src = os.path.join(scripts_dir, 'configs', fn)
+        dst = os.path.join(out_dir, 'configs', fn)
+        cp(src, dst)
+        boardnames[configs[configname]['board']] = True
+    socnames = {}
+    for boardname in boardnames:
+        fn = boardname + '.board'
+        src = os.path.join(scripts_dir, 'configs', fn)
+        dst = os.path.join(out_dir, 'configs', fn)
+        cp(src, dst)
+        socnames[boards[boardname]['soc']] = True
+    for socname in socnames:
+        fn = socname + '.soc'
+        src = os.path.join(scripts_dir, 'configs', fn)
+        dst = os.path.join(out_dir, 'configs', fn)
+        cp(src, dst)
 
 def cmd_build():
     cmd_build_uboots()