예제 #1
0
    def getScreen(self, anaconda):
        self.dispatch = anaconda.dispatch
        self.bl = anaconda.bootloader
        self.intf = anaconda.intf

        self.driveorder = self.bl.drivelist
        if len(self.driveorder) == 0:
            partitioned = anaconda.storage.partitioned
            disks = anaconda.storage.disks
            self.driveorder = [d.name for d in disks if d in partitioned]

        if self.bl.getPassword():
            self.usePass = 1
            self.password = self.bl.getPassword()
        else:
            self.usePass = 0
            self.password = None

        thebox = gtk.VBox(False, 12)
        thebox.set_border_width(18)

        # make sure we get a valid device to say we're installing to
        if self.bl.getDevice() is not None:
            self.bldev = self.bl.getDevice()
        else:
            # we don't know what it is yet... if mbr is possible, we want
            # it, else we want the boot dev
            choices = anaconda.platform.bootloaderChoices(self.bl)
            if choices.has_key('mbr'):
                self.bldev = choices['mbr'][0]
            else:
                self.bldev = choices['boot'][0]

        hb = gtk.HBox(False, 12)
        self.grubCB = gtk.CheckButton(
            _("_Install boot loader on /dev/%s.") % (self.bldev, ))
        self.grubCB.set_active(
            not self.dispatch.stepInSkipList("instbootloader"))
        self.grubCB.connect("toggled", self.bootloaderChanged)
        hb.pack_start(self.grubCB, False)

        self.deviceButton = gtk.Button(_("_Change device"))
        self.deviceButton.connect("clicked", self._deviceChange, anaconda)
        hb.pack_start(self.deviceButton, False)

        thebox.pack_start(hb, False)

        # control whether or not there's a boot loader password and what it is
        self.blpass = BootloaderPasswordWidget(anaconda, self.parent)
        thebox.pack_start(self.blpass.getWidget(), False)

        # configure the systems available to boot from the boot loader
        self.oslist = OSBootWidget(anaconda, self.parent)
        # XXX: lxnay here, GRUB-2 doesn't allow this
        # thebox.pack_end(self.oslist.getWidget(), True)

        self.bootloaderChanged()
        return thebox
