summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/cdrom.c2
-rw-r--r--mdk-stage1/directory.c2
-rw-r--r--mdk-stage1/disk.c2
-rw-r--r--mdk-stage1/stage1.h2
-rw-r--r--mdk-stage1/tools.c1
5 files changed, 6 insertions, 3 deletions
diff --git a/mdk-stage1/cdrom.c b/mdk-stage1/cdrom.c
index 1d93ed112..ff8c8d403 100644
--- a/mdk-stage1/cdrom.c
+++ b/mdk-stage1/cdrom.c
@@ -67,7 +67,7 @@ static enum return_type do_with_device(char * dev_name, char * dev_model)
#ifndef MANDRAKE_MOVE
may_load_clp();
- if (IS_RESCUE)
+ if (!KEEP_MOUNTED)
/* in rescue mode, we don't need the media anymore */
umount(IMAGE_LOCATION);
#endif
diff --git a/mdk-stage1/directory.c b/mdk-stage1/directory.c
index a968b1996..9c467cc2c 100644
--- a/mdk-stage1/directory.c
+++ b/mdk-stage1/directory.c
@@ -170,7 +170,7 @@ enum return_type try_with_directory(char *directory, char *method_live, char *me
log_message("found the " DISTRIB_NAME " Installation, good news!");
#endif
- if (IS_RESCUE || ret != RETURN_OK) {
+ if (!KEEP_MOUNTED || ret != RETURN_OK) {
/* in rescue mode, we don't need the media anymore */
umount(IMAGE_LOCATION);
del_loop(loopdev);
diff --git a/mdk-stage1/disk.c b/mdk-stage1/disk.c
index 8318bb6f4..ca3e02526 100644
--- a/mdk-stage1/disk.c
+++ b/mdk-stage1/disk.c
@@ -249,7 +249,7 @@ static enum return_type try_with_device(char *dev_name)
goto ask_dir;
}
- if (IS_RESCUE)
+ if (!KEEP_MOUNTED)
umount(disk_own_mount);
return RETURN_OK;
diff --git a/mdk-stage1/stage1.h b/mdk-stage1/stage1.h
index 99bc1b485..e3691a352 100644
--- a/mdk-stage1/stage1.h
+++ b/mdk-stage1/stage1.h
@@ -34,6 +34,7 @@ extern char * interactive_fifo;
#define MODE_EXPERT (1 << 1)
#define MODE_RESCUE (1 << 3)
#define MODE_AUTOMATIC (1 << 4)
+#define MODE_KEEP_MOUNTED (1 << 5) /* for rescue */
#define MODE_DEBUGSTAGE1 (1 << 6)
#define MODE_CHANGEDISK (1 << 10)
#define MODE_UPDATEMODULES (1 << 11)
@@ -51,6 +52,7 @@ extern char * interactive_fifo;
#define IS_NOAUTO (get_param(MODE_NOAUTO))
#define IS_NETAUTO (get_param(MODE_NETAUTO))
#define IS_RECOVERY (get_param(MODE_RECOVERY))
+#define KEEP_MOUNTED (!IS_RESCUE || get_param(MODE_KEEP_MOUNTED))
void fatal_error(char *msg) __attribute__ ((noreturn));
diff --git a/mdk-stage1/tools.c b/mdk-stage1/tools.c
index 3ae657d0a..be050376b 100644
--- a/mdk-stage1/tools.c
+++ b/mdk-stage1/tools.c
@@ -105,6 +105,7 @@ void process_cmdline(void)
if (!strcmp(name, "changedisk")) set_param(MODE_CHANGEDISK);
if (!strcmp(name, "updatemodules")) set_param(MODE_UPDATEMODULES);
if (!strcmp(name, "rescue")) set_param(MODE_RESCUE);
+ if (!strcmp(name, "keepmounted")) set_param(MODE_KEEP_MOUNTED);
if (!strcmp(name, "noauto")) set_param(MODE_NOAUTO);
if (!strcmp(name, "netauto")) set_param(MODE_NETAUTO);
if (!strcmp(name, "debugstage1")) set_param(MODE_DEBUGSTAGE1);