summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-04-22 16:27:13 +0000
committerJeremy Katz <katzj@redhat.com>2002-04-22 16:27:13 +0000
commitdcc913781c1d7c921b0d06987bcbded4230c3e79 (patch)
treee39a6a3fdc7ef61e00eac457ec6c54a43482c377
parent2627017d67c307ba4b05c66d412d052bfef5437a (diff)
downloadanaconda-dcc913781c1d7c921b0d06987bcbded4230c3e79.tar.gz
anaconda-dcc913781c1d7c921b0d06987bcbded4230c3e79.tar.xz
anaconda-dcc913781c1d7c921b0d06987bcbded4230c3e79.zip
merge bootloader changes from HEAD
-rw-r--r--bootloader.py15
-rw-r--r--dispatch.py1
-rwxr-xr-xgui.py3
-rw-r--r--installclasses/upgradeclass.py4
-rw-r--r--iw/upgrade_bootloader_gui.py152
-rw-r--r--kickstart.py4
-rw-r--r--text.py1
-rw-r--r--textw/upgrade_bootloader_text.py118
-rw-r--r--upgradeclass.py4
9 files changed, 292 insertions, 10 deletions
diff --git a/bootloader.py b/bootloader.py
index 5bd484c4b..8cd6cba22 100644
--- a/bootloader.py
+++ b/bootloader.py
@@ -78,6 +78,21 @@ def writeBootloader(intf, instRoot, fsset, bl, langs, comps):
if bl.defaultDevice == -1:
return
+ # now make the upgrade stuff work for kickstart too. ick.
+ if bl.kickstart == 1 and bl.doUpgradeOnly == 1:
+ import checkbootloader
+ (bootType, theDev) = checkbootloader.getBootloaderTypeAndBoot(instRoot)
+
+ bl.doUpgradeonly = 1
+ if bootType == "GRUB":
+ bl.useGrubVal = 1
+ bl.setDevice(theDev)
+ elif bootType == "LILO":
+ bl.useGrubVal = 0
+ bl.setDevice(theDev)
+ else:
+ bl.doUpgradeOnly = 0
+
w = intf.waitWindow(_("Bootloader"), _("Installing bootloader..."))
kernelList = []
diff --git a/dispatch.py b/dispatch.py
index 07cf3861e..448105e98 100644
--- a/dispatch.py
+++ b/dispatch.py
@@ -78,6 +78,7 @@ installSteps = [
"intf", "instPath", "dir")),
("upgrademigfind", upgradeMigrateFind, ("dispatch", "id.fsset")),
("upgrademigratefs", ("id.fsset",)),
+ ("upgbootloader", ("dispatch", "id.bootloader")),
("bootloadersetup", bootloaderSetupChoices, ("dispatch", "id.bootloader",
"id.fsset", "id.diskset",
"dir")),
diff --git a/gui.py b/gui.py
index 10d65804a..a9c3e3e64 100755
--- a/gui.py
+++ b/gui.py
@@ -46,7 +46,8 @@ stepToClass = {
"fdisk" : ("fdisk_gui", "FDiskWindow"),
"fdasd" : ("fdasd_gui", "FDasdWindow"),
"bootloader": ("bootloader_gui", "BootloaderWindow"),
- "bootloaderadvanced": ("bootloader_gui", "AdvancedBootloaderWindow"),
+ "bootloaderadvanced": ("bootloader_gui", "AdvancedBootloaderWindow"),
+ "upgbootloader": ("upgrade_bootloader_gui", "UpgradeBootloaderWindow"),
"network" : ("network_gui", "NetworkWindow"),
"firewall" : ("firewall_gui", "FirewallWindow"),
"languagesupport" : ("language_support_gui", "LanguageSupportWindow"),
diff --git a/installclasses/upgradeclass.py b/installclasses/upgradeclass.py
index 0b21620bc..61f14827f 100644
--- a/installclasses/upgradeclass.py
+++ b/installclasses/upgradeclass.py
@@ -32,9 +32,7 @@ class InstallClass(BaseInstallClass):
"upgradecontinue",
"readcomps",
"findpackages",
- "bootloadersetup",
- "bootloader",
- "bootloaderadvanced",
+ "upgbootloader",
"checkdeps",
"dependencies",
"confirmupgrade",
diff --git a/iw/upgrade_bootloader_gui.py b/iw/upgrade_bootloader_gui.py
new file mode 100644
index 000000000..164a4eabf
--- /dev/null
+++ b/iw/upgrade_bootloader_gui.py
@@ -0,0 +1,152 @@
+#
+# upgrade_bootloader_gui.py: gui bootloader dialog for upgrades
+#
+# Jeremy Katz <katzj@redhat.com>
+#
+# Copyright, 2002 Red Hat, Inc.
+#
+#
+# This software may be freely redistributed under the terms of the GNU
+# library public license.
+#
+# You should have received a copy of the GNU Library Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+# must replace with explcit form so update disks will work
+from iw_gui import *
+
+import gtk
+from translate import _, N_
+import iutil
+import gui
+import checkbootloader
+
+class UpgradeBootloaderWindow (InstallWindow):
+ windowTitle = N_("Upgrade Boot Loader Configuration")
+ htmlTag = "bl-upgrade"
+
+ def getPrev(self):
+ pass
+
+ def getNext(self):
+ if self.nobl_radio.get_active():
+ self.dispatch.skipStep("bootloadersetup", skip = 1)
+ self.dispatch.skipStep("bootloader", skip = 1)
+ self.dispatch.skipStep("bootloaderadvanced", skip = 1)
+ self.dispatch.skipStep("instbootloader", skip = 1)
+ elif self.newbl_radio.get_active():
+ self.dispatch.skipStep("bootloadersetup", skip = 0)
+ self.dispatch.skipStep("bootloader", skip = 0)
+ self.dispatch.skipStep("bootloaderadvanced", skip = 0)
+ self.dispatch.skipStep("instbootloader", skip = 0)
+ self.bl.doUpgradeOnly = 0
+ else:
+ self.dispatch.skipStep("bootloadersetup", skip = 0)
+ self.dispatch.skipStep("bootloader", skip = 1)
+ self.dispatch.skipStep("bootloaderadvanced", skip = 1)
+ self.dispatch.skipStep("instbootloader", skip = 0)
+ self.bl.doUpgradeOnly = 1
+
+ if self.type == "GRUB":
+ self.bl.useGrubVal = 1
+ else:
+ self.bl.useGrubVal = 0
+ self.bl.setDevice(self.bootDev)
+
+
+ def getScreen(self, dispatch, bl):
+ self.dispatch = dispatch
+ self.bl = bl
+ self.intf = dispatch.intf
+
+ (self.type, self.bootDev) = \
+ checkbootloader.getBootloaderTypeAndBoot("/mnt/sysimage")
+
+
+ self.update_radio = gtk.RadioButton(None, _("Update boot loader configuration"))
+ updatestr = _("This will update your current boot loader.")
+
+ if self.type != None:
+ current = _("The installer has detected the %s boot loader "
+ "currently installed on %s.") % (self.type,
+ self.bootDev)
+ self.update_label = gtk.Label("%s %s" % (updatestr,
+ _("This is the recommended option.")))
+ self.update_radio.set_active(gtk.FALSE)
+ update = 1
+ else:
+ current = _("The installer is unable to detect the boot loader "
+ "currently in use on your system.")
+ self.update_label = gtk.Label("%s" % (updatestr,))
+ self.update_radio.set_sensitive(gtk.FALSE)
+ self.update_label.set_sensitive(gtk.FALSE)
+ update = 0
+
+
+ self.newbl_radio = gtk.RadioButton(self.update_radio,
+ _("Create new boot loader "
+ "configuration"))
+ self.newbl_label = gtk.Label(_("This will let you create a "
+ "new boot loader configuration. If "
+ "you wish to switch boot loaders, you "
+ "should choose this."))
+
+ self.newbl_radio.set_active(gtk.FALSE)
+ self.nobl_radio = gtk.RadioButton(self.update_radio,
+ _("Skip boot loader updating"))
+ self.nobl_label = gtk.Label(_("This will make no changes to boot "
+ "loader configuration. If you are "
+ "using a third party boot loader, you "
+ "should choose this."))
+ self.nobl_radio.set_active(gtk.FALSE)
+
+ for label in [self.update_label, self.nobl_label, self.newbl_label]:
+ label.set_alignment(0.8, 0)
+ label.set_size_request(275, -1)
+ label.set_line_wrap(gtk.TRUE)
+
+
+ str = _("What would you like to do?")
+ # if they have one, the default is to update, otherwise the
+ # default is to not touch anything
+ if update == 1:
+ default = self.update_radio
+ else:
+ default = self.nobl_radio
+
+
+ if not dispatch.stepInSkipList("bootloader"):
+ self.newbl_radio.set_active(gtk.TRUE)
+ elif dispatch.stepInSkipList("instbootloader"):
+ self.nobl_radio.set_active(gtk.TRUE)
+ else:
+ default.set_active(gtk.TRUE)
+
+
+ box = gtk.VBox(gtk.FALSE, 5)
+
+ label = gtk.Label(current)
+ label.set_line_wrap(gtk.TRUE)
+ label.set_alignment(0.5, 0.0)
+ label.set_size_request(300, -1)
+ label2 = gtk.Label(str)
+ label2.set_line_wrap(gtk.TRUE)
+ label2.set_alignment(0.5, 0.0)
+ label2.set_size_request(300, -1)
+
+ box.pack_start(label, gtk.FALSE)
+ box.pack_start(label2, gtk.FALSE, padding = 10)
+
+ box.pack_start(self.update_radio, gtk.FALSE)
+ box.pack_start(self.update_label, gtk.FALSE)
+ box.pack_start(self.nobl_radio, gtk.FALSE)
+ box.pack_start(self.nobl_label, gtk.FALSE)
+ box.pack_start(self.newbl_radio, gtk.FALSE)
+ box.pack_start(self.newbl_label, gtk.FALSE)
+
+ a = gtk.Alignment(0.2, 0.1)
+ a.add(box)
+
+ return a
diff --git a/kickstart.py b/kickstart.py
index 012bf90b9..a4395ef46 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -260,7 +260,6 @@ class KickstartBase(BaseInstallClass):
else:
location = validLocations.index(location)
- # FIXME: upgrade mode not implemented yet on HEAD
if upgrade and not id.upgrade.get():
raise RuntimeError, "Selected upgrade mode for bootloader but not doing an upgrade"
@@ -270,8 +269,7 @@ class KickstartBase(BaseInstallClass):
self.setBootloader(id, useLilo, location, linear, forceLBA,
password, md5pass, appendLine)
- # FIXME: uncomment when upgrade boot loader stuff is merged
-# self.skipSteps.append("upgbootloader")
+ self.skipSteps.append("upgbootloader")
self.skipSteps.append("bootloader")
self.skipSteps.append("bootloaderadvanced")
diff --git a/text.py b/text.py
index a177d970a..6e77817f1 100644
--- a/text.py
+++ b/text.py
@@ -48,6 +48,7 @@ stepToClasses = {
"findinstall" : ("upgrade_text", ("UpgradeExamineWindow",
"CustomizeUpgradeWindow")),
"addswap" : ("upgrade_text", "UpgradeSwapWindow"),
+ "upgbootloader": ("upgrade_bootloader_text", "UpgradeBootloaderWindow"),
"bootloader" : ("bootloader_text", ("BootloaderChoiceWindow",
"BootloaderAppendWindow",
"BootloaderPasswordWindow")),
diff --git a/textw/upgrade_bootloader_text.py b/textw/upgrade_bootloader_text.py
new file mode 100644
index 000000000..5a61e22db
--- /dev/null
+++ b/textw/upgrade_bootloader_text.py
@@ -0,0 +1,118 @@
+#
+# upgrade_bootloader_text.py: text bootloader dialog for upgrades
+#
+# Jeremy Katz <katzj@redhat.com>
+#
+# Copyright, 2002 Red Hat, Inc.
+#
+#
+# This software may be freely redistributed under the terms of the GNU
+# library public license.
+#
+# You should have received a copy of the GNU Library Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+from snack import *
+from constants_text import *
+from translate import _
+from flags import flags
+import string
+import iutil
+import checkbootloader
+
+class UpgradeBootloaderWindow:
+
+ def __call__(self, screen, dispatch, bl):
+ self.dispatch = dispatch
+ self.bl = bl
+
+ (self.type, self.bootDev) = \
+ checkbootloader.getBootloaderTypeAndBoot("/mnt/sysimage")
+
+ blradio = RadioGroup()
+
+ (update, newbl, nobl) = (0, 0, 0)
+ if not dispatch.stepInSkipList("bootloader"):
+ newbl = 1
+ elif dispatch.stepInSkipList("instbootloader"):
+ nobl = 1
+ else:
+ if self.type != None:
+ update = 1
+ else:
+ nobl = 0
+
+ if self.type != None:
+ t = TextboxReflowed(53,
+ _("The installer has detected the %s boot "
+ "loader currently installed on %s.")
+ % (self.type, self.bootDev))
+
+ self.update_radio = blradio.add(_("Update boot loader configuration"),
+ "update", update)
+ else:
+ t = TextboxReflowed(53,
+ _("The installer is unable to detect the boot loader "
+ "currently in use on your system."))
+
+ self.update_radio = blradio.add(_("Update boot loader configuration"),
+ "update", update)
+ self.update_radio.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_SET)
+
+ self.nobl_radio = blradio.add(_("Skip boot loader updating"),
+ "nobl", nobl)
+ self.newbl_radio = blradio.add(_("Create new boot loader "
+ "configuration"),
+ "newbl", newbl)
+
+ buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON])
+
+ grid = GridFormHelp(screen, _("Upgrade Boot Loader Configuration"),
+ "bl-upgrade", 1, 5)
+
+ grid.add(t, 0, 0, (0,0,0,1))
+ grid.add(self.update_radio, 0, 1, (0,0,0,0))
+ grid.add(self.nobl_radio, 0, 2, (0,0,0,0))
+ grid.add(self.newbl_radio, 0, 3, (0,0,0,1))
+ grid.add(buttons, 0, 4, growx = 1)
+
+
+ while 1:
+ result = grid.run()
+
+ button = buttons.buttonPressed(result)
+
+ if button == TEXT_BACK_CHECK:
+ screen.popWindow()
+ return INSTALL_BACK
+
+ if blradio.getSelection() == "nobl":
+ self.dispatch.skipStep("bootloadersetup", skip = 1)
+ self.dispatch.skipStep("bootloader", skip = 1)
+ self.dispatch.skipStep("bootloaderadvanced", skip = 1)
+ self.dispatch.skipStep("instbootloader", skip = 1)
+ if blradio.getSelection() == "newbl":
+ self.dispatch.skipStep("bootloadersetup", skip = 0)
+ self.dispatch.skipStep("bootloader", skip = 0)
+ self.dispatch.skipStep("bootloaderadvanced", skip = 0)
+ self.dispatch.skipStep("instbootloader", skip = 0)
+ self.bl.doUpgradeOnly = 0
+ else:
+ self.dispatch.skipStep("bootloadersetup", skip = 0)
+ self.dispatch.skipStep("bootloader", skip = 1)
+ self.dispatch.skipStep("bootloaderadvanced", skip = 1)
+ self.dispatch.skipStep("instbootloader", skip = 0)
+ self.bl.doUpgradeOnly = 1
+
+ if self.type == "GRUB":
+ self.bl.useGrubVal = 1
+ else:
+ self.bl.useGrubVal = 0
+ self.bl.setDevice(self.bootDev)
+
+
+
+ screen.popWindow()
+ return INSTALL_OK
diff --git a/upgradeclass.py b/upgradeclass.py
index 0b21620bc..61f14827f 100644
--- a/upgradeclass.py
+++ b/upgradeclass.py
@@ -32,9 +32,7 @@ class InstallClass(BaseInstallClass):
"upgradecontinue",
"readcomps",
"findpackages",
- "bootloadersetup",
- "bootloader",
- "bootloaderadvanced",
+ "upgbootloader",
"checkdeps",
"dependencies",
"confirmupgrade",