summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xanaconda7
-rw-r--r--loader/loader.c4
-rw-r--r--loader/loader.h2
-rw-r--r--rescue.py11
4 files changed, 18 insertions, 6 deletions
diff --git a/anaconda b/anaconda
index b5dd2b64c..bcea8a682 100755
--- a/anaconda
+++ b/anaconda
@@ -55,7 +55,7 @@ try:
'method=', 'rootpath=', 'pcic=', "overhead=",
'testpath=', 'mountfs', 'traceonly', 'kickstart=',
'lang=', 'keymap=', 'kbdtype=', 'module=', 'class=',
- 'expert', 'serial', 'lowres', 'nofb', 'rescue'])
+ 'expert', 'serial', 'lowres', 'nofb', 'rescue', 'nomount'])
except TypeError, msg:
print "Error:", msg
sys.exit(-1)
@@ -112,6 +112,7 @@ localInstall = 0
reconfigOnly = 0
nofallback = 0
rescue = 0
+rescue_nomount = 0
overhead = 0
runres = '800x600'
nofbmode = 0
@@ -157,6 +158,8 @@ for n in args:
overhead = int(arg)
elif (str == '--rescue'):
progmode = 'rescue'
+ elif (str == "--nomount"):
+ rescue_nomount = 1
elif (str == '--nofallback'):
nofallback = 1
elif (str == '--module'):
@@ -211,7 +214,7 @@ if (progmode == None):
if (progmode == 'rescue'):
import rescue
- rescue.runRescue(method, serial)
+ rescue.runRescue(method, serial, not rescue_nomount)
# shouldn't get back here
sys.exit(1)
diff --git a/loader/loader.c b/loader/loader.c
index 4eb4ffa21..6bbe06294 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1954,6 +1954,8 @@ static int parseCmdLineFlags(int flags, char * cmdLine, char ** ksSource,
flags |= LOADER_FLAGS_MODDISK;
else if (!strcasecmp(argv[i], "rescue"))
flags |= LOADER_FLAGS_RESCUE;
+ else if (!strcasecmp(argv[i], "nomount"))
+ flags |= LOADER_FLAGS_RESCUE_NOMOUNT;
else if (!strncasecmp(argv[i], "ksdevice=", 9)) {
*ksDevice = argv[i] + 9;
} else if (!strcasecmp(argv[i], "serial"))
@@ -2838,6 +2840,8 @@ int main(int argc, char ** argv) {
} while (rc);
}
*argptr++ = "--rescue";
+ if (FL_RESCUE_NOMOUNT(flags))
+ *argptr++ = "--nomount";
} else {
if (FL_SERIAL(flags))
*argptr++ = "--serial";
diff --git a/loader/loader.h b/loader/loader.h
index 21eb3902b..bbe8e8c5a 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -24,6 +24,7 @@
#define LOADER_FLAGS_LOWRES (1 << 18)
#define LOADER_FLAGS_NOFB (1 << 19)
#define LOADER_FLAGS_NOPCMCIA (1 << 20)
+#define LOADER_FLAGS_RESCUE_NOMOUNT (1 << 21)
#define FL_TESTING(a) ((a) & LOADER_FLAGS_TESTING)
#define FL_EXPERT(a) ((a) & LOADER_FLAGS_EXPERT)
@@ -46,6 +47,7 @@
#define FL_LOWRES(a) ((a) & LOADER_FLAGS_LOWRES)
#define FL_NOFB(a) ((a) & LOADER_FLAGS_NOFB)
#define FL_NOPCMCIA(a) ((a) & LOADER_FLAGS_NOPCMCIA)
+#define FL_RESCUE_NOMOUNT(a) ((a) & LOADER_FLAGS_RESCUE_NOMOUNT)
#define CODE_PCMCIA 1
diff --git a/rescue.py b/rescue.py
index 6697f5a43..7758125c7 100644
--- a/rescue.py
+++ b/rescue.py
@@ -24,7 +24,7 @@ class RescueInterface:
def __init__(self, screen):
self.screen = screen
-def runRescue(url, serial):
+def runRescue(url, serial, mountroot):
from fstab import NewtFstab
@@ -32,6 +32,12 @@ def runRescue(url, serial):
log.open (serial, 0, 0, 1)
+ for file in [ "services", "protocols", "group" ]:
+ os.symlink('/mnt/runtime/etc/' + file, '/etc/' + file)
+
+ if (not mountroot):
+ os.execv("/bin/sh", [ "-/bin/sh" ])
+
try:
fstab = NewtFstab(1, serial, 0, 0, None, None, None, 0, [], 0, 0,
requireBlockDevices = 0)
@@ -133,9 +139,6 @@ def runRescue(url, serial):
screen.finish()
- for file in [ "services", "protocols", "group" ]:
- os.symlink('/mnt/runtime/etc/' + file, '/etc/' + file)
-
if rootmounted:
print
print _("Your system is mounted under the /mnt/sysimage directory.")