diff options
author | wiktor w brodlo <wiktor@brodlo.net> | 2011-06-15 16:59:54 +0000 |
---|---|---|
committer | wiktor w brodlo <wiktor@brodlo.net> | 2011-06-15 16:59:54 +0000 |
commit | 2590d96369d0217e31dc2812690dde61dac417b5 (patch) | |
tree | 82276f787b08a28548e342c7921486f1acefab9f /installmethod.py | |
parent | first commit (diff) | |
download | anaconda-2590d96369d0217e31dc2812690dde61dac417b5.tar.gz anaconda-2590d96369d0217e31dc2812690dde61dac417b5.tar.bz2 anaconda-2590d96369d0217e31dc2812690dde61dac417b5.zip |
Initial import from Sabayon (ver 0.9.9.56)
Diffstat (limited to 'installmethod.py')
-rw-r--r-- | installmethod.py | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/installmethod.py b/installmethod.py new file mode 100644 index 0000000..17f1d3a --- /dev/null +++ b/installmethod.py @@ -0,0 +1,56 @@ +# +# installmethod.py - Base class for install methods +# +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +# Red Hat, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +import os, shutil, string +from constants import * + +import logging +log = logging.getLogger("anaconda") + +import isys, product + +def doMethodComplete(anaconda): + def _ejectDevice(): + # Ejecting the CD/DVD for kickstart is handled only after %post scripts + # have been run. + if anaconda.ksdata: + return None + + if anaconda.mediaDevice: + return anaconda.storage.devicetree.getDeviceByName(anaconda.mediaDevice) + + # If we booted off the boot.iso instead of disc 1, eject that as well. + if anaconda.stage2 and anaconda.stage2.startswith("cdrom://"): + dev = anaconda.stage2[8:].split(':')[0] + return anaconda.storage.devicetree.getDeviceByName(dev) + + anaconda.backend.complete(anaconda) + dev = _ejectDevice() + if dev: + dev.eject() + + mtab = "/dev/root / ext3 ro 0 0\n" + rootDevice = anaconda.storage.rootDevice + if rootDevice: + mtab = "/dev/root / %s ro 0 0\n" % rootDevice.format.type + + f = open(anaconda.rootPath + "/etc/mtab", "w+") + f.write(mtab) + f.close() |