Ejemplo n.º 1
0
    def __init__(self, *args):
        QtGui.QWidget.__init__(self,None)
        self.ui = Ui_BootLoaderWidget()
        self.ui.setupUi(self)

        self.ui.installFirstMBR.setChecked(True)

        # initialize all storage devices
        if not yali4.storage.init_devices():
            raise GUIException, _("Can't find a storage device!")

        if len(yali4.storage.devices) > 1:
            self.device_list_state = True
            # fill device list
            for dev in yali4.storage.devices:
                DeviceItem(self.ui.device_list, dev)
            # select the first disk by default
            self.ui.device_list.setCurrentRow(0)
            # be sure first is selected device
            self.device = self.ui.device_list.item(0).getDevice()
        else:
            # don't show device list if we have just one disk
            self.ui.installMBR.hide()
            self.device_list_state = False
            self.ui.device_list.hide()
            self.ui.select_disk_label.hide()

            self.device = yali4.storage.devices[0]

        self.connect(self.ui.device_list, SIGNAL("currentItemChanged(QListWidgetItem*,QListWidgetItem*)"),
                     self.slotDeviceChanged)
        self.connect(self.ui.device_list, SIGNAL("itemClicked(QListWidgetItem*)"),
                     self.slotSelect)
Ejemplo n.º 2
0
    def __init__(self, *args):
        QtGui.QWidget.__init__(self, None)
        self.ui = Ui_BootLoaderWidget()
        self.ui.setupUi(self)

        self.ui.installFirstMBR.setChecked(True)

        # initialize all storage devices
        if not yali4.storage.initDevices():
            raise GUIException, _("Can't find a storage device!")

        # fill device list
        for dev in yali4.storage.devices:
            DeviceItem(self.ui.device_list, dev)
        # select the first disk by default
        self.ui.device_list.setCurrentRow(0)
        # be sure first is selected device
        self.device = self.ui.device_list.item(0).getDevice()

        if len(yali4.storage.devices) < 1:
            # don't show device list if we have just one disk
            self.ui.installMBR.hide()
            self.ui.device_list.hide()

            self.device = yali4.storage.devices[0]

        self.connect(
            self.ui.device_list,
            SIGNAL("currentItemChanged(QListWidgetItem*,QListWidgetItem*)"),
            self.slotDeviceChanged)
        self.connect(self.ui.installFirstMBR, SIGNAL("clicked()"),
                     self.slotDisableList)
        self.connect(self.ui.installPart, SIGNAL("clicked()"),
                     self.slotDisableList)
        self.connect(self.ui.noInstall, SIGNAL("clicked()"),
                     self.slotDisableList)
        self.connect(self.ui.installMBR, SIGNAL("clicked()"),
                     self.slotEnableList)
        self.connect(self.ui.device_list,
                     SIGNAL("itemClicked(QListWidgetItem*)"), self.slotSelect)