예제 #2
0
    def getScreen(self, dispatch, bl, fsset, diskSet):
        self.dispatch = dispatch
        self.bl = bl
        self.intf = dispatch.intf

        if self.bl.getPassword():
            self.usePass = 1
            self.password = self.bl.getPassword()
        else:
            self.usePass = 0
            self.password = None

        thebox = gtk.VBox(gtk.FALSE, 10)
        spacer = gtk.Label("")
        spacer.set_size_request(10, 1)
        thebox.pack_start(spacer, gtk.FALSE)

        if self.bl.useGrub():
            self.blname = "GRUB"
        else:
            self.blname = "LILO"
        # XXX this is kind of ugly
        if self.dispatch.stepInSkipList("instbootloader"):
            self.blname = None

        # make sure we get a valid device to say we're installing to
        if bl.getDevice() is not None:
            self.bldev = bl.getDevice()
        else:
            # we don't know what it is yet... if mbr is possible, we want
            # it, else we want the boot dev
            choices = fsset.bootloaderChoices(diskSet, self.bl)
            if choices.has_key('mbr'):
                self.bldev = choices['mbr'][0]
            else:
                self.bldev = choices['boot'][0]

        self.bllabel = gui.WrappingLabel("")

        self.bllabel.set_alignment(0.0, 0.5)

        hbox = gtk.HBox(gtk.FALSE, 10)
        hbox.pack_start(self.bllabel, gtk.FALSE)

        button = gtk.Button(_("_Change boot loader"))
        hbox.pack_start(button, gtk.FALSE)
        button.connect("clicked", self.changeBootloaderCallback)

        alignment = gtk.Alignment()
        alignment.set(0.1, 0, 0, 0)
        alignment.add(hbox)

        thebox.pack_start(alignment, gtk.FALSE)

        spacer = gtk.Label("")
        spacer.set_size_request(10, 1)
        thebox.pack_start(spacer, gtk.FALSE)

        # configure the systems available to boot from the boot loader
        self.oslist = OSBootWidget(bl, fsset, diskSet, self.parent, self.intf,
                                   self.blname)
        thebox.pack_start(self.oslist.getWidget(), gtk.FALSE)

        thebox.pack_start(gtk.HSeparator(), gtk.FALSE)

        # control whether or not there's a boot loader password and what it is
        self.blpass = BootloaderPasswordWidget(bl, self.parent, self.intf)
        thebox.pack_start(self.blpass.getWidget(), gtk.FALSE)

        thebox.pack_start(gtk.HSeparator(), gtk.FALSE)

        # check box to control showing the advanced screen
        self.advanced = gtk.CheckButton(
            _("Configure advanced boot loader "
              "_options"))
        if dispatch.stepInSkipList("bootloaderadvanced"):
            self.advanced.set_active(gtk.FALSE)
        else:
            self.advanced.set_active(gtk.TRUE)

        thebox.pack_start(self.advanced, gtk.FALSE)

        # finally, update the label and activate widgets appropriately
        self.updateBootLoaderLabel()

        return thebox
    def getScreen(self, anaconda):
        self.dispatch = anaconda.dispatch
        self.bl = anaconda.id.bootloader
        self.intf = anaconda.intf

        if self.bl.getPassword():
            self.usePass = 1
            self.password = self.bl.getPassword()
        else:
            self.usePass = 0
            self.password = None

        thebox = gtk.VBox(False, 5)
        thebox.set_border_width(10)
        spacer = gtk.Label("")
        spacer.set_size_request(10, 1)
        thebox.pack_start(spacer, False)

        if self.bl.useGrub():
            self.blname = "GRUB"
        else:
            self.blname = None

        # make sure we get a valid device to say we're installing to
        if self.bl.getDevice() is not None:
            self.bldev = self.bl.getDevice()
        else:
            # we don't know what it is yet... if mbr is possible, we want
            # it, else we want the boot dev
            choices = anaconda.id.fsset.bootloaderChoices(
                anaconda.id.diskset, self.bl)
            if choices.has_key('mbr'):
                self.bldev = choices['mbr'][0]
            else:
                self.bldev = choices['boot'][0]

        vb = gtk.VBox(False, 6)
        self.grub_radio = gtk.RadioButton(
            None,
            _("The %s boot loader will be "
              "installed on /dev/%s.") % ("GRUB", self.bldev))
        self.grub_radio.set_use_underline(False)
        vb.pack_start(self.grub_radio)
        self.none_radio = gtk.RadioButton(
            self.grub_radio, _("No boot loader will be installed."))
        vb.pack_start(self.none_radio)
        if self.blname is None:
            self.none_radio.set_active(True)
            self.grub_radio.set_active(False)
        else:
            self.grub_radio.set_active(True)
            self.none_radio.set_active(False)
        self.grub_radio.connect("toggled", self.bootloaderChanged)
        self.none_radio.connect("toggled", self.bootloaderChanged)
        thebox.pack_start(vb, False)

        spacer = gtk.Label("")
        spacer.set_size_request(10, 1)
        thebox.pack_start(spacer, False)

        # configure the systems available to boot from the boot loader
        self.oslist = OSBootWidget(anaconda, self.parent, self.blname)
        thebox.pack_start(self.oslist.getWidget(), False)

        thebox.pack_start(gtk.HSeparator(), False)

        # control whether or not there's a boot loader password and what it is
        self.blpass = BootloaderPasswordWidget(anaconda, self.parent)
        thebox.pack_start(self.blpass.getWidget(), False)

        thebox.pack_start(gtk.HSeparator(), False)

        # check box to control showing the advanced screen
        self.advanced = gtk.CheckButton(
            _("Configure advanced boot loader "
              "_options"))
        if self.dispatch.stepInSkipList("bootloaderadvanced"):
            self.advanced.set_active(False)
        else:
            self.advanced.set_active(True)

        thebox.pack_start(self.advanced, False)

        self.bootloaderChanged()
        return thebox