summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-12-16 21:25:48 +0000
committerJeremy Katz <katzj@redhat.com>2002-12-16 21:25:48 +0000
commit7ddd7e521a330c87fe9d1918a780b91949c1b65e (patch)
tree7b2a8859144b24f6a5bfff490a49c94d4a6f8ffe
parentfbd43c8b0d44dbf304aa7df9174511ba7013e06c (diff)
downloadanaconda-7ddd7e521a330c87fe9d1918a780b91949c1b65e.tar.gz
anaconda-7ddd7e521a330c87fe9d1918a780b91949c1b65e.tar.xz
anaconda-7ddd7e521a330c87fe9d1918a780b91949c1b65e.zip
eject the cdrom from the second stage via a generic cleanup so that it
gets ejected when we tell people to remove their media instead of waiting until the very very end. and now we don't eject on network installs either :)
-rw-r--r--dispatch.py2
-rw-r--r--image.py16
-rw-r--r--installmethod.py9
-rw-r--r--loader2/init.c2
4 files changed, 17 insertions, 12 deletions
diff --git a/dispatch.py b/dispatch.py
index 5956a6f9e..ddb107b9a 100644
--- a/dispatch.py
+++ b/dispatch.py
@@ -36,6 +36,7 @@ from upgrade import upgradeFindPackages, upgradeMountFilesystems
from upgrade import upgradeSwapSuggestion, upgradeMigrateFind
from upgrade import findRootParts
from network import networkDeviceCheck
+from installmethod import doMethodComplete
# These are all of the install steps, in order. Note that upgrade and
# install steps are the same thing! Upgrades skip install steps, while
@@ -139,6 +140,7 @@ installSteps = [
("writexconfig", writeXConfiguration, ("id", "instPath")),
("writeksconfig", writeKSConfiguration, ("id", "instPath")),
("dopostaction", doPostAction, ("id", "instPath")),
+ ("methodcomplete", doMethodComplete, ("method",)),
("complete", ()),
]
diff --git a/image.py b/image.py
index bfa94d297..e9c6f08cd 100644
--- a/image.py
+++ b/image.py
@@ -71,7 +71,11 @@ class CdromInstallMethod(ImageInstallMethod):
"%s from the shell on tty2 "
"and then click OK to retry.")
% ("/mnt/source",))
-
+
+ def ejectCD(self):
+ if len(self.currentDisc) > 0:
+ self.unmountCD()
+ isys.ejectCdrom(self.device)
def systemUnmounted(self):
if self.loopbackFile:
@@ -81,14 +85,6 @@ class CdromInstallMethod(ImageInstallMethod):
self.loopbackFile = None
def systemMounted(self, fsset, chroot, selected):
- changeloop=0
- for p in selected:
- if p[1000002] and p[1000002] > 1:
- changeloop=1
- break
- if changeloop == 0:
- return
-
self.loopbackFile = "%s%s%s" % (chroot,
fsset.filesystemSpace(chroot)[0][0],
"/rhinstall-stage2.img")
@@ -190,7 +186,7 @@ class CdromInstallMethod(ImageInstallMethod):
break
if not done:
- isys.ejectCdrom(self.device)
+ isys.ejectCdrom("/tmp/cdrom")
while not done:
self.messageWindow(_("Change CDROM"),
diff --git a/installmethod.py b/installmethod.py
index 19b0e0d74..a89c26bf9 100644
--- a/installmethod.py
+++ b/installmethod.py
@@ -107,3 +107,12 @@ class InstallMethod:
def unmountCD(self):
pass
+ def ejectCD(self):
+ pass
+
+
+# this handles any cleanup needed for the method. it occurs *very* late
+# (ie immediately before the congratulations screen). main use right now
+# is ejecting the cdrom
+def doMethodComplete(method):
+ method.ejectCD()
diff --git a/loader2/init.c b/loader2/init.c
index 4566e32ec..694425baa 100644
--- a/loader2/init.c
+++ b/loader2/init.c
@@ -809,8 +809,6 @@ int main(int argc, char **argv) {
printf("unmounting filesystems...\n");
unmountFilesystems();
- ejectCdrom();
-
if (doReboot) {
printf("rebooting system\n");
sleep(2);