55 |
sys.exit(0) |
sys.exit(0) |
56 |
return DISPATCH_FORWARD |
return DISPATCH_FORWARD |
57 |
|
|
58 |
def doPostAction(id, instPath): |
def doPostAction(id, instPath, intf): |
59 |
id.instClass.postAction(instPath, flags.serial) |
id.instClass.postAction(instPath, flags.serial, intf) |
60 |
|
|
61 |
def firstbootConfiguration(id, instPath): |
def firstbootConfiguration(id, instPath): |
62 |
if id.firstboot == FIRSTBOOT_RECONFIG: |
if id.firstboot == FIRSTBOOT_RECONFIG: |
643 |
|
|
644 |
if not upgrade: |
if not upgrade: |
645 |
foundkernel = 0 |
foundkernel = 0 |
646 |
if isys.smpAvailable() or isys.htavailable(): |
nthreads = isys.acpicpus() |
647 |
if select(id.grpset.hdrlist, 'kernel-smp'): |
|
648 |
|
if nthreads == 0: |
649 |
|
# this should probably be table driven or something... |
650 |
|
ncpus = isys.smpAvailable() or 1 |
651 |
|
nthreads = isys.htavailable() or 1 |
652 |
|
ncores = isys.coresavailable() |
653 |
|
|
654 |
|
if ncpus == 1: # machines that have one socket |
655 |
|
nthreads = nthreads; |
656 |
|
else: # machines with more than one socket |
657 |
|
nthreads = (nthreads / ncores) * ncpus |
658 |
|
|
659 |
|
largesmp_min = -1 |
660 |
|
if iutil.getArch() == "x86_64": |
661 |
|
largesmp_min = 8 |
662 |
|
elif iutil.getArch() == "ppc" and iutil.getPPCMachine() != "iSeries": |
663 |
|
largesmp_min = 64 |
664 |
|
elif iutil.getArch() == "ia64": |
665 |
|
largesmp_min = 64 |
666 |
|
|
667 |
|
if largesmp_min > 0 and nthreads > largesmp_min and \ |
668 |
|
select(id.grpset.hdrlist, "kernel-largesmp"): |
669 |
|
foundKernel = 1 |
670 |
|
if selected(id.grpset.hdrlist, "gcc"): |
671 |
|
select(id.grpset.hdrlist, "kernel-largesmp-devel") |
672 |
|
elif nthreads > 1: |
673 |
|
if select(id.grpset.hdrlist, "kernel-smp"): |
674 |
foundkernel = 1 |
foundkernel = 1 |
675 |
if selected(id.grpset.hdrlist, "gcc"): |
if selected(id.grpset.hdrlist, "gcc"): |
676 |
select(id.grpset.hdrlist, "kernel-smp-devel") |
select(id.grpset.hdrlist, "kernel-smp-devel") |
686 |
if foundkernel == 0: |
if foundkernel == 0: |
687 |
# we *always* need to have some sort of kernel installed |
# we *always* need to have some sort of kernel installed |
688 |
select(id.grpset.hdrlist, 'kernel') |
select(id.grpset.hdrlist, 'kernel') |
689 |
if selected(id.grpset.hdrlist, "gcc"): |
|
690 |
select(id.grpset.hdrlist, "kernel-devel") |
if (selected(id.grpset.hdrlist, "gcc") and |
691 |
|
selected(id.grpset.hdrlist, "kernel")): |
692 |
|
select(id.grpset.hdrlist, "kernel-devel") |
693 |
|
|
694 |
# if NIS is configured, install ypbind and dependencies: |
# if NIS is configured, install ypbind and dependencies: |
695 |
if id.auth.useNIS: |
if id.auth.useNIS: |
891 |
for pkg in id.upgradeRemove: |
for pkg in id.upgradeRemove: |
892 |
ts.addErase(pkg) |
ts.addErase(pkg) |
893 |
|
|
894 |
|
# set the rpm log file to /dev/null so that we don't segfault |
895 |
|
f = open("/dev/null", "w+") |
896 |
|
rpm.setLogFile(f) |
897 |
|
ts.scriptFd = f.fileno() |
898 |
|
|
899 |
# if we hit problems, it's not like there's anything we can |
# if we hit problems, it's not like there's anything we can |
900 |
# do about it |
# do about it |
901 |
ts.run(install_callback, 0) |
ts.run(install_callback, 0) |
926 |
|
|
927 |
progress.pop() |
progress.pop() |
928 |
|
|
929 |
|
# set the rpm log file to /dev/null to start with so we don't segfault |
930 |
|
f = open("/dev/null", "w+") |
931 |
|
rpm.setLogFile(f) |
932 |
|
ts.scriptFd = f.fileno() |
933 |
|
|
934 |
depcheck = DependencyChecker(id.grpset) |
depcheck = DependencyChecker(id.grpset) |
935 |
if not id.grpset.hdrlist.preordered(): |
if not id.grpset.hdrlist.preordered(): |
936 |
log ("WARNING: not all packages in hdlist had order tag") |
log ("WARNING: not all packages in hdlist had order tag") |
937 |
# have to call ts.check before ts.order() to set up the alIndex |
# have to call ts.check before ts.order() to set up the alIndex |
938 |
ts.check(depcheck.callback) |
ts.check(depcheck.callback) |
939 |
|
log ("did ts.check, doing ts.order") |
940 |
ts.order() |
ts.order() |
941 |
|
log ("ts.order is done") |
942 |
else: |
else: |
943 |
ts.check(depcheck.callback) |
ts.check(depcheck.callback) |
944 |
|
|
977 |
instLog.write(_("Installing %s packages\n\n") % (num,)) |
instLog.write(_("Installing %s packages\n\n") % (num,)) |
978 |
|
|
979 |
ts.scriptFd = instLog.fileno () |
ts.scriptFd = instLog.fileno () |
980 |
|
log ("setting rpm logfile") |
981 |
rpm.setLogFile(instLog) |
rpm.setLogFile(instLog) |
982 |
# the transaction set dup()s the file descriptor and will close the |
# the transaction set dup()s the file descriptor and will close the |
983 |
# dup'd when we go out of scope |
# dup'd when we go out of scope |
984 |
|
|
985 |
if upgrade: |
if upgrade: |
986 |
modeText = _("Upgrading %s\n") |
modeText = _("Upgrading %s.\n") |
987 |
else: |
else: |
988 |
modeText = _("Installing %s\n") |
modeText = _("Installing %s.\n") |
989 |
|
|
990 |
|
log ("getting rpm error class") |
991 |
errors = rpmErrorClass(instLog) |
errors = rpmErrorClass(instLog) |
992 |
pkgTimer = timer.Timer(start = 0) |
pkgTimer = timer.Timer(start = 0) |
993 |
|
|
1011 |
cb.initWindow = intf.waitWindow(_("Install Starting"), |
cb.initWindow = intf.waitWindow(_("Install Starting"), |
1012 |
_("Starting install process, this may take several minutes...")) |
_("Starting install process, this may take several minutes...")) |
1013 |
|
|
1014 |
|
log ("setting problem filter") |
1015 |
ts.setProbFilter(~rpm.RPMPROB_FILTER_DISKSPACE) |
ts.setProbFilter(~rpm.RPMPROB_FILTER_DISKSPACE) |
1016 |
problems = ts.run(cb.cb, 0) |
problems = ts.run(cb.cb, 0) |
1017 |
|
|
1136 |
arch = iutil.getArch () |
arch = iutil.getArch () |
1137 |
|
|
1138 |
if upgrade: |
if upgrade: |
1139 |
w = intf.progressWindow(_("Post Upgrade"), |
w = intf.progressWindow(_("Post Upgrade"), |
1140 |
_("Performing post upgrade configuration..."), 6) |
_("Performing post upgrade configuration..."), 6) |
|
else: |
|
|
w = intf.progressWindow(_("Post Install"), |
|
|
_("Performing post install configuration..."), 6) |
|
|
|
|
|
if upgrade: |
|
1141 |
logname = '/root/upgrade.log' |
logname = '/root/upgrade.log' |
1142 |
else: |
else: |
1143 |
|
w = intf.progressWindow(_("Post Install"), |
1144 |
|
_("Performing post install configuration..."), 6) |
1145 |
logname = '/root/install.log' |
logname = '/root/install.log' |
1146 |
|
|
1147 |
instLogName = instPath + logname |
instLogName = instPath + logname |
1286 |
h = ts.hdrFromFdno(fd) |
h = ts.hdrFromFdno(fd) |
1287 |
os.close(fd) |
os.close(fd) |
1288 |
if upgrade: |
if upgrade: |
1289 |
text = _("Upgrading %s\n") |
text = _("Upgrading %s.\n") |
1290 |
else: |
else: |
1291 |
text = _("Installing %s\n") |
text = _("Installing %s.\n") |
1292 |
instLog.write (text % (hdrlist.nevra(h))) |
instLog.write(text % (hdrlist.nevra(h))) |
1293 |
os.unlink(id.compspkg) |
os.unlink(id.compspkg) |
1294 |
del ts |
del ts |
1295 |
|
|
1321 |
lines = [] |
lines = [] |
1322 |
for p in id.grpset.hdrlist.values(): |
for p in id.grpset.hdrlist.values(): |
1323 |
if not p.isSelected(): |
if not p.isSelected(): |
1324 |
text = "%s" % hdrlist.nevra(p) |
text = "%s" % (hdrlist.nevra(p)) |
1325 |
for f in ts.dbMatch('name', p.hdr[rpm.RPMTAG_NAME]): |
for f in ts.dbMatch('name', p.hdr[rpm.RPMTAG_NAME]): |
1326 |
if hdrlist.nevra(p) == hdrlist.nevra(f): |
if hdrlist.nevra(p) == hdrlist.nevra(f): |
1327 |
text = "%s (already installed)" % text |
text = "%s (already installed)" % (text) |
1328 |
else: |
else: |
1329 |
text = "%s (%s installed)" % (text, hdrlist.nevra(f)) |
text = "%s (%s installed)" % (text, hdrlist.nevra(f)) |
1330 |
lines.append("%s\n" % text) |
lines.append("%s\n" % text) |
1332 |
for line in lines: |
for line in lines: |
1333 |
instLog.write(line) |
instLog.write(line) |
1334 |
|
|
1335 |
|
|
1336 |
# XXX hack - we should really write a proper lvm "config". but for now |
# XXX hack - we should really write a proper lvm "config". but for now |
1337 |
# just vgscan if they have /sbin/lvm and some appearance of volumes |
# just vgscan if they have /sbin/lvm and some appearance of volumes |
1338 |
if (os.access(instPath + "/sbin/lvm", os.X_OK) and |
if (os.access(instPath + "/sbin/lvm", os.X_OK) and |