summaryrefslogtreecommitdiffstats
path: root/livecd.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2007-03-28 22:05:23 +0000
committerJeremy Katz <katzj@redhat.com>2007-03-28 22:05:23 +0000
commit3a2ab111dadebb0b987d9a3afde475aefe252305 (patch)
treedbdd181c541ac32a24907b774d6f26bf4820d2bc /livecd.py
parent0cb2b91246aa69aab979d020bf37761a95e738f2 (diff)
downloadanaconda-3a2ab111dadebb0b987d9a3afde475aefe252305.tar.gz
anaconda-3a2ab111dadebb0b987d9a3afde475aefe252305.tar.xz
anaconda-3a2ab111dadebb0b987d9a3afde475aefe252305.zip
2007-03-28 Jeremy Katz <katzj@redhat.com>
* livecd.py (LiveCDCopyBackend.doRepoSetup): Check that we have sufficient disk space for the os.img. (#230943) * backend.py (doRepoSetup): If repo setup fails, go back.
Diffstat (limited to 'livecd.py')
-rw-r--r--livecd.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/livecd.py b/livecd.py
index 91fd20c35..3d1e02815 100644
--- a/livecd.py
+++ b/livecd.py
@@ -284,6 +284,31 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
%(productName,), type = "custom",
custom_icon="error",
custom_buttons=[_("Exit installer")])
+ isys.umount("/mnt/installer/squashed")
+ isys.unlosetup("/dev/loop4")
+ sys.exit(1)
+
+ # ensure there's enough space on the rootfs
+ # FIXME: really, this should be in the general sanity checking, but
+ # trying to weave that in is a little tricky at present.
+ ossize = os.stat("/mnt/installer/squashed/os.img")[stat.ST_SIZE] / 1024.0 / 1024.0
+ slash = anaconda.id.partitions.getRequestByMountPoint("/")
+ if slash and \
+ slash.getActualSize(anaconda.id.partitions, anaconda.id.diskset) < ossize:
+ rc = anaconda.intf.messageWindow(_("Error"),
+ ("The root filesystem you created is "
+ "not large enough for this live "
+ "image."), type = "custom",
+ custom_icon = "error",
+ custom_buttons=[_("Back"),
+ _("Exit installer")])
+ if rc == 0:
+ isys.umount("/mnt/installer/squashed")
+ isys.unlosetup("/dev/loop4")
+ return DISPATCH_BACK
+ else:
+ sys.exit(1)
+
# package/group selection doesn't apply for this backend
def groupExists(self, group):