1 |
from installclass import getBaseInstallClass |
from installclass import BaseInstallClass |
2 |
from rhpl.translate import N_, _ |
from rhpl.translate import N_, _ |
3 |
|
from rhpl.log import log |
|
import logging |
|
|
log = logging.getLogger("anaconda") |
|
|
|
|
4 |
from constants import * |
from constants import * |
5 |
|
|
6 |
import os |
import os |
7 |
import iutil |
import iutil |
8 |
import string |
import string |
9 |
import rhpl |
import security |
|
|
|
|
baseclass = getBaseInstallClass() |
|
|
|
|
10 |
|
|
11 |
class Script: |
class Script: |
12 |
def __repr__(self): |
def __repr__(self): |
45 |
root = scriptRoot) |
root = scriptRoot) |
46 |
|
|
47 |
if rc != 0: |
if rc != 0: |
48 |
log.info("WARNING - Error code %s encountered running a sme script", rc) |
log("WARNING - Error code %s encountered running a sme script", rc) |
49 |
|
|
50 |
os.unlink(path) |
os.unlink(path) |
51 |
|
|
52 |
class InstallClass(baseclass): |
class InstallClass(BaseInstallClass): |
53 |
name = N_("Upgrade Existing System") |
name = N_("Upgrade Existing System") |
54 |
pixmap = "upgrade.png" |
pixmap = "upgrade.png" |
55 |
sortPriority = 999999 |
sortPriority = 999999 |
61 |
|
|
62 |
def setSteps(self, dispatch): |
def setSteps(self, dispatch): |
63 |
dispatch.setStepList( |
dispatch.setStepList( |
64 |
|
"betanag", |
65 |
"language", |
"language", |
66 |
"keyboard", |
"keyboard", |
67 |
"findrootparts", |
"findrootparts", |
72 |
"upgrademigfind", |
"upgrademigfind", |
73 |
"upgrademigratefs", |
"upgrademigratefs", |
74 |
"upgradecontinue", |
"upgradecontinue", |
75 |
"reposetup", |
"bootloadersetup", |
76 |
"upgbootloader", |
"readcomps", |
77 |
|
"findpackages", |
78 |
"checkdeps", |
"checkdeps", |
79 |
"dependencies", |
"dependencies", |
|
"postselection", |
|
80 |
"install", |
"install", |
81 |
"migratefilesystems", |
"migratefilesystems", |
82 |
"preinstallconfig", |
"preinstallconfig", |
92 |
if iutil.getPPCMachine() == "iSeries": |
if iutil.getPPCMachine() == "iSeries": |
93 |
dispatch.skipStep("bootloadersetup", skip = 0) |
dispatch.skipStep("bootloadersetup", skip = 0) |
94 |
|
|
95 |
if rhpl.getArch() != "i386" and rhpl.getArch() != "x86_64": |
if iutil.getArch() != "i386" and iutil.getArch() != "x86_64": |
96 |
dispatch.skipStep("bootloader") |
dispatch.skipStep("bootloader") |
97 |
dispatch.skipStep("bootloaderadvanced") |
dispatch.skipStep("bootloaderadvanced") |
98 |
|
|
99 |
if rhpl.getArch() != "i386" and rhpl.getArch() != "x86_64": |
if iutil.getArch() != "i386" and iutil.getArch() != "x86_64": |
100 |
dispatch.skipStep("upgbootloader") |
dispatch.skipStep("upgbootloader") |
101 |
|
|
102 |
def postAction(self, anaconda, serial): |
def postAction(self, rootPath, serial, intf): |
103 |
win = anaconda.intf.waitWindow(_("Post Upgrade Script"), |
win = intf.waitWindow(_("Post Upgrade Script"), |
104 |
_("The post upgrade script is running...")) |
_("The post upgrade script is running...")) |
105 |
|
|
106 |
script = ( "#! /bin/sh\n/sbin/syslogd ; sleep 2; /sbin/e-smith/signal-event post-upgrade\n" ) |
script = ( "/sbin/syslogd &\n" |
107 |
|
"sleep 2\n" |
108 |
|
"/sbin/e-smith/signal-event post-upgrade\n" ) |
109 |
s = Script(script, interp="/bin/sh", inChroot=1) |
s = Script(script, interp="/bin/sh", inChroot=1) |
110 |
log.info("%s", s) |
log("%s", s) |
111 |
s.run(anaconda.rootPath, serial) |
s.run(rootPath, serial) |
112 |
win.pop() |
win.pop() |
113 |
|
|
114 |
def setInstallData(self, anaconda): |
def setInstallData(self, id): |
115 |
baseclass.setInstallData(self, anaconda) |
BaseInstallClass.setInstallData(self, id) |
116 |
anaconda.id.setUpgrade(True) |
id.upgrade.set(1) |
117 |
|
|
118 |
def __init__(self, expert): |
def __init__(self, expert): |
119 |
baseclass.__init__(self, expert) |
BaseInstallClass.__init__(self, expert) |