commit 31a635bb403ba80dcd418d78134f831b38600510
Author: Zhou Shuangquan <[email protected]>
Date: Tue Dec 28 18:14:31 2010 +0800
Ensure the logfile is consistent with screen output
diff --git a/mic/imgcreate/fs.py b/mic/imgcreate/fs.py
index 9d7dc26..4203fc0 100644
--- a/mic/imgcreate/fs.py
+++ b/mic/imgcreate/fs.py
@@ -117,7 +117,7 @@ def mksquashfs(in_img, out_img):
if not sys.stdout.isatty():
args.append("-no-progress")
- ret = subprocess.call(args)
+ ret = subprocess.call(args, stdout=sys.stdout, stderr=sys.stderr)
if ret != 0:
raise SquashfsError("'%s' exited with error (%d)" %
(string.join(args, " "), ret))
@@ -518,7 +518,8 @@ class ExtDiskMount(DiskMount):
rc = subprocess.call([self.mkfscmd,
"-F", "-L", self.fslabel,
"-m", "1", "-b", str(self.blocksize),
- self.disk.device])
+ self.disk.device], stdout=sys.stdout,
+ stderr=sys.stderr)
# str(self.disk.size / self.blocksize)])
if rc != 0:
raise MountError("Error creating %s filesystem on disk %s" %
(self.fstype,self.disk.device))
@@ -534,7 +535,8 @@ class ExtDiskMount(DiskMount):
self.uuid = self.__parse_field(out, "Filesystem UUID")
logging.debug("Tuning filesystem on %s" % self.disk.device)
subprocess.call([self.tune2fs, "-c0", "-i0", "-Odir_index",
- "-ouser_xattr,acl", self.disk.device])
+ "-ouser_xattr,acl", self.disk.device],
+ stdout=sys.stdout, stderr=sys.stderr)
def __resize_filesystem(self, size = None):
current_size = os.stat(self.disk.lofile)[stat.ST_SIZE]
@@ -571,7 +573,8 @@ class ExtDiskMount(DiskMount):
def __fsck(self):
logging.debug("Checking filesystem %s" % self.disk.lofile)
- subprocess.call(["/sbin/e2fsck", "-f", "-y", self.disk.lofile])
+ subprocess.call(["/sbin/e2fsck", "-f", "-y", self.disk.lofile],
+ stdout=sys.stdout, stderr=sys.stderr)
def __get_size_from_filesystem(self):
dev_null = os.open("/dev/null", os.O_WRONLY)
diff --git a/mic/imgcreate/jffs2.py b/mic/imgcreate/jffs2.py
index 61ae02a..9673089 100644
--- a/mic/imgcreate/jffs2.py
+++ b/mic/imgcreate/jffs2.py
@@ -39,7 +39,7 @@ class Jffs2ImageCreator(LoopImageCreator):
def _genjffs2img(self):
self.img_done = True
- rc = subprocess.call([self._mkjffs2fs, "-e", "128", "-l", "-n", "-r",
self._instroot, "-o", self._outdir + "/" + self._img_name])
+ rc = subprocess.call([self._mkjffs2fs, "-e", "128", "-l", "-n", "-r",
self._instroot, "-o", self._outdir + "/" + self._img_name], stdout=sys.stdout,
stderr=sys.stderr)
if rc:
raise CreatorError("Failed to make jffs2 image")
diff --git a/mic/imgcreate/live.py b/mic/imgcreate/live.py
index fa01f15..3c70982 100644
--- a/mic/imgcreate/live.py
+++ b/mic/imgcreate/live.py
@@ -316,7 +316,7 @@ class LiveImageCreatorBase(LoopImageCreator):
implantisomd5 = ""
return
- subprocess.call([implantisomd5, iso])
+ subprocess.call([implantisomd5, iso], stdout=sys.stdout,
stderr=sys.stderr)
def _stage_final_image(self):
try:
@@ -1064,13 +1064,13 @@ class LiveUSBImageCreator(LiveImageCreator):
args = [mkfscmd, "-F", "-j", homefile]
else:
args = [mkfscmd, homefile]
- rc = subprocess.call(args)
+ rc = subprocess.call(args, stdout=sys.stdout,
stderr=sys.stderr)
if rc:
raise CreatorError("Can't mke2fs home file")
if fstype == "ext2" or fstype == "ext3":
tune2fs = find_binary_path("tune2fs")
args = [tune2fs, "-c0", "-i0", "-ouser_xattr,acl",
homefile]
- rc = subprocess.call(args)
+ rc = subprocess.call(args, stdout=sys.stdout,
stderr=sys.stderr)
if rc:
raise CreatorError("Can't tune2fs home file")
diff --git a/mic/imgcreate/ubi.py b/mic/imgcreate/ubi.py
index 3303738..4c135f0 100644
--- a/mic/imgcreate/ubi.py
+++ b/mic/imgcreate/ubi.py
@@ -60,10 +60,10 @@ class UbiImageCreator(LoopImageCreator):
self._writeUbiConf(configfile, baseimage)
max_leb_cnt = 2047
try:
- rc = subprocess.call([self._mkubifs, "-m", "2048", "-e", "129024",
"-c", str(max_leb_cnt), "-R", "4MiB", "-r", self._instroot, "-v", "-o",
baseimage])
+ rc = subprocess.call([self._mkubifs, "-m", "2048", "-e", "129024",
"-c", str(max_leb_cnt), "-R", "4MiB", "-r", self._instroot, "-v", "-o",
baseimage], stdout=sys.stdout, stderr=sys.stderr)
if rc:
raise CreatorError("Failed to make ubifs")
- rc = subprocess.call([self._ubinize, "-o", self._outdir + "/" +
self._img_name, "-m", "2048", "-p", "128KiB", "-s", "512", configfile])
+ rc = subprocess.call([self._ubinize, "-o", self._outdir + "/" +
self._img_name, "-m", "2048", "-p", "128KiB", "-s", "512", configfile],
stdout=sys.stdout, stderr=sys.stderr)
if rc:
raise CreatorError("Failed to generate ubi image")
finally:
_______________________________________________
MeeGo-distribution-tools mailing list
[email protected]
http://lists.meego.com/listinfo/meego-distribution-tools