[Fedora-livecd-list] imgcreate/fs.py
imgcreate/fs.py |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 5c0279b8e95682d20526a5ba36fc4eaab81d2198 Author: Jeremy Katz <[EMAIL PROTECTED]> Date: Thu Jan 31 13:47:24 2008 -0500 Only remove dirs if we are successful with the unmount (#430606) diff --git a/imgcreate/fs.py b/imgcreate/fs.py index 0591f1c..9ca3a3e 100644 --- a/imgcreate/fs.py +++ b/imgcreate/fs.py @@ -104,9 +104,10 @@ class LoopbackMount: def unmount(self): if self.mounted: rc = subprocess.call(["/bin/umount", self.mountdir]) -self.mounted = False +if rc == 0: +self.mounted = False -if self.rmdir: +if self.rmdir and not self.mounted: try: os.rmdir(self.mountdir) except OSError, e: -- Fedora-livecd-list mailing list Fedora-livecd-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list
[Fedora-livecd-list] imgcreate/fs.py
imgcreate/fs.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 04298ddc7bb8f0aef55a54b6c2367a6387c8100a Author: Jeremy Katz <[EMAIL PROTECTED]> Date: Tue Feb 26 22:27:45 2008 -0500 Temporarily use 128 byte inodes to avoid hitting #434893 256 byte inodes are currently causing the loss of xattrs on resize. esandeen is working on a fix, but to keep things from being broken for now, let's just fall back diff --git a/imgcreate/fs.py b/imgcreate/fs.py index 9ca3a3e..2dafd4b 100644 --- a/imgcreate/fs.py +++ b/imgcreate/fs.py @@ -201,7 +201,7 @@ class SparseExtLoopbackMount(SparseLoopbackMount): def __format_filesystem(self): rc = subprocess.call(["/sbin/mkfs." + self.fstype, "-F", "-L", self.fslabel, - "-m", "1", "-b", str(self.blocksize), + "-m", "1", "-b", str(self.blocksize), "-I128", self.lofile, str(self.size / self.blocksize)]) if rc != 0: -- Fedora-livecd-list mailing list Fedora-livecd-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list
[Fedora-livecd-list] imgcreate/fs.py
imgcreate/fs.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e4d5d2b690db07b3656ca85a3262f135c559c3d9 Author: Jeremy Katz <[EMAIL PROTECTED]> Date: Tue Mar 4 09:21:30 2008 -0500 Revert "Temporarily use 128 byte inodes to avoid hitting #434893" This reverts commit 04298ddc7bb8f0aef55a54b6c2367a6387c8100a. Note that if you have a version of e2fsprogs >= 1.40.4-7 and < 1.40.7-2, you will get missing xattrs from files during the resize operation. Thus, an upgrade is recommended :) diff --git a/imgcreate/fs.py b/imgcreate/fs.py index 2dafd4b..9ca3a3e 100644 --- a/imgcreate/fs.py +++ b/imgcreate/fs.py @@ -201,7 +201,7 @@ class SparseExtLoopbackMount(SparseLoopbackMount): def __format_filesystem(self): rc = subprocess.call(["/sbin/mkfs." + self.fstype, "-F", "-L", self.fslabel, - "-m", "1", "-b", str(self.blocksize), "-I128", + "-m", "1", "-b", str(self.blocksize), self.lofile, str(self.size / self.blocksize)]) if rc != 0: -- Fedora-livecd-list mailing list Fedora-livecd-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list
[Fedora-livecd-list] imgcreate/fs.py
imgcreate/fs.py |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 21609df66b47bf1ae2d6e930ed7a994c59a9aa19 Author: Jeremy Katz <[EMAIL PROTECTED]> Date: Thu Apr 10 16:35:51 2008 -0400 Fix creation of minimal sized snapshot Creating the minimal sized snapshot has been broken for a while which then breaks the ability to do an install on something with only 4 gigs of flash like the eeePC diff --git a/imgcreate/fs.py b/imgcreate/fs.py index 9ca3a3e..98c0db4 100644 --- a/imgcreate/fs.py +++ b/imgcreate/fs.py @@ -285,8 +285,8 @@ class SparseExtLoopbackMount(SparseLoopbackMount): minsize = self.__resize_to_minimal() self.truncate(minsize) - -return self.resize(size) +self.resize(size) +return minsize class DeviceMapperSnapshot(object): def __init__(self, imgloop, cowloop): @@ -299,7 +299,7 @@ class DeviceMapperSnapshot(object): def get_path(self): if self.__name is None: return None -return "/dev/mapper" + self.__name +return os.path.join("/dev/mapper", self.__name) path = property(get_path) def create(self): -- Fedora-livecd-list mailing list Fedora-livecd-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list
[Fedora-livecd-list] imgcreate/fs.py
imgcreate/fs.py | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) New commits: commit 6fd3e938dd9c7f36eb643db42b60e259f0834190 Author: Jeremy Katz <[EMAIL PROTECTED]> Date: Wed Aug 6 11:11:30 2008 -0400 Fix up a few more problems from the refactor-mount patch * Make sure that methods return the values they used to * When resizing to the minimal image, we need to go back to the full size otherwise, live images don't work diff --git a/imgcreate/fs.py b/imgcreate/fs.py index 4d8f87a..4a698e8 100644 --- a/imgcreate/fs.py +++ b/imgcreate/fs.py @@ -156,7 +156,7 @@ class SparseExtLoopbackMount(SparseLoopbackMount): self.diskmount.disk.create() def resize(self, size = None): -self.diskmount.__resize_filesystem(size) +return self.diskmount.__resize_filesystem(size) def mount(self): self.diskmount.mount() @@ -165,10 +165,10 @@ class SparseExtLoopbackMount(SparseLoopbackMount): self.extdiskmount.__fsck() def __get_size_from_filesystem(self): -self.diskmount.__get_size_from_filesystem() +return self.diskmount.__get_size_from_filesystem() def __resize_to_minimal(self): -self.diskmount.__resize_to_minimal() +return self.diskmount.__resize_to_minimal() def resparse(self, size = None): return self.diskmount.resparse(size) @@ -386,13 +386,13 @@ class ExtDiskMount(DiskMount): current_size = os.stat(self.disk.lofile)[stat.ST_SIZE] if size is None: -size = self.size +size = self.disk.size if size == current_size: return if size > current_size: -self.expand(size) +self.disk.expand(size) self.__fsck() @@ -459,6 +459,7 @@ class ExtDiskMount(DiskMount): self.cleanup() minsize = self.__resize_to_minimal() self.disk.truncate(minsize) +self.__resize_filesystem(size) return minsize class DeviceMapperSnapshot(object): -- Fedora-livecd-list mailing list Fedora-livecd-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list
[Fedora-livecd-list] imgcreate/fs.py
imgcreate/fs.py |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) New commits: commit 94d23f008f8f42e0cf93cd8b6cc0a4381d408dfb Author: Jeremy Katz Date: Mon Jul 6 14:51:06 2009 -0400 Also, don't lose resize2fs output (per request of sandeen) diff --git a/imgcreate/fs.py b/imgcreate/fs.py index ae79b1c..563b7a9 100644 --- a/imgcreate/fs.py +++ b/imgcreate/fs.py @@ -61,17 +61,12 @@ def resize2fs(fs, size = None, minimal = False): os.close(fd) subprocess.call(["/sbin/e2image", "-r", fs, saved_image]) -dev_null = os.open("/dev/null", os.O_WRONLY) args = ["/sbin/resize2fs", fs] if minimal: args.append("-M") else: args.append("%sK" %(size / 1024,)) -try: -ret = subprocess.call(args, stdout = dev_null, stderr = dev_null) -finally: -os.close(dev_null) - +ret = subprocess.call(args) if ret != 0: return ret -- Fedora-livecd-list mailing list Fedora-livecd-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list
[Fedora-livecd-list] imgcreate/fs.py imgcreate/live.py
imgcreate/fs.py |7 +-- imgcreate/live.py |5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) New commits: commit 1d215ebcf584b2bc19dece88b7f75944de2ad3f0 Author: Jeremy Katz Date: Wed Aug 19 16:47:24 2009 -0400 Use resize2fs -M (minimal) more We were keeping track of the minimal size and then passing that again. Just use resize2fs -M again for this case diff --git a/imgcreate/fs.py b/imgcreate/fs.py index 31e5ca3..b8d61db 100644 --- a/imgcreate/fs.py +++ b/imgcreate/fs.py @@ -553,7 +553,7 @@ class DeviceMapperSnapshot(object): except ValueError: raise SnapshotError("Failed to parse dmsetup status: " + out) -def create_image_minimizer(path, image, minimal_size): +def create_image_minimizer(path, image, target_size = None): """ Builds a copy-on-write image which can be used to create a device-mapper snapshot of an image where @@ -580,7 +580,10 @@ def create_image_minimizer(path, image, minimal_size): try: snapshot.create() -resize2fs(snapshot.path, minimal_size) +if target_size is not None: +resize2fs(snapshot.path, target_size) +else: +resize2fs(snapshot.path, minimal = True) cow_used = snapshot.get_cow_used() finally: diff --git a/imgcreate/live.py b/imgcreate/live.py index 756097b..528840d 100644 --- a/imgcreate/live.py +++ b/imgcreate/live.py @@ -271,11 +271,10 @@ class LiveImageCreatorBase(LoopImageCreator): try: makedirs(self.__ensure_isodir() + "/LiveOS") -minimal_size = self._resparse() +self._resparse() if not self.skip_minimize: -create_image_minimizer(self.__isodir + "/LiveOS/osmin.img", - self._image, minimal_size) +create_image_minimizer(self.__isodir + "/LiveOS/osmin.img", self._image) if self.skip_compression: shutil.move(self._image, self.__isodir + "/LiveOS/ext3fs.img") -- Fedora-livecd-list mailing list Fedora-livecd-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list