1 |
from installclass import BaseInstallClass |
from installclass import getBaseInstallClass |
2 |
from rhpl.translate import N_, _ |
from rhpl.translate import N_, _ |
3 |
from rhpl.log import log |
|
4 |
|
import logging |
5 |
|
log = logging.getLogger("anaconda") |
6 |
|
|
7 |
from constants import * |
from constants import * |
8 |
|
|
9 |
import os |
import os |
|
import string |
|
10 |
import iutil |
import iutil |
11 |
import security |
import string |
12 |
|
import rhpl |
13 |
|
|
14 |
|
baseclass = getBaseInstallClass() |
15 |
|
|
16 |
|
|
17 |
class Script: |
class Script: |
18 |
def __repr__(self): |
def __repr__(self): |
51 |
root = scriptRoot) |
root = scriptRoot) |
52 |
|
|
53 |
if rc != 0: |
if rc != 0: |
54 |
log("WARNING - Error code %s encountered running a sme script", rc) |
log.info("WARNING - Error code %s encountered running a sme script", rc) |
55 |
|
|
56 |
os.unlink(path) |
os.unlink(path) |
57 |
|
|
58 |
class InstallClass(BaseInstallClass): |
class InstallClass(baseclass): |
59 |
name = N_("Upgrade Existing System") |
name = N_("Upgrade Existing System") |
60 |
pixmap = "upgrade.png" |
pixmap = "upgrade.png" |
61 |
sortPriority = 999999 |
sortPriority = 999999 |
77 |
"upgrademigfind", |
"upgrademigfind", |
78 |
"upgrademigratefs", |
"upgrademigratefs", |
79 |
"upgradecontinue", |
"upgradecontinue", |
80 |
"bootloadersetup", |
"reposetup", |
81 |
"readcomps", |
"upgbootloader", |
|
"findpackages", |
|
82 |
"checkdeps", |
"checkdeps", |
83 |
"dependencies", |
"dependencies", |
84 |
|
"postselection", |
85 |
"install", |
"install", |
86 |
"migratefilesystems", |
"migratefilesystems", |
87 |
"preinstallconfig", |
"preinstallconfig", |
94 |
"complete" |
"complete" |
95 |
) |
) |
96 |
|
|
97 |
def postAction(self, rootPath, serial): |
if iutil.getPPCMachine() == "iSeries": |
98 |
script = ( "/sbin/syslogd &\n" |
dispatch.skipStep("bootloadersetup", skip = 0) |
99 |
"sleep 2\n" |
|
100 |
"/sbin/e-smith/signal-event post-upgrade\n" ) |
if rhpl.getArch() != "i386" and rhpl.getArch() != "x86_64": |
101 |
s = Script(script, interp="/bin/sh", inChroot=1) |
dispatch.skipStep("bootloader") |
102 |
log("%s", s) |
dispatch.skipStep("bootloaderadvanced") |
103 |
s.run(rootPath, serial) |
|
104 |
|
if rhpl.getArch() != "i386" and rhpl.getArch() != "x86_64": |
105 |
|
dispatch.skipStep("upgbootloader") |
106 |
|
|
107 |
def setInstallData(self, id): |
def postAction(self, anaconda, serial): |
108 |
BaseInstallClass.setInstallData(self, id) |
win = anaconda.intf.waitWindow(_("Post Upgrade Script"), |
109 |
id.upgrade.set(1) |
_("The post upgrade script is running...")) |
110 |
|
|
111 |
|
script = ( "#! /bin/sh\n/sbin/syslogd ; sleep 2; /sbin/e-smith/signal-event post-upgrade\n" ) |
112 |
|
s = Script(script, interp="/bin/sh", inChroot=1) |
113 |
|
log.info("%s", s) |
114 |
|
s.run(anaconda.rootPath, serial) |
115 |
|
win.pop() |
116 |
|
|
117 |
|
def setInstallData(self, anaconda): |
118 |
|
baseclass.setInstallData(self, anaconda) |
119 |
|
anaconda.id.setUpgrade(True) |
120 |
|
|
121 |
def __init__(self, expert): |
def __init__(self, expert): |
122 |
BaseInstallClass.__init__(self, expert) |
baseclass.__init__(self, expert) |