summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/config-stage1.h6
-rw-r--r--mdk-stage1/directory.c5
2 files changed, 7 insertions, 4 deletions
diff --git a/mdk-stage1/config-stage1.h b/mdk-stage1/config-stage1.h
index a24c0cf0c..464fb38a5 100644
--- a/mdk-stage1/config-stage1.h
+++ b/mdk-stage1/config-stage1.h
@@ -35,7 +35,8 @@
#ifdef MANDRAKE_MOVE
#define MEM_LIMIT_MOVE 120
#define DISTRIB_NAME "Mandrakemove"
-#define IMAGE_LOCATION SLASH_LOCATION "/cdrom"
+#define IMAGE_LOCATION_DIR SLASH_LOCATION
+#define IMAGE_LOCATION IMAGE_LOCATION_DIR "cdrom"
#define IMAGE_LOCATION_REAL SLASH_LOCATION "/image"
#define RAW_LOCATION_REL "/cdrom"
#define STAGE2_LOCATION_REL "/image"
@@ -46,7 +47,8 @@
#else
#define DISTRIB_NAME "Mandrakelinux"
-#define IMAGE_LOCATION SLASH_LOCATION "/tmp/image"
+#define IMAGE_LOCATION_DIR SLASH_LOCATION "/tmp/"
+#define IMAGE_LOCATION IMAGE_LOCATION_DIR "image"
#define IMAGE_LOCATION_REAL "/tmp/image"
#define STAGE2_LOCATION_REL "/tmp/stage2"
#endif
diff --git a/mdk-stage1/directory.c b/mdk-stage1/directory.c
index 30f3b29a5..f71cf8ad4 100644
--- a/mdk-stage1/directory.c
+++ b/mdk-stage1/directory.c
@@ -137,8 +137,9 @@ enum return_type try_with_directory(char *directory, char *method_live, char *me
add_to_env("ISOPATH", location_full);
add_to_env("METHOD", method_iso);
} else {
- log_message("assuming %s is a mirror tree", location_full);
- symlink(basename(location_full), IMAGE_LOCATION);
+ int offset = strncmp(location_full, IMAGE_LOCATION_DIR, sizeof(IMAGE_LOCATION_DIR) - 1) == 0 ? sizeof(IMAGE_LOCATION_DIR) - 1 : 0;
+ log_message("assuming %s is a mirror tree", location_full + offset);
+ symlink(location_full + offset, IMAGE_LOCATION);
add_to_env("METHOD", method_live);
}
#ifndef MANDRAKE_MOVE