diff options
author | Chris Lumens <clumens@redhat.com> | 2008-08-04 11:43:01 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2008-08-04 15:48:17 -0400 |
commit | 7d5f82a950268a38d8af59921f4d9658e65af886 (patch) | |
tree | 982ec69f6fd0849287f13beb7f195c23999530b0 | |
parent | 0288ad4cdb14ccf576fc7df719862badc7f57702 (diff) | |
download | anaconda-7d5f82a950268a38d8af59921f4d9658e65af886.tar.gz anaconda-7d5f82a950268a38d8af59921f4d9658e65af886.tar.xz anaconda-7d5f82a950268a38d8af59921f4d9658e65af886.zip |
Eject the CD/DVD if we booted off a boot.iso as well (#442088).
-rwxr-xr-x | anaconda | 4 | ||||
-rw-r--r-- | installmethod.py | 20 |
2 files changed, 21 insertions, 3 deletions
@@ -482,6 +482,7 @@ class Anaconda: self.dir = None self.id = None self.methodstr = None + self.stage2 = None self.backend = None self.rootPath = None self.dispatch = None @@ -643,6 +644,9 @@ if __name__ == "__main__": else: anaconda.methodstr = None + if opts.stage2: + anaconda.stage2 = opts.stage2 + if opts.liveinst: flags.livecdInstall = True diff --git a/installmethod.py b/installmethod.py index 77f4a39e3..b69225bc0 100644 --- a/installmethod.py +++ b/installmethod.py @@ -27,10 +27,24 @@ log = logging.getLogger("anaconda") import isys, product def doMethodComplete(anaconda): - anaconda.backend.complete(anaconda) + def _ejectDevice(): + # Ejecting the CD/DVD for kickstart is handled only after %post scripts + # have been run. + if anaconda.isKickstart: + return None + + if anaconda.mediaDevice: + return anaconda.mediaDevice - if not anaconda.isKickstart and anaconda.mediaDevice: - isys.ejectCdrom(anaconda.mediaDevice) + # If we booted off the boot.iso instead of disc 1, eject that as well. + if anaconda.stage2.startswith("cdrom://"): + dev = anaconda.stage2[8:].split(':')[0] + return dev + + anaconda.backend.complete(anaconda) + dev = _ejectDevice() + if dev: + isys.ejectCdrom(dev) mtab = "/dev/root / ext3 ro 0 0\n" for ent in anaconda.id.fsset.entries: |