diff options
author | Jeremy Katz <katzj@redhat.com> | 2001-08-01 20:38:42 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2001-08-01 20:38:42 +0000 |
commit | 9254e7eac4a794ffe3bf1dcdb52aeef100d59b97 (patch) | |
tree | be9f73fc65c99ce058f17bd2541941cf0c422305 /rescue.py | |
parent | 86f36a988adf17033bb312b38e191ca9c4113eab (diff) | |
download | anaconda-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.py | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 |