[v3,2/9] wic/plugins: Fix wic plugins to work with the latest wic

Message ID 20200907161756.16372-3-Vijaikumar_Kanagarajan@mentor.com
State Superseded, archived
Headers show
Series WIC update | expand

Commit Message

Vijai Kumar K Sept. 7, 2020, 8:17 a.m. UTC
In the latest wic, wic.utils is removed and part of the implmentation
is moved to wic.misc. Fix the wic imports accordingly.

Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
 meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py  | 2 +-
 .../lib/wic/plugins/source/bootimg-pcbios-isar.py        | 9 +++------
 meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py     | 2 +-
 3 files changed, 5 insertions(+), 8 deletions(-)

Patch

diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py
index 25b12ca..2285d2e 100644
--- a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py
+++ b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py
@@ -31,7 +31,7 @@  import shutil
 from wic import WicError
 from wic.engine import get_custom_config
 from wic.pluginbase import SourcePlugin
-from wic.utils.misc import (exec_cmd, get_bitbake_var, BOOTDD_EXTRA_SPACE)
+from wic.misc import (exec_cmd, get_bitbake_var, BOOTDD_EXTRA_SPACE)
 
 logger = logging.getLogger('wic')
 
diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
index 0423862..4d916d6 100644
--- a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
+++ b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
@@ -29,9 +29,8 @@  import os
 
 from wic import WicError
 from wic.engine import get_custom_config
-from wic.utils import runner
 from wic.pluginbase import SourcePlugin
-from wic.utils.misc import (exec_cmd, exec_native_cmd,
+from wic.misc import (exec_cmd, exec_native_cmd,
                             get_bitbake_var, BOOTDD_EXTRA_SPACE)
 
 logger = logging.getLogger('wic')
@@ -83,10 +82,8 @@  class BootimgPcbiosIsarPlugin(SourcePlugin):
         logger.debug("Installing MBR on disk %s as %s with size %s bytes",
                      disk_name, full_path, disk.min_size)
 
-        rcode = runner.show(['dd', 'if=%s' % mbrfile,
-                             'of=%s' % full_path, 'conv=notrunc'])
-        if rcode != 0:
-            raise WicError("Unable to set MBR to %s" % full_path)
+        dd_cmd = "dd if=%s of=%s conv=notrunc" % (mbrfile, full_path)
+        exec_cmd(dd_cmd, native_sysroot)
 
     @classmethod
     def do_configure_partition(cls, part, source_params, creator, cr_workdir,
diff --git a/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py b/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py
index f60afb8..3ac0aa0 100644
--- a/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py
+++ b/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py
@@ -18,7 +18,7 @@  import os
 
 from wic import WicError
 from wic.plugins.source.rootfs import RootfsPlugin
-from wic.utils.misc import exec_cmd
+from wic.misc import exec_cmd
 
 logger = logging.getLogger('wic')