diff options
author | jrb <jrb> | 2004-08-23 23:21:16 +0000 |
---|---|---|
committer | jrb <jrb> | 2004-08-23 23:21:16 +0000 |
commit | b674c064457806e944f303e63ca965c5ce7a8a9a (patch) | |
tree | 192c79d3b1f67560811475b609188ed1f516a281 | |
parent | 1e785bd9bacdc21846283e043945088f12b7ae41 (diff) | |
download | anaconda-b674c064457806e944f303e63ca965c5ce7a8a9a.tar.gz anaconda-b674c064457806e944f303e63ca965c5ce7a8a9a.tar.xz anaconda-b674c064457806e944f303e63ca965c5ce7a8a9a.zip |
make rootpath work nicer
-rwxr-xr-x | anaconda | 15 | ||||
-rw-r--r-- | bootloader.py | 10 | ||||
-rw-r--r-- | flags.py | 1 | ||||
-rwxr-xr-x | gui.py | 42 | ||||
-rw-r--r-- | packages.py | 12 | ||||
-rw-r--r-- | splashscreen.py | 4 | ||||
-rw-r--r-- | upgrade.py | 9 |
7 files changed, 75 insertions, 18 deletions
@@ -522,6 +522,7 @@ for n in args: elif (str == '-r' or str == '--rootpath'): rootPath = arg flags.setupFilesystems = 0 + flags.rootpath = 1 logFile = sys.stderr elif (str == '--traceonly'): traceOnly = 1 @@ -840,7 +841,7 @@ time.sleep(3) # now determine if we're going to run in GUI or TUI mode # # if no X server, we have to use text mode -if not flags.test and (iutil.getArch() != "s390" and not os.access("/mnt/runtime/usr/X11R6/bin/Xorg", os.X_OK)): +if not (flags.test or flags.rootpath) and (iutil.getArch() != "s390" and not os.access("/mnt/runtime/usr/X11R6/bin/Xorg", os.X_OK)): dup_log(_("Graphical installation not available... " "Starting text mode.")) time.sleep(2) @@ -1116,6 +1117,18 @@ if keymap: dispatch.skipStep("keyboard", permanent = 1) instClass.setKeyboard(id, keymap) +# Skip the disk options in rootpath mode +if flags.rootpath: + dispatch.skipStep("partitionmethod", permanent = 1) + dispatch.skipStep("partitionmethodsetup", permanent = 1) + dispatch.skipStep("autopartition", permanent = 1) + dispatch.skipStep("autopartitionexecute", permanent = 1) + dispatch.skipStep("fdisk", permanent = 1) + dispatch.skipStep("bootloadersetup", permanent = 1) + dispatch.skipStep("bootloader", permanent = 1) + dispatch.skipStep("bootloaderadvanced", permanent = 1) + dispatch.skipStep("upgbootloader", permanent = 1) + # set up the headless case if isHeadless == 1: id.setHeadless(isHeadless) diff --git a/bootloader.py b/bootloader.py index 0b136cc2f..02921ddd4 100644 --- a/bootloader.py +++ b/bootloader.py @@ -105,7 +105,9 @@ def writeBootloader(intf, instRoot, fsset, bl, langs, comps): else: bl.doUpgradeOnly = 0 - w = intf.waitWindow(_("Bootloader"), _("Installing bootloader...")) + # We don't need to let the user know if we're just doing the bootloader. + if not justConfigFile: + w = intf.waitWindow(_("Bootloader"), _("Installing bootloader...")) kernelList = [] otherList = [] @@ -138,12 +140,6 @@ def writeBootloader(intf, instRoot, fsset, bl, langs, comps): kernelList.append((kernelLabel, kernelLongLabel, version)) plainLabelUsed = 1 - # FIXME: blah, exec-shield breaks grub. turn it off for now - if os.access("/proc/sys/kernel/exec-shield", os.W_OK): - f = open("/proc/sys/kernel/exec-shield", "w") - f.write("0") - f.close() - dosync() try: bl.write(instRoot, fsset, bl, langs, kernelList, otherList, defaultDev, @@ -32,6 +32,7 @@ class Flags: def __init__(self): self.__dict__['flags'] = {} self.__dict__['flags']['test'] = 0 + self.__dict__['flags']['rootpath'] = 0 self.__dict__['flags']['expert'] = 0 self.__dict__['flags']['serial'] = 0 self.__dict__['flags']['setupFilesystems'] = 1 @@ -342,6 +342,7 @@ def titleBarMotionEventCB(widget, event, data): data["window"].move(int(newx), int(newy)) def addFrame(dialog, title=None, showtitle = 1): + # We don't add a Frame in rootpath mode, as we almost certainly have a window manager contents = dialog.get_children()[0] dialog.remove(contents) frame = gtk.Frame() @@ -351,7 +352,7 @@ def addFrame(dialog, title=None, showtitle = 1): if title is None: title = dialog.get_title() - if title: + if title and not flags.rootpath: data = {} data["state"] = 0 data["button"] = 0 @@ -376,6 +377,8 @@ def addFrame(dialog, title=None, showtitle = 1): s = gtk.Label("") titleBox.pack_start(s) box.pack_start(eventBox, gtk.FALSE, gtk.FALSE) + elif flags.rootpath: + dialog.set_title (title) except: pass @@ -394,7 +397,12 @@ def addFrame(dialog, title=None, showtitle = 1): class WaitWindow: def __init__(self, title, text): - self.window = gtk.Window(gtk.WINDOW_POPUP) + if flags.rootpath: + self.window = gtk.Window() + self.window.set_decorated(False) + # FIXME: we should really call set_transient_for + else: + self.window = gtk.Window(gtk.WINDOW_POPUP) self.window.set_title(title) self.window.set_position(gtk.WIN_POS_CENTER) self.window.set_modal(gtk.TRUE) @@ -414,7 +422,15 @@ class WaitWindow: class ProgressWindow: def __init__(self, title, text, total): - self.window = gtk.Window (gtk.WINDOW_POPUP) + if flags.rootpath: + self.window = gtk.Window() + self.window.set_decorated(False) + # FIXME: we should really call set_transient_for + def no_delete (window, event): + return True + self.window.connect('delete-event', no_delete) + else: + self.window = gtk.Window(gtk.WINDOW_POPUP) self.window.set_title (title) self.window.set_position (gtk.WIN_POS_CENTER) self.window.set_modal (gtk.TRUE) @@ -697,7 +713,6 @@ class TextViewBrowser(gtk.TextView): self.set_property('cursor_visible', gtk.FALSE) self.set_left_margin(10) self.set_wrap_mode(gtk.WRAP_WORD) - self.connect('move-cursor', self.moveCursor) self.connect('set-scroll-adjustments', self.cacheAdjustments) def swallowFocus(self, *args): @@ -1096,11 +1111,18 @@ class InstallControlWindow: custom_buttons=[_("_Exit"), _("_Retry")]) if not win.getrc(): + if flags.rootpath: + msg = _("The installer will now exit...") + buttons = [_("_Exit")] + else: + msg = _("Your system will now be rebooted...") + buttons = [_("_Reboot")] + MessageWindow(_("Rebooting System"), - _("Your system will now be rebooted..."), + msg, type="custom", custom_icon="warning", - custom_buttons=[_("_Reboot")]) + custom_buttons=buttons) sys.exit(0) ics = InstallControlState (self) @@ -1126,6 +1148,9 @@ class InstallControlWindow: if self.displayHelp: self.refreshHelp() + if step == "install": + gtk.mainloop() + def destroyCurrentWindow(self): children = self.installFrame.get_children () @@ -1267,9 +1292,14 @@ class InstallControlWindow: def setup_window (self, runres): self.window = gtk.Window () + # Quick hack to make rootpath mode not suck by letting the user delete the window. + def no_delete (window, event): + return True + self.window.connect('delete-event', no_delete) global mainWindow mainWindow = self.window self.window.set_events (gtk.gdk.KEY_RELEASE_MASK) + self.window.set_resizable (False) if runres == '640x480': self.window.set_default_size (640, 480) diff --git a/packages.py b/packages.py index bf0473b3c..8351659d1 100644 --- a/packages.py +++ b/packages.py @@ -1486,10 +1486,16 @@ def betaNagScreen(intf, dir): custom_buttons=[_("_Exit"), _("_Install anyway")]) if not rc: + if flags.rootpath: + msg = _("The installer will now exit...") + buttons = [_("_Back"), _("_Exit")] + else: + msg = _("Your system will now be rebooted...") + buttons = [_("_Back"), _("_Reboot")] rc = intf.messageWindow( _("Rebooting System"), - _("Your system will now be rebooted..."), - type="custom", custom_icon="warning", - custom_buttons=[_("_Back"), _("_Reboot")]) + msg, + type="custom", custom_icon="warning", + custom_buttons=buttons) if rc: sys.exit(0) else: diff --git a/splashscreen.py b/splashscreen.py index d084e8d2a..b5995aeaa 100644 --- a/splashscreen.py +++ b/splashscreen.py @@ -89,6 +89,10 @@ def splashScreenShow(configFileData): if p: splashwindow = gtk.Window() + def no_delete (window, event): + return True + splashwindow.connect('delete-event', no_delete) + splashwindow.set_decorated(False) splashwindow.set_position(gtk.WIN_POS_CENTER) box = gtk.EventBox() box.modify_bg(gtk.STATE_NORMAL, box.get_style().white) diff --git a/upgrade.py b/upgrade.py index 385bd192e..fade17a39 100644 --- a/upgrade.py +++ b/upgrade.py @@ -30,6 +30,7 @@ from fsset import * from partitioning import * from constants import * from installmethod import FileCopyException +from product import productName from rhpl.log import log from rhpl.translate import _ @@ -55,7 +56,13 @@ def findRootParts(intf, id, dispatch, dir, chroot): dispatch.skipStep("installtype", skip = 0) def findExistingRoots(intf, id, chroot, upgradeany = 0): - if not flags.setupFilesystems: return [(chroot, 'ext2', "")] + if not flags.setupFilesystems: + relstr = partedUtils.getRedHatReleaseString (chroot) + if ((cmdline.find("upgradeany") != -1) or + (upgradeany == 1) or + (partedUtils.productMatches(relstr, productName))): + return [(chroot, 'ext2', "")] + return [] diskset = partedUtils.DiskSet() diskset.openDevices() |