summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2006-06-16 17:31:12 +0000
committerChris Lumens <clumens@redhat.com>2006-06-16 17:31:12 +0000
commit4c2ab35d6bfd772ea45a930be520b7cd33cce7cc (patch)
treeb375e4515d04ab8e494292e4cf2923245bd4a4b3
parentf9a8423bb2a8a0cb853d1b8d957a788b27ed0950 (diff)
downloadanaconda-4c2ab35d6bfd772ea45a930be520b7cd33cce7cc.tar.gz
anaconda-4c2ab35d6bfd772ea45a930be520b7cd33cce7cc.tar.xz
anaconda-4c2ab35d6bfd772ea45a930be520b7cd33cce7cc.zip
Fix rescue mode by using text install's runShell code instead. Tested
#182222 as well, so everything should work as it's supposed to.
-rw-r--r--ChangeLog5
-rw-r--r--rescue.py50
2 files changed, 28 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index b5a98a2aa..f5ec708ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-16 Chris Lumens <clumens@redhat.com>
+
+ * rescue.py (runShell): Use shell running code from text mode instead
+ to fix ctrl-characters and other terminal weirdness in rescue mode.
+
2006-06-15 Jeremy Katz <katzj@redhat.com>
* anaconda.spec: Bump version.
diff --git a/rescue.py b/rescue.py
index a1d318842..4959cf31e 100644
--- a/rescue.py
+++ b/rescue.py
@@ -164,15 +164,24 @@ def startNetworking(network, intf):
f.write("nameserver %s\n" % (ns,))
f.close()
-
-def runShell():
- shpid = os.fork()
- if shpid == 0:
- os.setsid()
- fcntl.ioctl(0, termios.TIOCSCTTY)
- os.execv("/bin/sh", ["-/bin/sh"])
+
+def runShell(screen, msg=""):
+ screen.suspend()
+
+ print
+ if msg:
+ print (msg)
+ print _("When finished please exit from the shell and your "
+ "system will reboot.")
+ print
+
+ if os.path.exists("/bin/sh"):
+ iutil.execWithRedirect("/bin/sh", ["-/bin/sh"])
else:
- os.waitpid(shpid, 0)
+ print "Unable to find /bin/sh to execute! Not starting shell"
+ time.sleep(5)
+
+ screen.finish()
def runRescue(anaconda):
for file in [ "services", "protocols", "group", "joe", "man.config",
@@ -248,11 +257,7 @@ def runRescue(anaconda):
# Early shell access with no disk access attempts
if not anaconda.rescue_mount:
- print
- print _("When finished please exit from the shell and your "
- "system will reboot.")
- print
- runShell()
+ runShell(screen)
sys.exit(0)
# lets create some devices
@@ -284,12 +289,8 @@ def runRescue(anaconda):
[_("Continue"), _("Read-Only"), _("Skip")] )
if rc == string.lower(_("Skip")):
- screen.finish()
- print
- print _("When finished please exit from the shell and your "
- "system will reboot.")
- print
- runShell()
+ runShell(screen)
+ sys.exit(0)
elif rc == string.lower(_("Read-Only")):
readOnly = 1
else:
@@ -442,20 +443,15 @@ def runRescue(anaconda):
"automatically when you exit from the shell."),
[ _("OK") ], width = 50)
- screen.finish()
+ msgStr = ""
- print
if rootmounted and not readOnly:
makeMtab(anaconda.rootPath, fs)
try:
makeResolvConf(anaconda.rootPath)
except Exception, e:
log.error("error making a resolv.conf: %s" %(e,))
- print _("Your system is mounted under the %s directory.") % (anaconda.rootPath,)
- print
+ msgStr = _("Your system is mounted under the %s directory.") % (anaconda.rootPath,)
- print _("When finished please exit from the shell and your "
- "system will reboot.")
- print
- runShell()
+ runShell(screen, msgStr)
sys.exit(0)