Ejemplo n.º 3
0
class Widget(QtGui.QWidget, ScreenWidget):
    title = _('Bootloader Choice')
    desc = _('Configure the system boot...')
    icon = "iconBootloader"
    help = _('''
<font size="+2">Boot loader setup</font>
<font size="+1">
<p>
Pardus 2009.2 uses a boot manager called GRUB to start the operating system you choose.
</p>
<p>If there are multiple operating systems in your computer, you can start the one 
you like using GRUB. Installing GRUB to the beginning of the boot disk is the advised 
option to avoid boot problems.  If you are sure you know what you are doing, 
you can change boot loader settings.
</p>
<p>
Please refer to Pardus Installing and Using 
Guide for more information about GRUB boot 
loader.
</p>
</font>
''')

    def __init__(self, *args):
        QtGui.QWidget.__init__(self,None)
        self.ui = Ui_BootLoaderWidget()
        self.ui.setupUi(self)

        self.ui.installFirstMBR.setChecked(True)

        # initialize all storage devices
        if not yali4.storage.initDevices():
            raise GUIException, _("Can't find a storage device!")

        # fill device list
        for dev in yali4.storage.devices:
            DeviceItem(self.ui.device_list, dev)
        # select the first disk by default
        self.ui.device_list.setCurrentRow(0)
        # be sure first is selected device
        self.device = self.ui.device_list.item(0).getDevice()

        if len(yali4.storage.devices) < 1:
            # don't show device list if we have just one disk
            self.ui.installMBR.hide()
            self.ui.device_list.hide()

            self.device = yali4.storage.devices[0]

        self.connect(self.ui.device_list, SIGNAL("currentItemChanged(QListWidgetItem*,QListWidgetItem*)"),
                     self.slotDeviceChanged)
        self.connect(self.ui.installFirstMBR, SIGNAL("clicked()"),
                     self.slotDisableList)
        self.connect(self.ui.installPart, SIGNAL("clicked()"),
                     self.slotDisableList)
        self.connect(self.ui.noInstall, SIGNAL("clicked()"),
                     self.slotDisableList)
        self.connect(self.ui.installMBR, SIGNAL("clicked()"),
                     self.slotEnableList)
        self.connect(self.ui.device_list, SIGNAL("itemClicked(QListWidgetItem*)"),
                     self.slotSelect)

    def shown(self):
        yali4.storage.setOrderedDiskList()
        ctx.debugger.log("Disks BIOS Boot order : %s " % ','.join(ctx.installData.orderedDiskList))
        self.getBootable().setBootable()

    def getBootable(self):
        #opts = get_kernel_option("mudur")
        opts =yali4.sysutils.liveMediaSystem()
        for i in range(self.ui.device_list.count()):
            item = self.ui.device_list.item(i)
            if opts.__eq__("harddisk"):
                if item.getDevice().getPath() == ctx.installData.orderedDiskList[1]:
                    return item
            else:
                if item.getDevice().getPath() == ctx.installData.orderedDiskList[0]:
                    return item

    def backCheck(self):
        if ctx.autoInstall:
            # we need to go partition auto screen, not manual ;)
            ctx.mainScreen.moveInc = 2
        return True

    def slotDisableList(self):
        self.ui.device_list.setEnabled(False)
        self.ui.device_list.setCurrentItem(self.getBootable())

    def slotEnableList(self):
        self.ui.device_list.setEnabled(True)

    def slotSelect(self):
        self.ui.installMBR.toggle()

    def slotDeviceChanged(self, o, n):
        self.device = o.getDevice()
        ctx.bootLoaderOptionalDev = self.device

    def execute(self):
        ctx.installData.bootLoaderOptionalDev = self.device
        # Apply GRUB Options
        if self.ui.noInstall.isChecked():
            ctx.installData.bootLoaderOption = B_DONT_INSTALL
        elif self.ui.installPart.isChecked():
            ctx.installData.bootLoaderOption = B_INSTALL_PART
        elif self.ui.installMBR.isChecked():
            ctx.installData.bootLoaderOption = B_INSTALL_MBR
        else:
            ctx.installData.bootLoaderOption = B_INSTALL_SMART
        ctx.installData.bootLoaderDetectOthers = self.ui.autoAddOthers.isChecked()
        return True
