summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-03-26 20:34:27 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-01 08:14:57 +0100
commitd39a1588556d0063ac9c2dd7ed310826db41e677 (patch)
tree9cd0cdbbd9c7d7acd1c938f8138c849c92e19c73 /scripts
parent2122dd7718f46f266e3c03b48828be8977a9baf2 (diff)
downloadpoky-d39a1588556d0063ac9c2dd7ed310826db41e677.tar.gz
wic: remove runner.show API
Replaced runner.show call to exec_cmd call in bootimg-pcbios plugin. Removed runner.show API as it's not used anywhere else. [YOCTO #10618] (From OE-Core rev: 9749336c37249af99c92478c3e4dc8821cb9a816) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-pcbios.py6
-rw-r--r--scripts/lib/wic/utils/runner.py24
2 files changed, 2 insertions, 28 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index bfb8ff5a96..5890c1267b 100644
--- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -81,10 +81,8 @@ class BootimgPcbiosPlugin(SourcePlugin):
81 logger.debug("Installing MBR on disk %s as %s with size %s bytes", 81 logger.debug("Installing MBR on disk %s as %s with size %s bytes",
82 disk_name, full_path, disk.min_size) 82 disk_name, full_path, disk.min_size)
83 83
84 rcode = runner.show(['dd', 'if=%s' % mbrfile, 84 dd_cmd = "dd if=%s of=%s conv=notrunc" % (mbrfile, full_path)
85 'of=%s' % full_path, 'conv=notrunc']) 85 exec_cmd(dd_cmd, native_sysroot)
86 if rcode != 0:
87 raise WicError("Unable to set MBR to %s" % full_path)
88 86
89 @classmethod 87 @classmethod
90 def do_configure_partition(cls, part, source_params, creator, cr_workdir, 88 def do_configure_partition(cls, part, source_params, creator, cr_workdir,
diff --git a/scripts/lib/wic/utils/runner.py b/scripts/lib/wic/utils/runner.py
index 56d7ea3adf..348557aee8 100644
--- a/scripts/lib/wic/utils/runner.py
+++ b/scripts/lib/wic/utils/runner.py
@@ -82,30 +82,6 @@ def runtool(cmdln_or_args, catch=1):
82 82
83 return (process.returncode, out) 83 return (process.returncode, out)
84 84
85def show(cmdln_or_args):
86 """Show all messages using logger.debug."""
87
88 rcode, out = runtool(cmdln_or_args, catch=3)
89
90 if isinstance(cmdln_or_args, list):
91 cmd = ' '.join(cmdln_or_args)
92 else:
93 cmd = cmdln_or_args
94
95 msg = 'running command: "%s"' % cmd
96 if out:
97 out = out.strip()
98 if out:
99 msg += ', with output::'
100 msg += '\n +----------------'
101 for line in out.splitlines():
102 msg += '\n | %s' % line
103 msg += '\n +----------------'
104
105 logger.debug(msg)
106
107 return rcode
108
109def outs(cmdln_or_args, catch=1): 85def outs(cmdln_or_args, catch=1):
110 # get the outputs of tools 86 # get the outputs of tools
111 return runtool(cmdln_or_args, catch)[1].strip() 87 return runtool(cmdln_or_args, catch)[1].strip()