diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-02-14 20:13:46 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-04 23:18:16 +0000 |
| commit | 1dd8cca63102b1718609c5e2903e1ea468c4c469 (patch) | |
| tree | f777759b24a40426cbfbf6332f65f8f7d16b52ad /scripts/lib/wic/plugins/source/bootimg-partition.py | |
| parent | 7c163ada95d2b304371f4d7a5dbef73ac37c1836 (diff) | |
| download | poky-1dd8cca63102b1718609c5e2903e1ea468c4c469.tar.gz | |
wic: use wic logger in wic source plugins
Replaced msger with wic logger in wic source plugins.
(From OE-Core rev: 19a868e9ad12fb27a7f713685d12f3d310fd6961)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/plugins/source/bootimg-partition.py')
| -rw-r--r-- | scripts/lib/wic/plugins/source/bootimg-partition.py | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py index e0d9a50585..b4869154fe 100644 --- a/scripts/lib/wic/plugins/source/bootimg-partition.py +++ b/scripts/lib/wic/plugins/source/bootimg-partition.py | |||
| @@ -23,15 +23,18 @@ | |||
| 23 | # Maciej Borzecki <maciej.borzecki (at] open-rnd.pl> | 23 | # Maciej Borzecki <maciej.borzecki (at] open-rnd.pl> |
| 24 | # | 24 | # |
| 25 | 25 | ||
| 26 | import logging | ||
| 26 | import os | 27 | import os |
| 27 | import re | 28 | import re |
| 29 | import sys | ||
| 28 | 30 | ||
| 29 | from glob import glob | 31 | from glob import glob |
| 30 | 32 | ||
| 31 | from wic import msger | ||
| 32 | from wic.pluginbase import SourcePlugin | 33 | from wic.pluginbase import SourcePlugin |
| 33 | from wic.utils.misc import exec_cmd, get_bitbake_var | 34 | from wic.utils.misc import exec_cmd, get_bitbake_var |
| 34 | 35 | ||
| 36 | logger = logging.getLogger('wic') | ||
| 37 | |||
| 35 | class BootimgPartitionPlugin(SourcePlugin): | 38 | class BootimgPartitionPlugin(SourcePlugin): |
| 36 | """ | 39 | """ |
| 37 | Create an image of boot partition, copying over files | 40 | Create an image of boot partition, copying over files |
| @@ -78,16 +81,18 @@ class BootimgPartitionPlugin(SourcePlugin): | |||
| 78 | if not bootimg_dir: | 81 | if not bootimg_dir: |
| 79 | bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") | 82 | bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") |
| 80 | if not bootimg_dir: | 83 | if not bootimg_dir: |
| 81 | msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n") | 84 | logger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n") |
| 85 | sys.exit(1) | ||
| 82 | 86 | ||
| 83 | msger.debug('Bootimg dir: %s' % bootimg_dir) | 87 | logger.debug('Bootimg dir: %s', bootimg_dir) |
| 84 | 88 | ||
| 85 | boot_files = get_bitbake_var("IMAGE_BOOT_FILES") | 89 | boot_files = get_bitbake_var("IMAGE_BOOT_FILES") |
| 86 | 90 | ||
| 87 | if not boot_files: | 91 | if not boot_files: |
| 88 | msger.error('No boot files defined, IMAGE_BOOT_FILES unset') | 92 | logger.error('No boot files defined, IMAGE_BOOT_FILES unset') |
| 93 | sys.exit(1) | ||
| 89 | 94 | ||
| 90 | msger.debug('Boot files: %s' % boot_files) | 95 | logger.debug('Boot files: %s', boot_files) |
| 91 | 96 | ||
| 92 | # list of tuples (src_name, dst_name) | 97 | # list of tuples (src_name, dst_name) |
| 93 | deploy_files = [] | 98 | deploy_files = [] |
| @@ -95,11 +100,12 @@ class BootimgPartitionPlugin(SourcePlugin): | |||
| 95 | if ';' in src_entry: | 100 | if ';' in src_entry: |
| 96 | dst_entry = tuple(src_entry.split(';')) | 101 | dst_entry = tuple(src_entry.split(';')) |
| 97 | if not dst_entry[0] or not dst_entry[1]: | 102 | if not dst_entry[0] or not dst_entry[1]: |
| 98 | msger.error('Malformed boot file entry: %s' % (src_entry)) | 103 | logger.error('Malformed boot file entry: %s', src_entry) |
| 104 | sys.exit(1) | ||
| 99 | else: | 105 | else: |
| 100 | dst_entry = (src_entry, src_entry) | 106 | dst_entry = (src_entry, src_entry) |
| 101 | 107 | ||
| 102 | msger.debug('Destination entry: %r' % (dst_entry,)) | 108 | logger.debug('Destination entry: %r', dst_entry) |
| 103 | deploy_files.append(dst_entry) | 109 | deploy_files.append(dst_entry) |
| 104 | 110 | ||
| 105 | for deploy_entry in deploy_files: | 111 | for deploy_entry in deploy_files: |
| @@ -117,7 +123,7 @@ class BootimgPartitionPlugin(SourcePlugin): | |||
| 117 | 123 | ||
| 118 | srcs = glob(os.path.join(bootimg_dir, src)) | 124 | srcs = glob(os.path.join(bootimg_dir, src)) |
| 119 | 125 | ||
| 120 | msger.debug('Globbed sources: %s' % (', '.join(srcs))) | 126 | logger.debug('Globbed sources: %s', ', '.join(srcs)) |
| 121 | for entry in srcs: | 127 | for entry in srcs: |
| 122 | entry_dst_name = entry_name_fn(entry) | 128 | entry_dst_name = entry_name_fn(entry) |
| 123 | install_task.append((entry, | 129 | install_task.append((entry, |
| @@ -129,12 +135,12 @@ class BootimgPartitionPlugin(SourcePlugin): | |||
| 129 | 135 | ||
| 130 | for task in install_task: | 136 | for task in install_task: |
| 131 | src_path, dst_path = task | 137 | src_path, dst_path = task |
| 132 | msger.debug('Install %s as %s' % (os.path.basename(src_path), | 138 | logger.debug('Install %s as %s', |
| 133 | dst_path)) | 139 | os.path.basename(src_path), dst_path) |
| 134 | install_cmd = "install -m 0644 -D %s %s" \ | 140 | install_cmd = "install -m 0644 -D %s %s" \ |
| 135 | % (src_path, dst_path) | 141 | % (src_path, dst_path) |
| 136 | exec_cmd(install_cmd) | 142 | exec_cmd(install_cmd) |
| 137 | 143 | ||
| 138 | msger.debug('Prepare boot partition using rootfs in %s' % (hdddir)) | 144 | logger.debug('Prepare boot partition using rootfs in %s', hdddir) |
| 139 | part.prepare_rootfs(cr_workdir, oe_builddir, hdddir, | 145 | part.prepare_rootfs(cr_workdir, oe_builddir, hdddir, |
| 140 | native_sysroot) | 146 | native_sysroot) |
