예제 #1
0
파일: urlinstall.py 프로젝트: hocks/core
class UrlInstallMethod(InstallMethod):
    def badPackageError(self, pkgname):
        return _(
            "The file %s cannot be opened.  This is due to a missing "
            "file or perhaps a corrupt package.  Please verify your "
            "mirror contains all required packages, and try using a "
            "different one.\n\n"
            "If you reboot, your system will be left in an inconsistent "
            "state that will likely require reinstallation.\n\n") % pkgname

    def systemUnmounted(self):
        if self.loopbackFile:
            isys.makeDevInode("loop0", "/tmp/loop")
            isys.lochangefd("/tmp/loop",
                            "%s/images/stage2.img" % (self.tree, ))
            self.loopbackFile = None

    def systemMounted(self, fsset, chroot):
        if self.tree is None:
            return

        self.loopbackFile = "%s%s%s" % (chroot,
                                        fsset.filesystemSpace(chroot)[0][0],
                                        "/rhinstall-stage2.img")

        try:
            win = self.waitWindow(
                _("Copying File"),
                _("Transferring install image to hard drive..."))
            shutil.copyfile("%s/images/stage2.img" % (self.tree, ),
                            self.loopbackFile)
            win.pop()
        except Exception, e:
            if win:
                win.pop()

            log.critical("error transferring stage2.img: %s" % (e, ))
            self.messageWindow(
                _("Error"),
                _("An error occurred transferring the install image "
                  "to your hard drive. You are probably out of disk "
                  "space."))
            os.unlink(self.loopbackFile)
            return 1

        isys.makeDevInode("loop0", "/tmp/loop")
        isys.lochangefd("/tmp/loop", self.loopbackFile)
예제 #2
0
파일: urlinstall.py 프로젝트: hocks/core
 def systemUnmounted(self):
     if self.loopbackFile:
         isys.makeDevInode("loop0", "/tmp/loop")
         isys.lochangefd("/tmp/loop",
                         "%s/images/stage2.img" % (self.tree, ))
         self.loopbackFile = None
예제 #3
0
파일: urlinstall.py 프로젝트: Sudoka/base
    def systemUnmounted(self):
	if self.loopbackFile:
	    isys.makeDevInode("loop0", "/tmp/loop")
	    isys.lochangefd("/tmp/loop", 
			"%s/images/stage2.img" % (self.tree,))
	    self.loopbackFile = None
			    self.loopbackFile)
            win.pop()
	except Exception, e:
            if win:
                win.pop()

            log.critical("error transferring stage2.img: %s" %(e,))
	    self.messageWindow(_("Error"),
		    _("An error occurred transferring the install image "
		      "to your hard drive. You are probably out of disk "
		      "space."))
	    os.unlink(self.loopbackFile)
	    return 1

	isys.makeDevInode("loop0", "/tmp/loop")
	isys.lochangefd("/tmp/loop", self.loopbackFile)

    def getFilename(self, filename, callback=None, destdir=None, retry=1):
	return self.tree + "/" + filename

    def switchMedia(self, mediano, filename=""):
        log.info("switching from CD %s to %s for %s" %(self.currentMedia, mediano, filename))
        if mediano in self.currentMedia:
            return
        if os.access("/mnt/source/.discinfo", os.R_OK):
            f = open("/mnt/source/.discinfo")
            timestamp = f.readline().strip()
            f.close()
        else:
            timestamp = self.timestamp
예제 #5
0
                        "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

        isys.lochangefd("/dev/loop0", 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):
예제 #6
0
			    self.loopbackFile)
            win.pop()
	except Exception, e:
            if win:
                win.pop()

            log.critical("error transferring stage2.img: %s" %(e,))
	    self.messageWindow(_("Error"),
		    _("An error occurred transferring the install image "
		      "to your hard drive. You are probably out of disk "
		      "space."))
	    os.unlink(self.loopbackFile)
	    return 1

	isys.makeDevInode("loop0", "/tmp/loop")
	isys.lochangefd("/tmp/loop", self.loopbackFile)

    def getFilename(self, filename, callback=None, destdir=None, retry=1):
	return self.tree + "/" + filename

    def switchMedia(self, mediano, filename=""):
        log.info("switching from CD %s to %s for %s" %(self.currentMedia, mediano, filename))
        if mediano in self.currentMedia:
            return
        if os.access("/mnt/source/.discinfo", os.R_OK):
            f = open("/mnt/source/.discinfo")
            timestamp = f.readline().strip()
            f.close()
        else:
            timestamp = self.timestamp
예제 #7
0
    def systemUnmounted(self):
	if self.loopbackFile:
	    isys.makeDevInode("loop0", "/tmp/loop")
	    isys.lochangefd("/tmp/loop", 
			"%s/%s/base/stage2.img" % (self.tree, productPath))
	    self.loopbackFile = None