summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2014-11-26 08:22:05 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-11-26 17:05:45 +0000
commit00af5317ebe0819f9e9e5c10184b00b59eecccb5 (patch)
tree8a5ab9af9c8fd8e4b851cbf159ebc3470263f261 /scripts
parentdb7f4f31c915a59c502cac4be905d23df5246b3d (diff)
downloadpoky-00af5317ebe0819f9e9e5c10184b00b59eecccb5.tar.gz
wic: Don't allow mkfs to fail silently in partition command
The return code from the mkfs command used by the partition creation command was being ignored, allowing it to silently fail and leaving users mystified as to why the resulting filesystem was corrupted. This became obvious when failures occurred when creating large e.g. sdk filesystems [YOCTO #6863]. (From OE-Core rev: 8cef3b06f7e9f9d922673f430ddb3170d2fac000) (From OE-Core rev: ac7b2eb0a35613d030eeef0b8df0d69ae0935b43) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/kickstart/custom_commands/partition.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 8b0ace6299..3950b43621 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -241,8 +241,10 @@ class Wic_PartData(Mic_PartData):
241 241
242 mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \ 242 mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
243 (self.fstype, extra_imagecmd, rootfs, image_rootfs) 243 (self.fstype, extra_imagecmd, rootfs, image_rootfs)
244 exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) 244 (rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
245 245 if rc:
246 print "rootfs_dir: %s" % rootfs_dir
247 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))
246 248
247 # get the rootfs size in the right units for kickstart (Mb) 249 # get the rootfs size in the right units for kickstart (Mb)
248 du_cmd = "du -Lbms %s" % rootfs 250 du_cmd = "du -Lbms %s" % rootfs
@@ -284,7 +286,9 @@ class Wic_PartData(Mic_PartData):
284 286
285 mkfs_cmd = "mkfs.%s -b %d -r %s %s" % \ 287 mkfs_cmd = "mkfs.%s -b %d -r %s %s" % \
286 (self.fstype, rootfs_size * 1024, image_rootfs, rootfs) 288 (self.fstype, rootfs_size * 1024, image_rootfs, rootfs)
287 exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) 289 (rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
290 if rc:
291 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))
288 292
289 # get the rootfs size in the right units for kickstart (Mb) 293 # get the rootfs size in the right units for kickstart (Mb)
290 du_cmd = "du -Lbms %s" % rootfs 294 du_cmd = "du -Lbms %s" % rootfs
@@ -396,7 +400,9 @@ class Wic_PartData(Mic_PartData):
396 extra_imagecmd = "-i 8192" 400 extra_imagecmd = "-i 8192"
397 401
398 mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, fs) 402 mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, fs)
399 exec_native_cmd(mkfs_cmd, native_sysroot) 403 (rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot)
404 if rc:
405 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))
400 406
401 self.source_file = fs 407 self.source_file = fs
402 408
@@ -414,10 +420,14 @@ class Wic_PartData(Mic_PartData):
414 exec_cmd(dd_cmd) 420 exec_cmd(dd_cmd)
415 421
416 mkfs_cmd = "mkfs.%s -b %d %s" % (self.fstype, self.size * 1024, rootfs) 422 mkfs_cmd = "mkfs.%s -b %d %s" % (self.fstype, self.size * 1024, rootfs)
417 exec_native_cmd(mkfs_cmd, native_sysroot) 423 (rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot)
424 if rc:
425 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))
418 426
419 mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, fs) 427 mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, fs)
420 exec_native_cmd(mkfs_cmd, native_sysroot) 428 (rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot)
429 if rc:
430 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))
421 431
422 self.source_file = fs 432 self.source_file = fs
423 433