4 |
|
|
5 |
import os, iutil |
import os, iutil |
6 |
|
|
7 |
|
import yuminstall |
8 |
|
|
9 |
from installclass import BaseInstallClass |
from installclass import BaseInstallClass |
|
from rhel import InstallClass as SMEInstallClass |
|
10 |
from kickstart import AnacondaKSScript as Script |
from kickstart import AnacondaKSScript as Script |
11 |
|
|
12 |
from flags import flags |
from flags import flags |
13 |
from constants import * |
from constants import * |
14 |
from pykickstart.constants import * |
from pykickstart.constants import * |
15 |
|
from storage.partspec import * |
16 |
|
|
17 |
import gettext |
import gettext |
18 |
_ = lambda x: gettext.ldgettext("anaconda", x) |
_ = lambda x: gettext.ldgettext("anaconda", x) |
76 |
if serial or self.logfile: |
if serial or self.logfile: |
77 |
os.chmod("%s" % messages, 0600) |
os.chmod("%s" % messages, 0600) |
78 |
|
|
79 |
class InstallClass(SMEInstallClass): |
class InstallClass(BaseInstallClass): |
80 |
# make sure the translation data is read from product.img tree |
# make sure the translation data is read from product.img tree |
81 |
if os.path.isdir("/tmp/product/locale"): |
if os.path.isdir("/tmp/product/locale"): |
82 |
import gettext |
import gettext |
107 |
w = anaconda.intf.waitWindow(_("Post Upgrade"), |
w = anaconda.intf.waitWindow(_("Post Upgrade"), |
108 |
_("Performing post-upgrade configuration")) |
_("Performing post-upgrade configuration")) |
109 |
log.info("Running post-upgrade action script") |
log.info("Running post-upgrade action script") |
110 |
script = Script( "#!/bin/sh\n/sbin/rsyslogd ; sleep 2; /sbin/e-smith/signal-event post-upgrade\n" ) |
script = Script( "#!/bin/sh\n/sbin/rsyslogd; sleep 2; /sbin/e-smith/signal-event post-upgrade; touch /forcequotacheck\n" ) |
111 |
else: |
else: |
112 |
w = anaconda.intf.waitWindow(_("Post Installation"), |
w = anaconda.intf.waitWindow(_("Post Installation"), |
113 |
_("Performing post-installation configuration")) |
_("Performing post-installation configuration")) |
114 |
log.info("Running post-install action script") |
log.info("Running post-install action script") |
115 |
script = Script( "#!/bin/sh\n/sbin/rsyslogd ; sleep 2; /sbin/e-smith/signal-event post-install\n" ) |
script = Script( "#!/bin/sh\n/sbin/rsyslogd; sleep 2; /sbin/e-smith/signal-event post-install; touch /forcequotacheck\n" ) |
116 |
|
|
117 |
script.run(anaconda.rootPath, flags.serial, anaconda.intf) |
script.run(anaconda.rootPath, flags.serial, anaconda.intf) |
118 |
if anaconda.intf is not None: |
if anaconda.intf is not None: |
119 |
w.pop() |
w.pop() |
120 |
|
|
121 |
SMEInstallClass.postAction(self, anaconda) |
BaseInstallClass.postAction(self, anaconda) |
122 |
|
|
123 |
def setSteps(self, anaconda): |
def setSteps(self, anaconda): |
124 |
BaseInstallClass.setSteps(self, anaconda) |
BaseInstallClass.setSteps(self, anaconda) |
125 |
#anaconda.dispatch.skipStep("welcome") |
anaconda.dispatch.skipStep("welcome") |
126 |
#anaconda.dispatch.skipStep("filtertype") |
#anaconda.dispatch.skipStep("filtertype") |
127 |
anaconda.dispatch.skipStep("network") |
anaconda.dispatch.skipStep("network") |
128 |
anaconda.dispatch.skipStep("accounts") |
anaconda.dispatch.skipStep("accounts") |
131 |
anaconda.dispatch.skipStep("firstboot") |
anaconda.dispatch.skipStep("firstboot") |
132 |
|
|
133 |
def setDefaultPartitioning(self, storage, platform): |
def setDefaultPartitioning(self, storage, platform): |
134 |
autorequests = [PartSpec(mountpoint="/", fstype=storage.defaultFSType, |
autorequests = [] |
135 |
size=1024, maxSize=50*1024, grow=True, asVol=True)] |
|
136 |
|
# If user specifies "nolvm", then asVol = False; otherwise, asVol = True |
137 |
|
# If asVol = False below, then LVM won't be used |
138 |
|
|
139 |
|
asVol_flag = not flags.cmdline.has_key("nolvm") |
140 |
|
|
141 |
|
# If user specifies "noraid", then useRAID = False; otherwise, useRAID = True |
142 |
|
# If useRAID = False below, then RAID1 won't be used |
143 |
|
|
144 |
|
useRAID_flag = not flags.cmdline.has_key("noraid") |
145 |
|
|
146 |
|
fstype = "ext3" |
147 |
|
if flags.cmdline.has_key("ext4"): |
148 |
|
fstype = "ext4" |
149 |
|
|
150 |
bootreq = platform.setDefaultPartitioning() |
# /boot |
151 |
if bootreq: |
# Manually specify fstype = ext3/ext4 and size = 100 MB |
152 |
autorequests.extend(bootreq) |
# (Platform default is fstype ext4 and size = 500 MB) |
153 |
|
|
154 |
|
autorequests.append(PartSpec(mountpoint="/boot", fstype=fstype, size=100, useRAID=useRAID_flag, |
155 |
|
weight=platform.weight(mountpoint="/boot"))) |
156 |
|
|
157 |
|
# / |
158 |
|
# Manually specify fstype = ext3/ext4 and size = 2048 MB, but growable |
159 |
|
|
160 |
|
autorequests.append(PartSpec(mountpoint="/", fstype=fstype, size=2048, useRAID=useRAID_flag, |
161 |
|
grow=True, asVol=asVol_flag)) |
162 |
|
|
163 |
|
# swap |
164 |
|
# Manually specify fstype = swap and minswap < size < maxswap (growable) |
165 |
|
|
166 |
(minswap, maxswap) = iutil.swapSuggestion() |
(minswap, maxswap) = iutil.swapSuggestion() |
167 |
autorequests.append(PartSpec(fstype="swap", size=minswap, maxSize=maxswap, |
autorequests.append(PartSpec(fstype="swap", size=minswap, maxSize=maxswap, useRAID=useRAID_flag, |
168 |
grow=True, asVol=True)) |
grow=True, asVol=asVol_flag)) |
169 |
|
|
170 |
storage.autoPartitionRequests = autorequests |
storage.autoPartitionRequests = autorequests |
171 |
|
|
172 |
def setInstallData(self, anaconda): |
def setInstallData(self, anaconda): |
173 |
SMEInstallClass.setInstallData(self, anaconda) |
BaseInstallClass.setInstallData(self, anaconda) |
174 |
anaconda.id.security.setSELinux(SELINUX_DISABLED) |
anaconda.id.security.setSELinux(SELINUX_DISABLED) |
175 |
anaconda.id.storage.clearPartType = CLEARPART_TYPE_ALL |
self.setDefaultPartitioning( |
176 |
|
anaconda.id.storage, |
177 |
|
anaconda.platform) |
178 |
|
|
179 |
def productMatches(self, oldprod): |
def productMatches(self, oldprod): |
180 |
if oldprod is None: |
if oldprod is None: |
185 |
|
|
186 |
return False |
return False |
187 |
|
|
188 |
|
def getBackend(self): |
189 |
|
return yuminstall.YumBackend |
190 |
|
|
191 |
def __init__(self): |
def __init__(self): |
192 |
SMEInstallClass.__init__(self) |
BaseInstallClass.__init__(self) |