Ejemplo n.º 4
0
class Widget(QtGui.QWidget, ScreenWidget):
    title = _('Bootloader Choice')
    desc = _('Configure the system boot...')
    icon = "iconBootloader"
    help = _('''
<font size="+2">Boot loader setup</font>
<font size="+1">
<p>
Pardus 2009 uses a boot manager called GRUB to start the operating system you choose.
</p>
<p>If there are multiple operating systems in your computer, you can start the one 
you like using GRUB. Installing GRUB to the beginning of the boot disk is the advised 
option to avoid boot problems.  If you are sure you know what you are doing, 
you can change boot loader settings.
</p>
<p>
Please refer to Pardus Installing and Using 
Guide for more information about GRUB boot 
loader.
</p>
</font>
''')

    def __init__(self, *args):
        QtGui.QWidget.__init__(self, None)
        self.ui = Ui_BootLoaderWidget()
        self.ui.setupUi(self)

        self.ui.installFirstMBR.setChecked(True)

        # initialize all storage devices
        if not yali4.storage.initDevices():
            raise GUIException, _("Can't find a storage device!")

        # fill device list
        for dev in yali4.storage.devices:
            DeviceItem(self.ui.device_list, dev)
        # select the first disk by default
        self.ui.device_list.setCurrentRow(0)
        # be sure first is selected device
        self.device = self.ui.device_list.item(0).getDevice()

        if len(yali4.storage.devices) < 1:
            # don't show device list if we have just one disk
            self.ui.installMBR.hide()
            self.ui.device_list.hide()

            self.device = yali4.storage.devices[0]

        self.connect(
            self.ui.device_list,
            SIGNAL("currentItemChanged(QListWidgetItem*,QListWidgetItem*)"),
            self.slotDeviceChanged)
        self.connect(self.ui.installFirstMBR, SIGNAL("clicked()"),
                     self.slotDisableList)
        self.connect(self.ui.installPart, SIGNAL("clicked()"),
                     self.slotDisableList)
        self.connect(self.ui.noInstall, SIGNAL("clicked()"),
                     self.slotDisableList)
        self.connect(self.ui.installMBR, SIGNAL("clicked()"),
                     self.slotEnableList)
        self.connect(self.ui.device_list,
                     SIGNAL("itemClicked(QListWidgetItem*)"), self.slotSelect)

    def shown(self):
        yali4.storage.setOrderedDiskList()
        ctx.debugger.log("Disks BIOS Boot order : %s " %
                         ','.join(ctx.installData.orderedDiskList))
        self.getBootable().setBootable()

    def getBootable(self):
        #opts = get_kernel_option("mudur")
        opts = yali4.sysutils.liveMediaSystem()
        for i in range(self.ui.device_list.count()):
            item = self.ui.device_list.item(i)
            if opts.__eq__("harddisk"):
                if item.getDevice().getPath(
                ) == ctx.installData.orderedDiskList[1]:
                    return item
            else:
                if item.getDevice().getPath(
                ) == ctx.installData.orderedDiskList[0]:
                    return item

    def backCheck(self):
        if ctx.autoInstall:
            # we need to go partition auto screen, not manual ;)
            ctx.mainScreen.moveInc = 2
        return True

    def slotDisableList(self):
        self.ui.device_list.setEnabled(False)
        self.ui.device_list.setCurrentItem(self.getBootable())

    def slotEnableList(self):
        self.ui.device_list.setEnabled(True)

    def slotSelect(self):
        self.ui.installMBR.toggle()

    def slotDeviceChanged(self, o, n):
        self.device = o.getDevice()
        ctx.bootLoaderOptionalDev = self.device

    def execute(self):
        ctx.installData.bootLoaderOptionalDev = self.device
        # Apply GRUB Options
        if self.ui.noInstall.isChecked():
            ctx.installData.bootLoaderOption = B_DONT_INSTALL
        elif self.ui.installPart.isChecked():
            ctx.installData.bootLoaderOption = B_INSTALL_PART
        elif self.ui.installMBR.isChecked():
            ctx.installData.bootLoaderOption = B_INSTALL_MBR
        else:
            ctx.installData.bootLoaderOption = B_INSTALL_SMART
        ctx.installData.bootLoaderDetectOthers = self.ui.autoAddOthers.isChecked(
        )
        return True
