summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rescue.py37
-rwxr-xr-xscripts/upd-instroot4
2 files changed, 35 insertions, 6 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
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index a560733f3..e08ab7a24 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -235,7 +235,7 @@ PACKAGESRESCUE="bzip2 bzip2-libs dump libidn
modutils mtools mt-st mtr net-tools open smartmontools
openssh openssh-clients pciutils rsh traceroute tar rsync
device-mapper device-mapper-libs dmraid ntfsprogs samba-client
- firstaidkit-plugin-all"
+ firstaidkit firstaidkit-plugin-all dialog"
if [ $ARCH = i386 -o $ARCH = i586 -o $ARCH = x86_64 ]; then
PACKAGESRESCUE="$PACKAGESRESCUE gpart grub"
@@ -832,6 +832,8 @@ usr/sbin/smartctl
usr/sbin/traceroute
usr/$LIBDIR/firstaidkit/plugins/
usr/lib/python?.?/site-packages/pyfirstaidkit/
+usr/bin/dialog
+usr/bin/firstaidkit-qs
EOF
if [ $ARCH = i386 -o $ARCH = i586 -o $ARCH = x86_64 ]; then