Patchwork [01/35] wic: Make exec_cmd() error out instead of warn

login
register
mail settings
Submitter tom.zanussi@linux.intel.com
Date Aug. 8, 2014, 10:05 p.m.
Message ID <116ccc6f7ce3e70924e3fae56b24ff9e0914bde2.1407533201.git.tom.zanussi@linux.intel.com>
Download mbox | patch
Permalink /patch/77581/
State Accepted
Commit 68e6adf2df70c3f83d67dc869b3ce989a6902b80
Headers show

Comments

tom.zanussi@linux.intel.com - Aug. 8, 2014, 10:05 p.m.
The reason exec_cmd() warns but doesn't error out (broken parted)
doesn't really make sense, since the parted invocations don't even use
exec_cmd().  It really should just fail since by not doing so it's
actually enabling invalid images in some cases.

Also, since the return code is now always zero, there's no point in
having a return code, so remove it.  This represents a change in the
API, so we also need to update all callers.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 .../lib/mic/kickstart/custom_commands/partition.py | 44 +++++++++++-----------
 scripts/lib/mic/plugins/source/bootimg-efi.py      |  8 ++--
 scripts/lib/mic/plugins/source/bootimg-pcbios.py   | 10 ++---
 scripts/lib/mic/utils/fs_related.py                |  2 +-
 scripts/lib/mic/utils/oe/misc.py                   | 33 +++++++++-------
 scripts/lib/mic/utils/partitionedfs.py             |  2 +-
 6 files changed, 53 insertions(+), 46 deletions(-)
tom.zanussi@linux.intel.com - Aug. 8, 2014, 10:05 p.m.
mic chroot allows users to chroot into an existing mic image and isn't
used by wic, so remove it.

Removing chroot.py leads in turn to various plugin-loading failures
for a number of plugins that wic doesn't use either, so remove those
as well.

The existing source plugins refer to chroot but don't use it, so fix
those up.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 scripts/lib/mic/chroot.py                        | 343 -----------
 scripts/lib/mic/imager/fs.py                     |  99 ---
 scripts/lib/mic/imager/livecd.py                 | 750 -----------------------
 scripts/lib/mic/imager/liveusb.py                | 308 ----------
 scripts/lib/mic/imager/loop.py                   | 418 -------------
 scripts/lib/mic/imager/raw.py                    | 501 ---------------
 scripts/lib/mic/plugins/imager/direct_plugin.py  |   2 +-
 scripts/lib/mic/plugins/imager/fs_plugin.py      | 143 -----
 scripts/lib/mic/plugins/imager/livecd_plugin.py  | 255 --------
 scripts/lib/mic/plugins/imager/liveusb_plugin.py | 260 --------
 scripts/lib/mic/plugins/imager/loop_plugin.py    | 255 --------
 scripts/lib/mic/plugins/imager/raw_plugin.py     | 275 ---------
 scripts/lib/mic/plugins/source/bootimg-efi.py    |   2 +-
 scripts/lib/mic/plugins/source/bootimg-pcbios.py |   2 +-
 scripts/lib/mic/plugins/source/rootfs.py         |   2 +-
 15 files changed, 4 insertions(+), 3611 deletions(-)
 delete mode 100644 scripts/lib/mic/chroot.py
 delete mode 100644 scripts/lib/mic/imager/fs.py
 delete mode 100644 scripts/lib/mic/imager/livecd.py
 delete mode 100644 scripts/lib/mic/imager/liveusb.py
 delete mode 100644 scripts/lib/mic/imager/loop.py
 delete mode 100644 scripts/lib/mic/imager/raw.py
 delete mode 100644 scripts/lib/mic/plugins/imager/fs_plugin.py
 delete mode 100644 scripts/lib/mic/plugins/imager/livecd_plugin.py
 delete mode 100644 scripts/lib/mic/plugins/imager/liveusb_plugin.py
 delete mode 100644 scripts/lib/mic/plugins/imager/loop_plugin.py
 delete mode 100644 scripts/lib/mic/plugins/imager/raw_plugin.py

