diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-06-05 09:13:07 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-11 23:59:11 +0100 |
| commit | dec9156ce86eb00153493d3d49344f0623ec4562 (patch) | |
| tree | 86a74bda320f47dbfd9c4d1df8cd9082d42e3db9 /scripts/lib/wic/kickstart/custom_commands | |
| parent | 77e9243210b2283a5fbd3f40e7823a211d2be233 (diff) | |
| download | poky-dec9156ce86eb00153493d3d49344f0623ec4562.tar.gz | |
wic: move checks to exec_native_cmd
Checked for return code and output of native commands
inside exec_native_cmd.
Removed similar code from a lot of places where
exec_native_cmd is called.
(From OE-Core rev: 9e3e933321d58c04619a585326fb291dbf2748f5)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/kickstart/custom_commands')
| -rw-r--r-- | scripts/lib/wic/kickstart/custom_commands/partition.py | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index d9f77d9a28..5d033bb562 100644 --- a/scripts/lib/wic/kickstart/custom_commands/partition.py +++ b/scripts/lib/wic/kickstart/custom_commands/partition.py | |||
| @@ -257,10 +257,7 @@ class Wic_PartData(Mic_PartData): | |||
| 257 | 257 | ||
| 258 | mkfs_cmd = "mkfs.%s -F %s %s %s -d %s" % \ | 258 | mkfs_cmd = "mkfs.%s -F %s %s %s -d %s" % \ |
| 259 | (self.fstype, extra_imagecmd, rootfs, label_str, image_rootfs) | 259 | (self.fstype, extra_imagecmd, rootfs, label_str, image_rootfs) |
| 260 | (rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) | 260 | exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) |
| 261 | if rc: | ||
| 262 | print "rootfs_dir: %s" % rootfs_dir | ||
| 263 | msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details) when creating filesystem from rootfs directory: %s" % (self.fstype, rc, rootfs_dir)) | ||
| 264 | 261 | ||
| 265 | # get the rootfs size in the right units for kickstart (kB) | 262 | # get the rootfs size in the right units for kickstart (kB) |
| 266 | du_cmd = "du -Lbks %s" % rootfs | 263 | du_cmd = "du -Lbks %s" % rootfs |
| @@ -307,9 +304,7 @@ class Wic_PartData(Mic_PartData): | |||
| 307 | 304 | ||
| 308 | mkfs_cmd = "mkfs.%s -b %d -r %s %s %s" % \ | 305 | mkfs_cmd = "mkfs.%s -b %d -r %s %s %s" % \ |
| 309 | (self.fstype, rootfs_size * 1024, image_rootfs, label_str, rootfs) | 306 | (self.fstype, rootfs_size * 1024, image_rootfs, label_str, rootfs) |
| 310 | (rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) | 307 | exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) |
| 311 | if rc: | ||
| 312 | msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details) when creating filesystem from rootfs directory: %s" % (self.fstype, rc, rootfs_dir)) | ||
| 313 | 308 | ||
| 314 | # get the rootfs size in the right units for kickstart (kB) | 309 | # get the rootfs size in the right units for kickstart (kB) |
| 315 | du_cmd = "du -Lbks %s" % rootfs | 310 | du_cmd = "du -Lbks %s" % rootfs |
| @@ -357,9 +352,7 @@ class Wic_PartData(Mic_PartData): | |||
| 357 | exec_native_cmd(dosfs_cmd, native_sysroot) | 352 | exec_native_cmd(dosfs_cmd, native_sysroot) |
| 358 | 353 | ||
| 359 | mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, image_rootfs) | 354 | mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, image_rootfs) |
| 360 | rc, out = exec_native_cmd(mcopy_cmd, native_sysroot) | 355 | exec_native_cmd(mcopy_cmd, native_sysroot) |
| 361 | if rc: | ||
| 362 | msger.error("ERROR: mcopy returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details)" % rc) | ||
| 363 | 356 | ||
| 364 | chmod_cmd = "chmod 644 %s" % rootfs | 357 | chmod_cmd = "chmod 644 %s" % rootfs |
| 365 | exec_cmd(chmod_cmd) | 358 | exec_cmd(chmod_cmd) |
| @@ -432,9 +425,7 @@ class Wic_PartData(Mic_PartData): | |||
| 432 | 425 | ||
| 433 | mkfs_cmd = "mkfs.%s -F %s %s %s" % \ | 426 | mkfs_cmd = "mkfs.%s -F %s %s %s" % \ |
| 434 | (self.fstype, extra_imagecmd, label_str, fs) | 427 | (self.fstype, extra_imagecmd, label_str, fs) |
| 435 | (rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot) | 428 | exec_native_cmd(mkfs_cmd, native_sysroot) |
| 436 | if rc: | ||
| 437 | msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details)" % (self.fstype, rc)) | ||
| 438 | 429 | ||
| 439 | self.source_file = fs | 430 | self.source_file = fs |
| 440 | 431 | ||
| @@ -458,9 +449,7 @@ class Wic_PartData(Mic_PartData): | |||
| 458 | 449 | ||
| 459 | mkfs_cmd = "mkfs.%s -b %d %s %s" % \ | 450 | mkfs_cmd = "mkfs.%s -b %d %s %s" % \ |
| 460 | (self.fstype, self.size * 1024, label_str, fs) | 451 | (self.fstype, self.size * 1024, label_str, fs) |
| 461 | (rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot) | 452 | exec_native_cmd(mkfs_cmd, native_sysroot) |
| 462 | if rc: | ||
| 463 | msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details)" % (self.fstype, rc)) | ||
| 464 | 453 | ||
| 465 | self.source_file = fs | 454 | self.source_file = fs |
| 466 | 455 | ||
