summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/directory.c
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-06-21 07:43:07 +0000
committerOlivier Blin <oblin@mandriva.org>2004-06-21 07:43:07 +0000
commit9ce5047b17c0741cc0e10e047fce3361f6a8df87 (patch)
tree3a99688f1f5e7dd532fefc7b9c979a3a85975506 /mdk-stage1/directory.c
parent3bda7d5b21793f253ef42a604217d008bd72d472 (diff)
downloaddrakx-9ce5047b17c0741cc0e10e047fce3361f6a8df87.tar
drakx-9ce5047b17c0741cc0e10e047fce3361f6a8df87.tar.gz
drakx-9ce5047b17c0741cc0e10e047fce3361f6a8df87.tar.bz2
drakx-9ce5047b17c0741cc0e10e047fce3361f6a8df87.tar.xz
drakx-9ce5047b17c0741cc0e10e047fce3361f6a8df87.zip
workaround the fact that stat() fails on large files (like DVD ISO images)
Diffstat (limited to 'mdk-stage1/directory.c')
-rw-r--r--mdk-stage1/directory.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mdk-stage1/directory.c b/mdk-stage1/directory.c
index 00c6bb872..658a209c6 100644
--- a/mdk-stage1/directory.c
+++ b/mdk-stage1/directory.c
@@ -126,7 +126,12 @@ enum return_type try_with_directory(char *directory, char *method_live, char *me
}
#endif
- if (!stat(location_full, &statbuf) && !S_ISDIR(statbuf.st_mode)) {
+ /* warning, stat() fails on large files (like DVD ISO images) */
+ if (!stat(location_full, &statbuf) && S_ISDIR(statbuf.st_mode)) {
+ log_message("assuming %s is a mirror tree", location_full);
+ symlink(location_full, IMAGE_LOCATION);
+ add_to_env("METHOD", method_live);
+ } else {
log_message("%s exists and is not a directory, assuming this is an ISO image", location_full);
if (lomount(location_full, IMAGE_LOCATION, &loopdev, 0)) {
stg1_error_message("Could not mount file %s as an ISO image of the " DISTRIB_NAME " Distribution.", location_full);
@@ -134,10 +139,6 @@ 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(location_full, IMAGE_LOCATION);
- add_to_env("METHOD", method_live);
}
#ifndef MANDRAKE_MOVE
if (IS_SPECIAL_STAGE2 || ramdisk_possible()) {