diff options
Diffstat (limited to 'scripts/lib/wic/engine.py')
| -rw-r--r-- | scripts/lib/wic/engine.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py index 7fb6f1317b..e27598d01a 100644 --- a/scripts/lib/wic/engine.py +++ b/scripts/lib/wic/engine.py | |||
| @@ -31,7 +31,7 @@ | |||
| 31 | import os | 31 | import os |
| 32 | import sys | 32 | import sys |
| 33 | 33 | ||
| 34 | from wic import msger, creator | 34 | from wic import msger |
| 35 | from wic.plugin import pluginmgr | 35 | from wic.plugin import pluginmgr |
| 36 | from wic.utils.misc import get_bitbake_var | 36 | from wic.utils.misc import get_bitbake_var |
| 37 | 37 | ||
| @@ -145,10 +145,10 @@ def list_source_plugins(): | |||
| 145 | print(" %s" % plugin) | 145 | print(" %s" % plugin) |
| 146 | 146 | ||
| 147 | 147 | ||
| 148 | def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir, | 148 | def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir, native_sysroot, |
| 149 | native_sysroot, scripts_path, image_output_dir, | 149 | scripts_path, options): |
| 150 | compressor, bmap, debug): | 150 | """ |
| 151 | """Create image | 151 | Create image |
| 152 | 152 | ||
| 153 | wks_file - user-defined OE kickstart file | 153 | wks_file - user-defined OE kickstart file |
| 154 | rootfs_dir - absolute path to the build's /rootfs dir | 154 | rootfs_dir - absolute path to the build's /rootfs dir |
| @@ -157,8 +157,7 @@ def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir, | |||
| 157 | native_sysroot - absolute path to the build's native sysroots dir | 157 | native_sysroot - absolute path to the build's native sysroots dir |
| 158 | scripts_path - absolute path to /scripts dir | 158 | scripts_path - absolute path to /scripts dir |
| 159 | image_output_dir - dirname to create for image | 159 | image_output_dir - dirname to create for image |
| 160 | compressor - compressor utility to compress the image | 160 | options - wic command line options (debug, bmap, etc) |
| 161 | bmap - enable generation of .bmap | ||
| 162 | 161 | ||
| 163 | Normally, the values for the build artifacts values are determined | 162 | Normally, the values for the build artifacts values are determined |
| 164 | by 'wic -e' from the output of the 'bitbake -e' command given an | 163 | by 'wic -e' from the output of the 'bitbake -e' command given an |
| @@ -184,20 +183,21 @@ def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir, | |||
| 184 | print("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)") | 183 | print("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)") |
| 185 | sys.exit(1) | 184 | sys.exit(1) |
| 186 | 185 | ||
| 187 | if debug: | 186 | if options.debug: |
| 188 | msger.set_loglevel('debug') | 187 | msger.set_loglevel('debug') |
| 189 | 188 | ||
| 190 | if not os.path.exists(image_output_dir): | 189 | if not os.path.exists(options.outdir): |
| 191 | os.makedirs(image_output_dir) | 190 | os.makedirs(options.outdir) |
| 192 | 191 | ||
| 193 | crobj = creator.Creator() | 192 | pname = 'direct' |
| 193 | plugin_class = pluginmgr.get_plugins('imager').get(pname) | ||
| 194 | if not plugin_class: | ||
| 195 | msger.error('Unknown plugin: %s' % pname) | ||
| 194 | 196 | ||
| 195 | cmdline = ["direct", native_sysroot, kernel_dir, bootimg_dir, rootfs_dir, | 197 | plugin = plugin_class(wks_file, rootfs_dir, bootimg_dir, kernel_dir, |
| 196 | wks_file, image_output_dir, oe_builddir, compressor or ""] | 198 | native_sysroot, scripts_path, oe_builddir, options) |
| 197 | if bmap: | ||
| 198 | cmdline.append('--bmap') | ||
| 199 | 199 | ||
| 200 | crobj.main(cmdline) | 200 | plugin.do_create() |
| 201 | 201 | ||
| 202 | print("\nThe image(s) were created using OE kickstart file:\n %s" % wks_file) | 202 | print("\nThe image(s) were created using OE kickstart file:\n %s" % wks_file) |
| 203 | 203 | ||
