diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-11-16 09:27:18 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-11-16 09:27:18 +0000 |
commit | 755e390a3e193a7c899db5a9e773cf403db31f50 (patch) | |
tree | a09451bf815883687aababfab0ba5a9213524711 /mdk-stage1/directory.c | |
parent | 12632bab895e9cd68493f120f44dbbfa6e3ab29f (diff) | |
download | drakx-755e390a3e193a7c899db5a9e773cf403db31f50.tar drakx-755e390a3e193a7c899db5a9e773cf403db31f50.tar.gz drakx-755e390a3e193a7c899db5a9e773cf403db31f50.tar.bz2 drakx-755e390a3e193a7c899db5a9e773cf403db31f50.tar.xz drakx-755e390a3e193a7c899db5a9e773cf403db31f50.zip |
major switch from ramdisk to clp
- mdkinst_stage2.bz2 is now mdkinst.clp
- rescue_stage2.bz2 is now rescue.clp
- make_mdkinst_stage2 is now mdkinst_stage2_tool
(we don't keep the live when building the clp, mdkinst_stage2_tool is able to create the clp from the live, or the live from the clp)
- all stage1 images now need cryptoloop & gzloop
- the clp can be preloaded in memory or not (see MEM_LIMIT_DRAKX_PRELOAD and MEM_LIMIT_RESCUE_PRELOAD)
(for http & ftp, it *must* be preloaded)
- we don't uncompress the ramdisk anymore since the decompression is done on the fly, this makes the rescue boot much faster
- function get_ramdisk_realname() is replaced with macro CLP_FILE_REL
Diffstat (limited to 'mdk-stage1/directory.c')
-rw-r--r-- | mdk-stage1/directory.c | 76 |
1 files changed, 25 insertions, 51 deletions
diff --git a/mdk-stage1/directory.c b/mdk-stage1/directory.c index b8ced9cff..dd4206986 100644 --- a/mdk-stage1/directory.c +++ b/mdk-stage1/directory.c @@ -117,6 +117,7 @@ enum return_type try_with_directory(char *directory, char *method_live, char *me char location_full[500]; char * loopdev = NULL; struct stat statbuf; + enum return_type ret = RETURN_OK; unlink(IMAGE_LOCATION); strcpy(location_full, directory); @@ -142,63 +143,36 @@ enum return_type try_with_directory(char *directory, char *method_live, char *me symlink(location_full + offset, IMAGE_LOCATION); add_to_env("METHOD", method_live); } -#ifndef MANDRAKE_MOVE - if (IS_RESCUE || ((loopdev || streq(method_live, "disk")) && ramdisk_possible())) { - /* RAMDISK install */ - if (access(IMAGE_LOCATION "/" RAMDISK_LOCATION_REL, R_OK)) { - stg1_error_message("I can't find the " DISTRIB_NAME " Distribution in the specified directory. " - "(I need the subdirectory " RAMDISK_LOCATION_REL ")\n" - "Here's a short extract of the files in the directory:\n" - "%s", extract_list_directory(IMAGE_LOCATION)); - umount(IMAGE_LOCATION); - del_loop(loopdev); - return RETURN_BACK; - } - if (load_ramdisk() != RETURN_OK) { - stg1_error_message("Could not load program into memory."); - umount(IMAGE_LOCATION); - del_loop(loopdev); - return RETURN_ERROR; - } - } else { -#endif - /* LIVE install */ + #ifdef MANDRAKE_MOVE - if (access(IMAGE_LOCATION "/live_tree/etc/fstab", R_OK) && access(IMAGE_LOCATION "/live_tree.clp", R_OK)) { - stg1_error_message("I can't find the " DISTRIB_NAME " Distribution in the specified directory. " - "(I need the subdirectory " IMAGE_LOCATION ")\n" - "Here's a short extract of the files in the directory:\n" - "%s", extract_list_directory(IMAGE_LOCATION)); + if (access(IMAGE_LOCATION "/live_tree/etc/fstab", R_OK) && access(IMAGE_LOCATION "/live_tree.clp", R_OK)) { + stg1_error_message("I can't find the " DISTRIB_NAME " Distribution in the specified directory. " + "(I need the file " IMAGE_LOCATION "/live_tree/etc/fstab" ")\n" + "Here's a short extract of the files in the directory:\n" + "%s", extract_list_directory(IMAGE_LOCATION)); + ret = RETURN_BACK; + } #else - char p; - if (access(IMAGE_LOCATION "/" LIVE_LOCATION_REL, R_OK)) { - stg1_error_message("I can't find the " DISTRIB_NAME " Distribution in the specified directory. " - "(I need the subdirectory " LIVE_LOCATION_REL ")\n" - "Here's a short extract of the files in the directory:\n" - "%s", extract_list_directory(IMAGE_LOCATION)); -#endif - umount(IMAGE_LOCATION); - del_loop(loopdev); - return RETURN_BACK; - } -#ifndef MANDRAKE_MOVE - if (readlink(IMAGE_LOCATION "/" LIVE_LOCATION_REL "/usr/bin/runinstall2", &p, 1) != 1) { - stg1_error_message("The " DISTRIB_NAME " Distribution seems to be copied on a Windows partition. " - "You need more memory to perform an installation from a Windows partition. " - "Another solution is to copy the " DISTRIB_NAME " Distribution on a Linux partition."); - umount(IMAGE_LOCATION); - del_loop(loopdev); - return RETURN_ERROR; - } - log_message("found the " DISTRIB_NAME " Installation, good news!"); + if (access(IMAGE_LOCATION "/" CLP_LOCATION_REL, R_OK)) { + stg1_error_message("I can't find the " DISTRIB_NAME " Distribution in the specified directory. " + "(I need the subdirectory " CLP_LOCATION_REL ")\n" + "Here's a short extract of the files in the directory:\n" + "%s", extract_list_directory(IMAGE_LOCATION)); + ret = RETURN_BACK; + } else if (may_load_clp() != RETURN_OK) { + stg1_error_message("Could not load program into memory."); + ret = RETURN_ERROR; } -#endif - if (IS_RESCUE) { + if (ret == RETURN_OK) + log_message("found the " DISTRIB_NAME " Installation, good news!"); + +#endif + if (IS_RESCUE || ret != RETURN_OK) { /* in rescue mode, we don't need the media anymore */ umount(IMAGE_LOCATION); del_loop(loopdev); - } + } - return RETURN_OK; + return ret; } |