summaryrefslogtreecommitdiffstats
path: root/rescue.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2001-08-01 20:38:42 +0000
committerJeremy Katz <katzj@redhat.com>2001-08-01 20:38:42 +0000
commit9254e7eac4a794ffe3bf1dcdb52aeef100d59b97 (patch)
treebe9f73fc65c99ce058f17bd2541941cf0c422305 /rescue.py
parent86f36a988adf17033bb312b38e191ca9c4113eab (diff)
downloadanaconda-9254e7eac4a794ffe3bf1dcdb52aeef100d59b97.tar.gz
anaconda-9254e7eac4a794ffe3bf1dcdb52aeef100d59b97.tar.xz
anaconda-9254e7eac4a794ffe3bf1dcdb52aeef100d59b97.zip
make an mtab in rescue mode so grub-install can work
Diffstat (limited to 'rescue.py')
-rw-r--r--rescue.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/rescue.py b/rescue.py
index ad72c2a7b..a13a3b00b 100644
--- a/rescue.py
+++ b/rescue.py
@@ -38,6 +38,26 @@ class RescueInterface:
def __init__(self, screen):
self.screen = screen
+# XXX grub-install is stupid and uses df output to figure out
+# things when installing grub. make /etc/mtab be at least
+# moderately useful.
+def makeMtab(instPath):
+ child = os.fork()
+ if (not child):
+ isys.chroot(instPath)
+ f = open("/proc/mounts", "r")
+ lines = f.readlines()
+ f.close()
+ f = open("/etc/mtab", "w+")
+ for line in lines:
+ # and of course we don't want to reference dev nodes in /tmp
+ if line[0:5] == "/tmp/":
+ f.write("/dev/%s" % (line[5:]))
+ else:
+ f.write(line)
+ f.close()
+ sys.exit(0)
+
def runRescue(instPath, mountroot, id):
for file in [ "services", "protocols", "group" ]:
@@ -157,6 +177,7 @@ def runRescue(instPath, mountroot, id):
print
if rootmounted:
+ makeMtab("/mnt/sysimage")
print _("Your system is mounted under the /mnt/sysimage directory.")
print