aboutsummaryrefslogtreecommitdiff
path: root/linaro_image_tools/media_create
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2014-06-14 12:36:12 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2014-06-14 12:36:12 +0300
commit23231928b4e6d1d6df985defe9de4ee0e0f04db1 (patch)
tree01d01c9eaa54208eeacc9693571e0c4eb0a41089 /linaro_image_tools/media_create
parent29e2ec415da8abcf41e5577d1bef6935bca29f5a (diff)
downloadlinaro-image-tools-23231928b4e6d1d6df985defe9de4ee0e0f04db1.tar.gz
Refactor kernel image renaming to avoid to hardcode the kernel name
Change-Id: I4cd53f935b8e423676815fd0dd5cae57e0a6a573 Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'linaro_image_tools/media_create')
-rw-r--r--linaro_image_tools/media_create/boards.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/linaro_image_tools/media_create/boards.py b/linaro_image_tools/media_create/boards.py
index 111969d..c208932 100644
--- a/linaro_image_tools/media_create/boards.py
+++ b/linaro_image_tools/media_create/boards.py
@@ -1499,17 +1499,17 @@ class FastModelConfig(GenericConfig):
copy_drop(filename, output_dir)
cmd_runner.run(["cp", "-v", filename, boot_dir],
as_root=True).wait()
- # Rename the kernel from Image-* to Image
+ # Rename the kernel image
if k_img_data is not None:
+ k_img_basename = os.path.basename(k_img_data)
+ k_img = k_img_basename.split('-')[0]
cmd_runner.run(["mv", "-v",
- os.path.join(output_dir,
- os.path.basename(k_img_data)),
- os.path.join(output_dir, "Image")],
+ os.path.join(output_dir, k_img_basename),
+ os.path.join(output_dir, k_img)],
as_root=True).wait()
cmd_runner.run(["mv", "-v",
- os.path.join(boot_dir,
- os.path.basename(k_img_data)),
- os.path.join(boot_dir, "Image")],
+ os.path.join(boot_dir, k_img_basename),
+ os.path.join(boot_dir, k_img)],
as_root=True).wait()