summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-11-04 17:59:25 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-11-04 17:59:25 +0000
commit7e51f93bebf1015500cb0786254963aa2a3d21ce (patch)
tree905a6e0e48aa09e26cdd6df4e316aa72bb41450b
parent53b29b4e08fb1f5c5e55f24aa8bd0030f0a7399c (diff)
downloaddrakx-7e51f93bebf1015500cb0786254963aa2a3d21ce.tar
drakx-7e51f93bebf1015500cb0786254963aa2a3d21ce.tar.gz
drakx-7e51f93bebf1015500cb0786254963aa2a3d21ce.tar.bz2
drakx-7e51f93bebf1015500cb0786254963aa2a3d21ce.tar.xz
drakx-7e51f93bebf1015500cb0786254963aa2a3d21ce.zip
hack up a warning message when we're in low mem. chosen 120 mbytes, need to be refined later.
-rw-r--r--mdk-stage1/config-stage1.h1
-rw-r--r--mdk-stage1/stage1.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/mdk-stage1/config-stage1.h b/mdk-stage1/config-stage1.h
index fea665858..1962bf6f3 100644
--- a/mdk-stage1/config-stage1.h
+++ b/mdk-stage1/config-stage1.h
@@ -32,6 +32,7 @@
#define STAGE2_LOCATION "/tmp/stage2"
#ifdef MANDRAKE_MOVE
+#define MEM_LIMIT_MOVE 120
#define DISTRIB_NAME "Mandrake Move"
#define IMAGE_LOCATION "/sysroot/image_raw"
#define IMAGE_LOCATION_REAL "/sysroot/image"
diff --git a/mdk-stage1/stage1.c b/mdk-stage1/stage1.c
index 618f393c7..8f92e7f98 100644
--- a/mdk-stage1/stage1.c
+++ b/mdk-stage1/stage1.c
@@ -588,6 +588,9 @@ int main(int argc __attribute__ ((unused)), char **argv __attribute__ ((unused))
}
#ifdef MANDRAKE_MOVE
+ if (total_memory() < MEM_LIMIT_MOVE)
+ stg1_error_message(DISTRIB_NAME " typically needs more than %d Mbytes of memory (detected %d Mbytes). You may proceed, but the machine may crash or lock up for no apparent reason. Continue at your own risk. Alternatively, you may reboot your system now.",
+ MEM_LIMIT_MOVE, total_memory());
if (mandrake_move_pre() != RETURN_OK)
stg1_error_message("Fatal error when preparing Mandrake Move.");
#endif