Patch too large to post - see git repository.
tom.zanussi@linux.intel.com - Aug. 8, 2014, 10:05 p.m.
wic doesn't use the yum or zypp package managers, remove them.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 scripts/lib/mic/plugins/backend/yumpkgmgr.py  | 490 -------------
 scripts/lib/mic/plugins/backend/zypppkgmgr.py | 973 --------------------------
 2 files changed, 1463 deletions(-)
 delete mode 100644 scripts/lib/mic/plugins/backend/yumpkgmgr.py
 delete mode 100755 scripts/lib/mic/plugins/backend/zypppkgmgr.py

Patch too large to post - see git repository.
tom.zanussi@linux.intel.com - Aug. 8, 2014, 10:05 p.m.
wic doesn't use it, so remove it.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 .../3rdparty/pykickstart/urlgrabber/__init__.py    |   53 -
 .../3rdparty/pykickstart/urlgrabber/byterange.py   |  463 ------
 .../mic/3rdparty/pykickstart/urlgrabber/grabber.py | 1477 --------------------
 .../3rdparty/pykickstart/urlgrabber/keepalive.py   |  617 --------
 .../mic/3rdparty/pykickstart/urlgrabber/mirror.py  |  458 ------
 .../3rdparty/pykickstart/urlgrabber/progress.py    |  530 -------
 .../3rdparty/pykickstart/urlgrabber/sslfactory.py  |   90 --
 7 files changed, 3688 deletions(-)
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/__init__.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/byterange.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/grabber.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/keepalive.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/mirror.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/progress.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/sslfactory.py

Patch too large to post - see git repository.
tom.zanussi@linux.intel.com - Aug. 8, 2014, 10:05 p.m.
wic doesn't use anything but partition and bootloader, so remove the
rest.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 .../mic/3rdparty/pykickstart/commands/__init__.py  |    8 +-
 .../3rdparty/pykickstart/commands/authconfig.py    |   40 -
 .../mic/3rdparty/pykickstart/commands/autopart.py  |  119 ---
 .../mic/3rdparty/pykickstart/commands/autostep.py  |   55 -
 .../mic/3rdparty/pykickstart/commands/clearpart.py |   86 --
 .../mic/3rdparty/pykickstart/commands/device.py    |  125 ---
 .../3rdparty/pykickstart/commands/deviceprobe.py   |   40 -
 .../3rdparty/pykickstart/commands/displaymode.py   |   68 --
 .../mic/3rdparty/pykickstart/commands/dmraid.py    |   91 --
 .../3rdparty/pykickstart/commands/driverdisk.py    |  184 ----
 .../lib/mic/3rdparty/pykickstart/commands/fcoe.py  |  114 --
 .../mic/3rdparty/pykickstart/commands/firewall.py  |  193 ----
 .../mic/3rdparty/pykickstart/commands/firstboot.py |   62 --
 .../lib/mic/3rdparty/pykickstart/commands/group.py |   88 --
 .../3rdparty/pykickstart/commands/ignoredisk.py    |  139 ---
 .../3rdparty/pykickstart/commands/interactive.py   |   58 --
 .../lib/mic/3rdparty/pykickstart/commands/iscsi.py |  133 ---
 .../mic/3rdparty/pykickstart/commands/iscsiname.py |   54 -
 .../lib/mic/3rdparty/pykickstart/commands/key.py   |   64 --
 .../mic/3rdparty/pykickstart/commands/keyboard.py  |   55 -
 .../lib/mic/3rdparty/pykickstart/commands/lang.py  |   60 --
 .../3rdparty/pykickstart/commands/langsupport.py   |   58 --
 .../mic/3rdparty/pykickstart/commands/lilocheck.py |   54 -
 .../mic/3rdparty/pykickstart/commands/logging.py   |   66 --
 .../mic/3rdparty/pykickstart/commands/logvol.py    |  304 ------
 .../3rdparty/pykickstart/commands/mediacheck.py    |   53 -
 .../mic/3rdparty/pykickstart/commands/method.py    |  186 ----
 .../mic/3rdparty/pykickstart/commands/monitor.py   |  106 --
 .../lib/mic/3rdparty/pykickstart/commands/mouse.py |   70 --
 .../mic/3rdparty/pykickstart/commands/multipath.py |  111 --
 .../mic/3rdparty/pykickstart/commands/network.py   |  363 -------
 .../lib/mic/3rdparty/pykickstart/commands/raid.py  |  365 -------
 .../mic/3rdparty/pykickstart/commands/reboot.py    |   79 --
 .../lib/mic/3rdparty/pykickstart/commands/repo.py  |  249 -----
 .../mic/3rdparty/pykickstart/commands/rescue.py    |   68 --
 .../mic/3rdparty/pykickstart/commands/rootpw.py    |   93 --
 .../mic/3rdparty/pykickstart/commands/selinux.py   |   64 --
 .../mic/3rdparty/pykickstart/commands/services.py  |   71 --
 .../lib/mic/3rdparty/pykickstart/commands/skipx.py |   54 -
 .../lib/mic/3rdparty/pykickstart/commands/sshpw.py |  105 --
 .../mic/3rdparty/pykickstart/commands/timezone.py  |   86 --
 .../mic/3rdparty/pykickstart/commands/updates.py   |   60 --
 .../mic/3rdparty/pykickstart/commands/upgrade.py   |  106 --
 .../lib/mic/3rdparty/pykickstart/commands/user.py  |  173 ----
 .../lib/mic/3rdparty/pykickstart/commands/vnc.py   |  114 --
 .../mic/3rdparty/pykickstart/commands/volgroup.py  |  102 --
 .../mic/3rdparty/pykickstart/commands/xconfig.py   |  184 ----
 .../mic/3rdparty/pykickstart/commands/zerombr.py   |   69 --
 .../lib/mic/3rdparty/pykickstart/commands/zfcp.py  |  134 ---
 .../mic/3rdparty/pykickstart/handlers/control.py   | 1092 --------------------
 50 files changed, 1 insertion(+), 6474 deletions(-)
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/authconfig.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/autopart.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/autostep.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/clearpart.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/device.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/deviceprobe.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/displaymode.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/dmraid.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/driverdisk.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/fcoe.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/firewall.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/firstboot.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/group.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/ignoredisk.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/interactive.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/iscsi.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/iscsiname.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/key.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/keyboard.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/lang.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/langsupport.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/lilocheck.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/logging.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/logvol.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/mediacheck.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/method.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/monitor.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/mouse.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/multipath.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/network.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/raid.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/reboot.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/repo.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/rescue.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/rootpw.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/selinux.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/services.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/skipx.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/sshpw.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/timezone.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/updates.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/upgrade.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/user.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/vnc.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/volgroup.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/xconfig.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/zerombr.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/zfcp.py

