aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorKeun young Park <keunyoung@google.com>2012-06-07 12:29:00 -0700
committerKeun young Park <keunyoung@google.com>2012-06-07 12:29:00 -0700
commite0e2abb814e49fa389463d9ef19feece241a20ea (patch)
treeefb9f2a7804bc02034e4fd2d7688aef93470c49b /build
parentb3d386cdc3078f7ad6805328ab67a88091fade15 (diff)
downloadpdk-e0e2abb814e49fa389463d9ef19feece241a20ea.tar.gz
move umount position to targetDir
- as the same source can be mounted to multiple targets - also add -a option to allow adding a directory directly Change-Id: I6c521b8e29c7100d8024a9b76882bf27f65f7bfb
Diffstat (limited to 'build')
-rwxr-xr-xbuild/prepare_pdk_tree.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/build/prepare_pdk_tree.py b/build/prepare_pdk_tree.py
index 4be9744..6c56721 100755
--- a/build/prepare_pdk_tree.py
+++ b/build/prepare_pdk_tree.py
@@ -91,19 +91,26 @@ def main(argv):
manifestFile = ".repo/manifest.xml"
groups = ["pdk"]
if len(argv) < 2:
- print "create_pdk_tree.py target_dir [-m manifest] pdk_groups"
+ print "create_pdk_tree.py target_dir [-m manifest] [-a dir_to_add] pdk_groups"
print " ex) create_pdk_tree.py ../tmp grouper"
+ print " -a option is to include a directory which does not belong to specified group"
+ print " multiple -a options can be specified like -a frameworks/base -a external/aaa"
print " Note that pdk group is included by default"
print " Do not create target_dir under the current source tree. This will cause build error."
sys.exit(1)
targetDir = argv[1]
argc = 2
+ subdirs = []
if len(argv) > 2:
if argv[2] == "-m":
manifestFile = argv[3]
argc += 2
while argc < len(argv):
- groups.append(argv[argc])
+ if argv[argc] == "-a":
+ argc += 1
+ subdirs.append(argv[argc])
+ else:
+ groups.append(argv[argc])
argc += 1
sourceDir = os.path.abspath('.')
targetDir = os.path.abspath(targetDir)
@@ -123,7 +130,7 @@ def main(argv):
else:
print "Will create scripts, but may need manual unmount"
- subdirs = getPDKDirs(manifestFile, groups)
+ subdirs += getPDKDirs(manifestFile, groups)
print subdirs
os.system("mkdir -p " + targetDir)
mountf = open(targetDir + '/' + MOUNT_FILE, 'w+')
@@ -134,7 +141,7 @@ def main(argv):
os.system("mkdir -p " + targetDir + '/' + subdir)
mountf.write("mount --bind " + sourceDir + "/" + subdir + " " + targetDir + "/" + subdir + \
"\n")
- umountf.write("umount " + sourceDir + "/" + subdir + "\n")
+ umountf.write("umount " + targetDir + "/" + subdir + "\n")
for file_name in copy_files_list:
create_symbolic_link(sourceDir, targetDir, file_name)
mountf.close()