summaryrefslogtreecommitdiffstats
path: root/rescue.py
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2009-07-13 13:52:11 +0200
committerMartin Sivak <msivak@redhat.com>2009-07-16 15:18:48 +0200
commit4aa290945425bea0733f73259b9adf4d6a95c6f5 (patch)
tree52929430bd2242ab344b236a9d95fc67b76f45a7 /rescue.py
parente2d532baf31ec5f62e6d98de15e0d809bfed189b (diff)
downloadanaconda-4aa290945425bea0733f73259b9adf4d6a95c6f5.tar.gz
anaconda-4aa290945425bea0733f73259b9adf4d6a95c6f5.tar.xz
anaconda-4aa290945425bea0733f73259b9adf4d6a95c6f5.zip
Run firstaidkit-qs script instead of the shell (shows rescue menu) (#508512)
Add dialog package required for firstaidkit Create /etc/fstab in ramdisk to make mount commands easier (#440327)
Diffstat (limited to 'rescue.py')
-rw-r--r--rescue.py37
1 files changed, 32 insertions, 5 deletions
diff --git a/rescue.py b/rescue.py
index 665c56c04..11da10869 100644
--- a/rescue.py
+++ b/rescue.py
@@ -34,6 +34,7 @@ import iutil
import shutil
import time
import network
+import subprocess
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -128,6 +129,22 @@ def makeMtab(instPath, fsset):
finally:
f.close()
+def makeFStab(instPath = ""):
+ if os.access("/etc/mtab", os.R_OK):
+ f = open("/etc/mtab" %(instPath,), "r")
+ buf = f.read()
+ f.close()
+ else:
+ buf = ""
+
+ try:
+ f = open(instPath + "/etc/fstab", "w+")
+ if buf:
+ f.write(buf)
+ f.close()
+ except IOError, e:
+ log.info("failed to write /etc/fstab: %s" % e)
+
# make sure they have a resolv.conf in the chroot
def makeResolvConf(instPath):
if not os.access("/etc/resolv.conf", os.R_OK):
@@ -183,11 +200,18 @@ def runShell(screen = None, msg=""):
"system will reboot."))
print
- if os.path.exists("/bin/bash"):
- iutil.execConsole()
- else:
- print(_("Unable to find /bin/sh to execute! Not starting shell"))
- time.sleep(5)
+ proc = None
+
+ if os.path.exists("/usr/bin/firstaidkit-qs") and os.path.exists("/usr/bin/dialog"):
+ proc = subprocess.Popen(["/bin/firstaidkit-qs"])
+ proc.wait()
+
+ if proc is None or proc.returncode!=0:
+ if os.path.exists("/bin/bash"):
+ iutil.execConsole()
+ else:
+ print(_("Unable to find /bin/sh to execute! Not starting shell"))
+ time.sleep(5)
if screen:
screen.finish()
@@ -436,6 +460,9 @@ def runRescue(anaconda, instClass):
log.error("error making a resolv.conf: %s" %(e,))
msgStr = _("Your system is mounted under the %s directory.") % (anaconda.rootPath,)
+ #create /etc/fstab in ramdisk, so it is easier to work with RO mounted filesystems
+ makeFStab()
+
# run %post if we've mounted everything
if anaconda.isKickstart:
from kickstart import runPostScripts