Patch too large to post - see git repository.
Ola X Nilsson - Sept. 9, 2014, 11:48 a.m.
This commit breaks wic for me. 
Urlgrabber is imported from pykickstart/version.py and pykickstart/parser.py.

Having python-urlgrabber installed in your distro hides this problem.
tom.zanussi@linux.intel.com - Sept. 9, 2014, 4:23 p.m.
On Tue, 2014-09-09 at 13:48 +0200, Ola X Nilsson wrote:
> This commit breaks wic for me. 
> Urlgrabber is imported from pykickstart/version.py and pykickstart/parser.py.
> 
> Having python-urlgrabber installed in your distro hides this problem.
> 

Thanks for the report - I just posted a patch to fix this to the list -
please try it out.

Thanks,

Tom

Patch

diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
index 3b652b3..101b90e 100644
--- a/scripts/lib/mic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
@@ -161,7 +161,7 @@  class Wic_PartData(Mic_PartData):
         """
         rootfs = oe_builddir
         du_cmd = "du -Lbms %s" % rootfs
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         rootfs_size = out.split()[0]
 
         self.size = rootfs_size
@@ -209,7 +209,7 @@  class Wic_PartData(Mic_PartData):
         rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype)
 
         du_cmd = "du -ks %s" % image_rootfs
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         actual_rootfs_size = int(out.split()[0])
 
         extra_blocks = self.get_extra_block_count(actual_rootfs_size)
@@ -224,18 +224,18 @@  class Wic_PartData(Mic_PartData):
 
         dd_cmd = "dd if=/dev/zero of=%s bs=1024 seek=%d count=0 bs=1k" % \
             (rootfs, rootfs_size)
-        rc, out = exec_cmd(dd_cmd)
+        exec_cmd(dd_cmd)
 
         extra_imagecmd = "-i 8192"
 
         mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
             (self.fstype, extra_imagecmd, rootfs, image_rootfs)
-        rc, out = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
+        exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
 
 
         # get the rootfs size in the right units for kickstart (Mb)
         du_cmd = "du -Lbms %s" % rootfs
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         rootfs_size = out.split()[0]
 
         self.size = rootfs_size
@@ -254,7 +254,7 @@  class Wic_PartData(Mic_PartData):
         rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
 
         du_cmd = "du -ks %s" % image_rootfs
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         actual_rootfs_size = int(out.split()[0])
 
         extra_blocks = self.get_extra_block_count(actual_rootfs_size)
@@ -269,15 +269,15 @@  class Wic_PartData(Mic_PartData):
 
         dd_cmd = "dd if=/dev/zero of=%s bs=1024 seek=%d count=0 bs=1k" % \
             (rootfs, rootfs_size)
-        rc, out = exec_cmd(dd_cmd)
+        exec_cmd(dd_cmd)
 
         mkfs_cmd = "mkfs.%s -b %d -r %s %s" % \
             (self.fstype, rootfs_size * 1024, image_rootfs, rootfs)
-        rc, out = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
+        exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
 
         # get the rootfs size in the right units for kickstart (Mb)
         du_cmd = "du -Lbms %s" % rootfs
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         rootfs_size = out.split()[0]
 
         self.size = rootfs_size
@@ -292,7 +292,7 @@  class Wic_PartData(Mic_PartData):
         rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
 
         du_cmd = "du -bks %s" % image_rootfs
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         blocks = int(out.split()[0])
 
         extra_blocks = self.get_extra_block_count(blocks)
@@ -324,7 +324,7 @@  class Wic_PartData(Mic_PartData):
 
         # get the rootfs size in the right units for kickstart (Mb)
         du_cmd = "du -Lbms %s" % rootfs
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         rootfs_size = out.split()[0]
 
         self.set_size(rootfs_size)
@@ -340,11 +340,11 @@  class Wic_PartData(Mic_PartData):
 
         squashfs_cmd = "mksquashfs %s %s -noappend" % \
                        (image_rootfs, rootfs)
-        rc, out = exec_native_cmd(pseudo + squashfs_cmd, native_sysroot)
+        exec_native_cmd(pseudo + squashfs_cmd, native_sysroot)
 
         # get the rootfs size in the right units for kickstart (Mb)
         du_cmd = "du -Lbms %s" % rootfs
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         rootfs_size = out.split()[0]
 
         self.size = rootfs_size
@@ -378,12 +378,12 @@  class Wic_PartData(Mic_PartData):
 
         dd_cmd = "dd if=/dev/zero of=%s bs=1M seek=%d count=0" % \
             (fs, self.size)
-        rc, out = exec_cmd(dd_cmd)
+        exec_cmd(dd_cmd)
 
         extra_imagecmd = "-i 8192"
 
         mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, fs)
-        rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
+        exec_native_cmd(mkfs_cmd, native_sysroot)
 
         self.source_file = fs
 
@@ -398,13 +398,13 @@  class Wic_PartData(Mic_PartData):
 
         dd_cmd = "dd if=/dev/zero of=%s bs=1M seek=%d count=0" % \
             (fs, self.size)
-        rc, out = exec_cmd(dd_cmd)
+        exec_cmd(dd_cmd)
 
         mkfs_cmd = "mkfs.%s -b %d %s" % (self.fstype, self.size * 1024, rootfs)
-        rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
+        exec_native_cmd(mkfs_cmd, native_sysroot)
 
         mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, fs)
-        rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
+        exec_native_cmd(mkfs_cmd, native_sysroot)
 
         self.source_file = fs
 
@@ -445,13 +445,13 @@  class Wic_PartData(Mic_PartData):
 
         squashfs_cmd = "mksquashfs %s %s -noappend" % \
                        (tmpdir, fs)
-        rc, out = exec_native_cmd(squashfs_cmd, native_sysroot)
+        exec_native_cmd(squashfs_cmd, native_sysroot)
 
         os.rmdir(tmpdir)
 
         # get the rootfs size in the right units for kickstart (Mb)
         du_cmd = "du -Lbms %s" % fs
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         fs_size = out.split()[0]
 
         self.size = fs_size
@@ -467,14 +467,14 @@  class Wic_PartData(Mic_PartData):
 
         dd_cmd = "dd if=/dev/zero of=%s bs=1M seek=%d count=0" % \
             (fs, self.size)
-        rc, out = exec_cmd(dd_cmd)
+        exec_cmd(dd_cmd)
 
         import uuid
         label_str = ""
         if self.label:
             label_str = "-L %s" % self.label
         mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), fs)
-        rc, out = exec_native_cmd(mkswap_cmd, native_sysroot)
+        exec_native_cmd(mkswap_cmd, native_sysroot)
 
         self.source_file = fs
 
diff --git a/scripts/lib/mic/plugins/source/bootimg-efi.py b/scripts/lib/mic/plugins/source/bootimg-efi.py
index 0dd9152..aecda6b 100644
--- a/scripts/lib/mic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/mic/plugins/source/bootimg-efi.py
@@ -53,7 +53,7 @@  class BootimgEFIPlugin(SourcePlugin):
         exec_cmd(rm_cmd)
 
         install_cmd = "install -d %s/EFI/BOOT" % hdddir
-        tmp = exec_cmd(install_cmd)
+        exec_cmd(install_cmd)
 
         splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
         if os.path.exists(splash):
@@ -116,7 +116,7 @@  class BootimgEFIPlugin(SourcePlugin):
 
         install_cmd = "install -m 0644 %s/bzImage %s/bzImage" % \
             (staging_kernel_dir, hdddir)
-        tmp = exec_cmd(install_cmd)
+        exec_cmd(install_cmd)
 
         shutil.copyfile("%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir,
                         "%s/grub.cfg" % cr_workdir)
@@ -128,7 +128,7 @@  class BootimgEFIPlugin(SourcePlugin):
                     "%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir)
 
         du_cmd = "du -bks %s" % hdddir
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         blocks = int(out.split()[0])
 
         extra_blocks = part.get_extra_block_count(blocks)
@@ -160,7 +160,7 @@  class BootimgEFIPlugin(SourcePlugin):
         exec_cmd(chmod_cmd)
 
         du_cmd = "du -Lbms %s" % bootimg
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         bootimg_size = out.split()[0]
 
         part.set_size(bootimg_size)
diff --git a/scripts/lib/mic/plugins/source/bootimg-pcbios.py b/scripts/lib/mic/plugins/source/bootimg-pcbios.py
index 1211e5c..6488ae9 100644
--- a/scripts/lib/mic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/mic/plugins/source/bootimg-pcbios.py
@@ -78,7 +78,7 @@  class BootimgPcbiosPlugin(SourcePlugin):
         exec_cmd(rm_cmd)
 
         install_cmd = "install -d %s" % hdddir
-        tmp = exec_cmd(install_cmd)
+        exec_cmd(install_cmd)
 
         splash = os.path.join(cr_workdir, "/hdd/boot/splash.jpg")
         if os.path.exists(splash):
@@ -144,14 +144,14 @@  class BootimgPcbiosPlugin(SourcePlugin):
 
         install_cmd = "install -m 0644 %s/bzImage %s/vmlinuz" \
             % (staging_kernel_dir, hdddir)
-        tmp = exec_cmd(install_cmd)
+        exec_cmd(install_cmd)
 
         install_cmd = "install -m 444 %s/syslinux/ldlinux.sys %s/ldlinux.sys" \
             % (staging_data_dir, hdddir)
-        tmp = exec_cmd(install_cmd)
+        exec_cmd(install_cmd)
 
         du_cmd = "du -bks %s" % hdddir
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         blocks = int(out.split()[0])
 
         extra_blocks = part.get_extra_block_count(blocks)
@@ -186,7 +186,7 @@  class BootimgPcbiosPlugin(SourcePlugin):
         exec_cmd(chmod_cmd)
 
         du_cmd = "du -Lbms %s" % bootimg
-        rc, out = exec_cmd(du_cmd)
+        out = exec_cmd(du_cmd)
         bootimg_size = out.split()[0]
 
         part.set_size(bootimg_size)
diff --git a/scripts/lib/mic/utils/fs_related.py b/scripts/lib/mic/utils/fs_related.py
index dd420e8..182171f 100644
--- a/scripts/lib/mic/utils/fs_related.py
+++ b/scripts/lib/mic/utils/fs_related.py
@@ -306,7 +306,7 @@  class DiskImage(Disk):
         # create disk image
         dd_cmd = "dd if=/dev/zero of=%s bs=1024 seek=%d count=1" % \
             (self.image_file, blocks)
-        rc, out = exec_cmd(dd_cmd)
+        exec_cmd(dd_cmd)
 
         self.device = self.image_file
 
diff --git a/scripts/lib/mic/utils/oe/misc.py b/scripts/lib/mic/utils/oe/misc.py
index 16c250a..bed2750 100644
--- a/scripts/lib/mic/utils/oe/misc.py
+++ b/scripts/lib/mic/utils/oe/misc.py
@@ -28,13 +28,13 @@ 
 from mic import msger
 from mic.utils import runner
 
-def exec_cmd(cmd_and_args, as_shell = False, catch = 3):
+def __exec_cmd(cmd_and_args, as_shell = False, catch = 3):
     """
     Execute command, catching stderr, stdout
 
     Need to execute as_shell if the command uses wildcards
     """
-    msger.debug("exec_cmd: %s" % cmd_and_args)
+    msger.debug("__exec_cmd: %s" % cmd_and_args)
     args = cmd_and_args.split()
     msger.debug(args)
 
@@ -43,24 +43,31 @@  def exec_cmd(cmd_and_args, as_shell = False, catch = 3):
     else:
         rc, out = runner.runtool(args, catch)
     out = out.strip()
-    msger.debug("exec_cmd: output for %s (rc = %d): %s" % \
-                    (cmd_and_args, rc, out))
+    msger.debug("__exec_cmd: output for %s (rc = %d): %s" % \
+                (cmd_and_args, rc, out))
+
+    return (rc, out)
+
+
+def exec_cmd(cmd_and_args, as_shell = False, catch = 3):
+    """
+    Execute command, catching stderr, stdout
+
+    Exits if rc non-zero
+    """
+    rc, out = __exec_cmd(cmd_and_args, as_shell, catch)
 
     if rc != 0:
-        # We don't throw exception when return code is not 0, because
-        # parted always fails to reload part table with loop devices. This
-        # prevents us from distinguishing real errors based on return
-        # code.
-        msger.warning("WARNING: %s returned '%s' instead of 0" % (cmd_and_args, rc))
+        msger.error("exec_cmd: %s returned '%s' instead of 0" % (cmd_and_args, rc))
 
-    return (rc, out)
+    return out
 
 
 def exec_cmd_quiet(cmd_and_args, as_shell = False):
     """
     Execute command, catching nothing in the output
 