Ejemplo n.º 5
0
class Widget(QtGui.QWidget, ScreenWidget):
    title = _('Bootloader Choice')
    desc = _('Configure the system boot..')
    help = _('''
<font size="+2">Boot loader setup</font>

<font size="+1">
<p>
Linux makes use of GRUB boot loader, which
can boot the operating system of your taste
during the start up. 
</p>
<p>
If you have more than one operating system,
you can choose which operating system to 
boot also.
</p>

<p>
Please refer to Pardus Installing and Using 
Guide for more information about GRUB boot 
loader.
</p>
</font>
''')

    def __init__(self, *args):
        QtGui.QWidget.__init__(self,None)
        self.ui = Ui_BootLoaderWidget()
        self.ui.setupUi(self)

        self.ui.installFirstMBR.setChecked(True)

        # initialize all storage devices
        if not yali4.storage.init_devices():
            raise GUIException, _("Can't find a storage device!")

        if len(yali4.storage.devices) > 1:
            self.device_list_state = True
            # fill device list
            for dev in yali4.storage.devices:
                DeviceItem(self.ui.device_list, dev)
            # select the first disk by default
            self.ui.device_list.setCurrentRow(0)
            # be sure first is selected device
            self.device = self.ui.device_list.item(0).getDevice()
        else:
            # don't show device list if we have just one disk
            self.ui.installMBR.hide()
            self.device_list_state = False
            self.ui.device_list.hide()
            self.ui.select_disk_label.hide()

            self.device = yali4.storage.devices[0]

        self.connect(self.ui.device_list, SIGNAL("currentItemChanged(QListWidgetItem*,QListWidgetItem*)"),
                     self.slotDeviceChanged)
        self.connect(self.ui.device_list, SIGNAL("itemClicked(QListWidgetItem*)"),
                     self.slotSelect)

    def shown(self):

        if len(yali4.storage.devices) > 1:
            ctx.installData.orderedDiskList = yali4.storage.getOrderedDiskList()
        else:
            ctx.installData.orderedDiskList = yali4.storage.detect_all()

        ctx.debugger.log("Disks BIOS Boot order : %s " % ','.join(ctx.installData.orderedDiskList))

    def backCheck(self):
        if ctx.autoInstall:
            # we need to go partition auto screen, not manual ;)
            ctx.mainScreen.moveInc = 2
        return True

    def slotSelect(self):
        self.ui.installMBR.toggle()

    def slotDeviceChanged(self, o, n):
        self.device = o.getDevice()

    def execute(self):

        w = WarningWidget(self)
        # We need different warning messages for Auto and Manual Partitioning
        if ctx.installData.autoPartDev:
            # show confirmation dialog
            w.warning.setText(_('''<b>
<p>This action will use your entire disk for Pardus installation and <br>
all your present data on the selected disk will be lost.</p>
</b>
'''))
        self.dialog = WarningDialog(w, self)
        if not self.dialog.exec_():
            # disabled by weaver
            ctx.mainScreen.enableBack()
            return False

        ctx.mainScreen.processEvents()

        # We should do partitioning operations in here.
        if ctx.options.dryRun == True:
            ctx.debugger.log("dryRun activated Yali stopped")
            return

        # Auto Partitioning
        if ctx.installData.autoPartDev:
            ctx.use_autopart = True

            if ctx.installData.autoPartMethod == methodEraseAll:
                ctx.yali.autoPartDevice()
                ctx.yali.checkSwap()
                ctx.yali.info.updateMessage(_("Formatting ..."))
                ctx.mainScreen.processEvents()
                ctx.partrequests.applyAll()

            elif ctx.installData.autoPartMethod == methodUseAvail:
                ctx.yali.autoPartUseAvail()
                ctx.yali.checkSwap()
                ctx.yali.info.updateMessage(_("Formatting ..."))
                ctx.mainScreen.processEvents()
                ctx.partrequests.applyAll()

        # Manual Partitioning
        else:
            ctx.debugger.log("Format Operation Started")
            ctx.yali.info.updateAndShow(_("Writing disk tables ..."))
            for dev in yali4.storage.devices:
                ctx.mainScreen.processEvents()
                dev.commit()
            # wait for udev to create device nodes
            time.sleep(2)
            ctx.yali.checkSwap()
            ctx.yali.info.updateMessage(_("Formatting ..."))
            ctx.mainScreen.processEvents()
            ctx.partrequests.applyAll()
            ctx.debugger.log("Format Operation Finished")

        ctx.yali.info.hide()

        root_part_req = ctx.partrequests.searchPartTypeAndReqType(parttype.root,
                                                                  request.mountRequestType)

        # install_dev
        if self.ui.noInstall.isChecked():
            ctx.installData.bootLoaderDev = None
        elif self.ui.installPart.isChecked():
            ctx.installData.bootLoaderDev = basename(root_part_req.partition().getPath())
        elif self.ui.installMBR.isChecked():
            ctx.installData.bootLoaderDev = basename(self.device.getPath())
        else:
            ctx.yali.guessBootLoaderDevice()

        _ins_part = root_part_req.partition().getPath()

        ctx.debugger.log("Pardus Root is : %s" % _ins_part)
        ctx.debugger.log("GRUB will be installing to : %s" % ctx.installData.bootLoaderDev)

        return True