]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: bootimg-partition: Use the relative path in the install_task
authorKevin Hao <kexin.hao@windriver.com>
Tue, 14 Aug 2018 01:31:22 +0000 (09:31 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 15 Aug 2018 20:45:10 +0000 (21:45 +0100)
Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/plugins/source/bootimg-partition.py

index b239fc0b4cfe84c8a458a7f06b3b7de606632dc8..9480eed6d8a3e9a522b15a34f12f5c5c929fa4cb 100644 (file)
@@ -111,20 +111,18 @@ class BootimgPartitionPlugin(SourcePlugin):
 
                 logger.debug('Globbed sources: %s', ', '.join(srcs))
                 for entry in srcs:
+                    src = os.path.relpath(entry, kernel_dir)
                     entry_dst_name = entry_name_fn(entry)
-                    install_task.append((entry,
-                                         os.path.join(hdddir,
-                                                      entry_dst_name)))
+                    install_task.append((src, entry_dst_name)))
             else:
-                install_task = [(os.path.join(kernel_dir, src),
-                                 os.path.join(hdddir, dst))]
+                install_task = [(src, dst)]
 
             for task in install_task:
                 src_path, dst_path = task
-                logger.debug('Install %s as %s',
-                             os.path.basename(src_path), dst_path)
+                logger.debug('Install %s as %s', src_path, dst_path)
                 install_cmd = "install -m 0644 -D %s %s" \
-                              % (src_path, dst_path)
+                              % (os.path.join(kernel_dir, src_path),
+                                 os.path.join(hdddir, dst_path))
                 exec_cmd(install_cmd)
 
         logger.debug('Prepare boot partition using rootfs in %s', hdddir)