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 |
63 |
dispatch.setStepList( |
dispatch.setStepList( |
64 |
"language", |
"language", |
65 |
"keyboard", |
"keyboard", |
66 |
|
"installtype", |
67 |
"findrootparts", |
"findrootparts", |
68 |
"findinstall", |
"findinstall", |
|
"installtype", |
|
69 |
"partitionobjinit", |
"partitionobjinit", |
70 |
"upgrademount", |
"upgrademount", |
71 |
"upgrademigfind", |
"upgrademigfind", |
72 |
"upgrademigratefs", |
"upgrademigratefs", |
73 |
"upgradecontinue", |
"upgradecontinue", |
74 |
"reposetup", |
"readcomps", |
75 |
"upgbootloader", |
"findpackages", |
76 |
"checkdeps", |
"checkdeps", |
77 |
"dependencies", |
"dependencies", |
|
"postselection", |
|
78 |
"install", |
"install", |
79 |
"migratefilesystems", |
"migratefilesystems", |
80 |
"preinstallconfig", |
"preinstallconfig", |
90 |
if iutil.getPPCMachine() == "iSeries": |
if iutil.getPPCMachine() == "iSeries": |
91 |
dispatch.skipStep("bootloadersetup", skip = 0) |
dispatch.skipStep("bootloadersetup", skip = 0) |
92 |
|
|
93 |
if rhpl.getArch() != "i386" and rhpl.getArch() != "x86_64": |
if iutil.getArch() != "i386" and iutil.getArch() != "x86_64": |
94 |
dispatch.skipStep("bootloader") |
dispatch.skipStep("bootloader") |
95 |
dispatch.skipStep("bootloaderadvanced") |
dispatch.skipStep("bootloaderadvanced") |
96 |
|
|
97 |
if rhpl.getArch() != "i386" and rhpl.getArch() != "x86_64": |
if iutil.getArch() != "i386" and iutil.getArch() != "x86_64": |
98 |
dispatch.skipStep("upgbootloader") |
dispatch.skipStep("upgbootloader") |
99 |
|
|
100 |
def postAction(self, anaconda, serial): |
def postAction(self, rootPath, serial, intf): |
101 |
win = anaconda.intf.waitWindow(_("Post Upgrade Script"), |
win = intf.waitWindow(_("Post Upgrade Script"), |
102 |
_("The post upgrade script is running...")) |
_("The post upgrade script is running...")) |
103 |
|
|
104 |
script = ( "/sbin/syslogd &\n" |
script = ( "/sbin/syslogd &\n" |
105 |
"sleep 2\n" |
"sleep 2\n" |
106 |
"/sbin/e-smith/signal-event post-upgrade\n" ) |
"/sbin/e-smith/signal-event post-upgrade\n" ) |
107 |
s = Script(script, interp="/bin/sh", inChroot=1) |
s = Script(script, interp="/bin/sh", inChroot=1) |
108 |
log.info("%s", s) |
log("%s", s) |
109 |
s.run(anaconda.rootPath, serial) |
s.run(rootPath, serial) |
110 |
win.pop() |
win.pop() |
111 |
|
|
112 |
def setInstallData(self, anaconda): |
def setInstallData(self, id): |
113 |
baseclass.setInstallData(self, anaconda) |
BaseInstallClass.setInstallData(self, id) |
114 |
anaconda.id.setUpgrade(True) |
id.upgrade.set(1) |
115 |
|
|
116 |
def __init__(self, expert): |
def __init__(self, expert): |
117 |
baseclass.__init__(self, expert) |
BaseInstallClass.__init__(self, expert) |