Example #1
0
 def __init__(self):
     self.clVars = None
     self.clTempl = None
     self.listDisksOptions = []
     self.listBindsOptions = []
     self.listSwapsOptions = []
     self.startMessage = ""
     self.lenStartMessage = 0
     self.stdoutHide = None
     self.stderrHide = None
     # refresh information about LVM
     refreshLVM()
     # refresh information about device in udevadm info
     refreshUdev()
Example #2
0
    def setupSystem(self,variables):
        self.initVars(variables)
        target = None
        setupType = self.clVars.Get('cl_setup',humanreadable=True)

        if setupType:
            self.startTask((_("%s are being configured")%
                           setupType).capitalize(),progress=True)
        else:
            self.startTask(_("System configuration"),progress=True)
        refreshLVM()
        res = self.applyTemplatesStartup()
        self.endTask()
        if setupType and self.clVars.Get('cl_setup') == 'network':
            pass
        if not setupType or self.clVars.Get('cl_setup') == 'video':
            self.setupVideo()
        if setupType and self.clVars.Get('cl_setup') == 'users':
            pass
        if self.clVars.Get('cl_setup') == 'boot' and \
            self.clVars.Get('os_root_type') != 'livecd':
            target = self.clVars.Get('cl_image')
            if self.clVars.Get('os_install_mbr'):
                self.startTask(_("Installing the bootloader"))
                self.prepareBoot(target)
                self.endTask()
            root_dev = self.clVars.Select('os_disk_parent',
                                   where='os_disk_mount',
                                   eq='/',limit=1)
            if root_dev:
                self.startTask(_("Changing the I/O scheduler"))
                try:
                    schedpath = ("/sys%s/queue/scheduler"%
                      (getUdevDeviceInfo(name=root_dev).get('DEVPATH','')))
                    if path.exists(schedpath):
                        open(schedpath,'w').write(
                            self.clVars.Get('os_install_kernel_scheduler'))
                    self.endTask()
                except:
                    self.printERROR(_("Unable to change the I/O scheduler"))
                    pass
        return True