def applyRequest(self):

        pt = self.partitionType()

        if not pt.mountpoint: # do nothing
            return

        source = self.partition().getPath()
        target = consts.target_dir + pt.mountpoint
        filesystem = pt.filesystem.name()

        if not os.path.isdir(target):
            os.mkdir(target)

        # first umount!
        mount.umount(target)

        mount.mount(source, target, filesystem)
        
        mtab_entry = "%s %s %s rw 0 0\n" % (source,
                                            target,
                                            filesystem)
        open("/etc/mtab", "a").write(mtab_entry)
        #FIXME: use logging system
        print mtab_entry

        
        PartRequest.applyRequest(self)
Beispiel #2
0
 def slotReboot(self):
     
     try:
         mount.umount(ctx.consts.target_dir + "/home")
     except:
         pass
     mount.umount(ctx.consts.target_dir)
     reboot.fastreboot()
Beispiel #3
0
def is_windows_boot(partition_path, file_system):
    m_dir = "/tmp/pcheck"
    if not os.path.isdir(m_dir):
        os.makedirs(m_dir)

    try:
        mount.mount(partition_path, m_dir, file_system)
    except:
        return False

    if os.path.exists(os.path.join(m_dir, 'boot.ini')):
        mount.umount(m_dir)
        return True
    else:
        mount.umount(m_dir)
        return False
Beispiel #4
0
    def execute(self):

        ctx.screens.nextDisabled()
        ctx.screens.prevDisabled()

        self.info.show()
        self.info.setAlignment(QLabel.AlignCenter)

#        cmd = yali.sysutils.find_executable("reboot")
#        print cmd
#        os.system(cmd)
        try:
            mount.umount(ctx.consts.target_dir + "/home")
        except:
            pass
        mount.umount(ctx.consts.target_dir)
        reboot.fastreboot()
Beispiel #5
0
    def execute(self):

        ctx.screens.disableNext()
        ctx.screens.disablePrev()

        self.info.show()
        self.info.setAlignment(QLabel.AlignCenter)

#        cmd = yali.sysutils.find_executable("reboot")
#        print cmd
#        os.system(cmd)
        try:
            #FIXME: this is a dirty and temporary workaround.. will be removed.
            os.chmod(ctx.consts.target_dir + "/var/tmp", 01777)
            mount.umount(ctx.consts.target_dir + "/home")
        except:
            pass

        mount.umount(ctx.consts.target_dir)
        reboot.fastreboot()
Beispiel #6
0
def is_windows_boot(partition_path, file_system):
    m_dir = "/tmp/pcheck"
    if not os.path.isdir(m_dir):
        os.makedirs(m_dir)

    try:
        if file_system == "fat32":
            mount.mount(partition_path, m_dir, "vfat")
        else:
            mount.mount(partition_path, m_dir, file_system)
    except:
        return False

    exist = lambda f: os.path.exists(os.path.join(m_dir, f))

    if exist("boot.ini") or exist("command.com"):
        mount.umount(m_dir)
        return True
    else:
        mount.umount(m_dir)
        return False
Beispiel #7
0
    def execute(self):

        ctx.screens.disableNext()

        self.info.show()
        self.info.setAlignment(QLabel.AlignCenter)

        # FIXME: this is a dirty and temporary workaround.. will be removed.
        #        os.chmod(ctx.consts.target_dir + "/var/tmp", 01777)

        # remove cd...
        w = RebootWidget(self)
        self.dialog = WarningDialog(w, self)
        self.dialog.exec_loop()

        try:
            mount.umount(ctx.consts.target_dir + "/home")
        except:
            pass

        mount.umount(ctx.consts.target_dir)
        reboot.fastreboot()
Beispiel #8
0
def umount_if_necessary(folder):
	if folder.strip() != '':
		return umount(folder)
	return True
Beispiel #9
0
 def test_umount(self):
     self.test_mount()
     mount.umount(self.target)
     self.assertFalse(os.path.exists(os.path.join(self.target, self.test_file)))