-    Need to execute as_shell if the command uses wildcards
+    Exits if rc non-zero
     """
     return exec_cmd(cmd_and_args, as_shell, 0)
 
@@ -82,7 +89,7 @@  def exec_native_cmd(cmd_and_args, native_sysroot, catch = 3):
     args = cmd_and_args.split()
     msger.debug(args)
 
-    rc, out = exec_cmd(native_cmd_and_args, True, catch)
+    rc, out = __exec_cmd(native_cmd_and_args, True, catch)
 
     if rc == 127: # shell command-not-found
         msger.error("A native (host) program required to build the image "
@@ -135,7 +142,7 @@  def find_bitbake_env_lines(image_name):
         bitbake_env_cmd = "bitbake -e %s" % image_name
     else:
         bitbake_env_cmd = "bitbake -e"
-    rc, bitbake_env_lines = exec_cmd(bitbake_env_cmd)
+    rc, bitbake_env_lines = __exec_cmd(bitbake_env_cmd)
     if rc != 0:
         print "Couldn't get '%s' output." % bitbake_env_cmd
         return None
diff --git a/scripts/lib/mic/utils/partitionedfs.py b/scripts/lib/mic/utils/partitionedfs.py
index 593cf1f..83ce869 100644
--- a/scripts/lib/mic/utils/partitionedfs.py
+++ b/scripts/lib/mic/utils/partitionedfs.py
@@ -744,7 +744,7 @@  class PartitionedMount(Mount):
 
         dd_cmd = "dd if=%s of=%s bs=%d seek=%d count=%d conv=notrunc" % \
             (source_file, self.image_file, self.sector_size, start, size)
-        rc, out = exec_cmd(dd_cmd)
+        exec_cmd(dd_cmd)
 
 
     def install(self, image_file):