We no longer need to copy the install.img over and lochangefd to it.
Since there is no more install.img, this whole process is pointless and all
its support code can come out.
---
pyanaconda/backend.py | 77 ----------------------------------------
pyanaconda/isys/__init__.py | 10 -----
pyanaconda/isys/isys.c | 22 -----------
pyanaconda/storage/__init__.py | 30 ---------------
pyanaconda/yuminstall.py | 9 -----
5 files changed, 0 insertions(+), 148 deletions(-)
- def mountInstallImage(self, anaconda, installimg):
- if self._loopbackFile and os.path.exists(self._loopbackFile):
- return
-
- # Copy the install.img to the filesystem and switch loopback devices
- # to there. Otherwise we won't be able to unmount and swap media.
- free = anaconda.storage.fsFreeSpace
- self._loopbackFile = "%s/%s/rhinstall-install.img" % (anaconda.rootPath,
- free[-1][0])
- try:
- log.info("transferring install image to install target")
- win = anaconda.intf.waitWindow(_("Copying File"),
- _("Transferring install image to hard drive"))
- shutil.copyfile(installimg, self._loopbackFile)
- win.pop()
- except Exception, e:
- if win:
- win.pop()
-
- log.critical("error transferring install.img: %s" %(e,))
-
- if isinstance(e, IOError) and e.errno == 5:
- msg = _("An error occurred transferring the install image "
- "to your hard drive. This is often cause by "
- "damaged or low quality media.")
- else:
- msg = _("An error occurred transferring the install image "
- "to your hard drive. You are probably out of disk "
- "space.")
-
- anaconda.intf.messageWindow(_("Error"), msg)
- try:
- os.unlink(self._loopbackFile)
- except:
- pass
-
- return 1
-
- # Figure out which loopback device is in use for lochangefd.
- dev = "/dev/loop0"
- f = open("/proc/mounts", "r")
- lines = f.readlines()
- f.close()
-
- for line in lines:
- parts = line.split()
- if parts[1] == "/mnt/runtime":
- dev = parts[0]
- break
-
- isys.lochangefd(dev, self._loopbackFile)
- if os.path.ismount("/mnt/stage2"):
- isys.umount("/mnt/stage2")
-
- def removeInstallImage(self):
- if self._loopbackFile:
- try:
- os.unlink(self._loopbackFile)
- except SystemError:
- pass
-
- def freetmp(self, anaconda):
- # installs that don't use /mnt/stage2 hold the install.img on
- # a tmpfs, free this ram if things are tight.
- stage2img = "/tmp/install.img"
- if os.path.exists(stage2img):
- # free up /tmp for more memory before yum is called,
- if self.mountInstallImage(anaconda, stage2img):
- return DISPATCH_BACK
- try:
- os.unlink(stage2img)
- except SystemError:
- log.info("clearing /tmp failed")
- return DISPATCH_BACK
-
def kernelVersionList(self, rootPath="/"):
return []
@@ -1761,32 +1757,6 @@ class FSSet(object):
# just write duplicates back out post-install
self.preserveLines.append(line)
- def fsFreeSpace(self, chroot=None):
- if not chroot:
- chroot = self.rootpath
-
- space = []
- for device in self.devices:
- if not device.format.mountable or
- not device.format.mountpoint or
- not device.format.status:
- continue
-
- path = "%s/%s" % (chroot, device.format.mountpoint)
-
- ST_RDONLY = 1 # this should be in python's posix module
- if not os.path.exists(path) or os.statvfs(path)[statvfs.F_FLAG] & ST_RDONLY:
- continue
-
- try:
- space.append((device.format.mountpoint,
- isys.pathSpaceAvailable(path)))
- except SystemError:
- log.error("failed to calculate free space for %s" % (device.format.mountpoint,))
-
- space.sort(key=lambda s: s[1])
- return space
-
def mtab(self):
format = "%s %s %s %s 0 0
"
mtab = ""
diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index 6c0ddda..edb2bf0 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -933,12 +933,6 @@ class AnacondaYum(YumSorter):
mkeys = self.tsInfo.reqmedia.keys()
mkeys.sort(mediasort)
- stage2img = "%s/images/install.img" % self.tree
- if os.path.exists(stage2img):
- if self.anaconda.backend.mountInstallImage(self.anaco nda, stage2img):
- self.anaconda.storage.umountFilesystems()
- return DISPATCH_BACK
-
for i in mkeys:
self.tsInfo.curmedia = i
if i > 0:
@@ -1170,8 +1164,6 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
if not anaconda.mediaDevice and os.path.ismount(self.ayum.tree):
isys.umount(self.ayum.tree)
- anaconda.backend.removeInstallImage()
-
# clean up rpmdb locks so that kickstart %post scripts aren't
# unhappy (#496961)
iutil.resetRpmDb(anaconda.rootPath)
@@ -1188,7 +1180,6 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
iutil.resetRpmDb(anaconda.rootPath)