Ejemplo n.º 1
0
    def mountMedia(self, cdNum):
        if self.mediaIsMounted:
            raise SystemError, "trying to mount already-mounted iso image!"

        self.mountDirectory()

        retry = True
        while retry:
            try:
                isoImage = self.isoDir + '/' + self.path + '/' + self.discImages[cdNum]

                isys.makeDevInode("loop3", "/tmp/loop3")
                isys.losetup("/tmp/loop3", isoImage, readOnly = 1)

                isys.mount("loop3", self.tree, fstype = 'iso9660', readOnly = 1);
                self.mediaIsMounted = cdNum

                retry = False
            except:
                ans = self.messageWindow( _("Missing ISO 9660 Image"),
                                          _("The installer has tried to mount "
                                            "image #%s, but cannot find it on "
                                            "the hard drive.\n\n"
                                            "Please copy this image to the "
                                            "drive and click Retry. Click Reboot "
                                            " to abort the installation.")
                                            % (cdNum,), type="custom",
	                                    custom_icon="warning",
                                            custom_buttons=[_("_Reboot"),
	                                                    _("Re_try")])
                if ans == 0:
                    sys.exit(0)
                elif ans == 1:
                    self.discImages = findIsoImages(self.isoPath, self.messageWindow)
Ejemplo n.º 2
0
    def __init__(self, device, type, path, messageWindow, rootPath):
        InstallMethod.__init__(self, rootPath)
        self.device = device
        self.path = path
        self.fstype = type
        self.fnames = {}
        self.isoDirIsMounted = 0
        self.mediaIsMounted = 0
        self.messageWindow = messageWindow

        # Go ahead and poke through the directory looking for interesting
        # iso images
        self.mountDirectory()
        self.discImages = findIsoImages(self.isoDir + '/' + self.path,
                                        messageWindow)
        self.umountDirectory()
Ejemplo n.º 3
0
    def __init__(self, method, rootPath, intf):
        """@param method hd://device:fstype:/path"""
        method = method[5:]
        device = method[0:method.index(":")]
        tmpmethod = method[method.index(":") + 1:]
        fstype = tmpmethod[0:tmpmethod.index("/")]
        path = tmpmethod[tmpmethod.index("/") + 1:]

	ImageInstallMethod.__init__(self, method, rootPath, intf)

	self.device = device
	self.path = path
	self.fstype = fstype
        self.isoDirIsMounted = 0
        self.mediaIsMounted = 0
	self.messageWindow = intf.messageWindow
        self.currentMedia = []
        self.tree = "/tmp/isomedia/"

        # Mount the partition containing the ISO images just long enough for
        # us to build up a list of all the path names.
	self.mountDirectory()
	self.discImages = findIsoImages(self.isoDir + '/' + self.path, self.messageWindow)
        self.umountDirectory()