diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | docs/README | 53 | ||||
-rw-r--r-- | kernel/list_modules.pm | 2 | ||||
-rw-r--r-- | mdk-stage1/Makefile | 6 | ||||
-rw-r--r-- | mdk-stage1/cdrom.c | 3 | ||||
-rw-r--r-- | mdk-stage1/config-stage1.h | 17 | ||||
-rw-r--r-- | mdk-stage1/directory.c | 76 | ||||
-rw-r--r-- | mdk-stage1/disk.c | 3 | ||||
-rw-r--r-- | mdk-stage1/network.c | 10 | ||||
-rw-r--r-- | mdk-stage1/tools.c | 116 | ||||
-rw-r--r-- | mdk-stage1/tools.h | 9 | ||||
-rw-r--r-- | perl-install/Makefile | 8 | ||||
-rw-r--r-- | rescue/.cvsignore | 2 | ||||
-rw-r--r-- | rescue/Makefile | 8 | ||||
-rwxr-xr-x | rescue/make_rescue_img | 28 |
15 files changed, 94 insertions, 249 deletions
@@ -74,7 +74,7 @@ upload_only: upload $(STAGE2_DEST) '*_stage2.bz2' ;\ upload $(EXTRA_INSTALL_DEST)/advertising '' ;\ upload $(MISC_DEST) gendistrib ;\ - upload $(MISC_DEST) make_mdkinst_stage2 ;\ + upload $(MISC_DEST) mdkinst_stage2_tool ;\ upload $(MISC_DEST) packdrake ;\ upload $(MISC_DEST) packdrake.pm ;\ upload $(MISC_DEST) auto ;\ diff --git a/docs/README b/docs/README index d14120c5d..3d230af4f 100644 --- a/docs/README +++ b/docs/README @@ -51,7 +51,8 @@ For one CD or a network/hd volume, please use media/main. Optionnally, you can modify ``media/media_info/rpmsrate''; this file manages the relative importance of the files, and thus their installation or not. -Also, mdkinst_stage2.gz must be remade if you modify files in install/stage2/live. +To modify the code of stage2, use "misc/mdkinst_stage2_tool install/stage2" to generate "install/stage2/live". +When you are done use "misc/mdkinst_stage2_tool install/stage2" again, the "rm -rf install/stage/live". See below for information about these files. ******************************************************************************** @@ -102,15 +103,13 @@ install/stage2/live live system used on certain installs. See ``Ramdisk or not'' below for more. -install/stage2/mdkinst_stage2.bz2 - for the ramdisk. live sytem in ext2 filesystem bzipped2. - generated from install/stage2/live tree using misc/make_mdkinst_stage2 - See ``Ramdisk or not'' below for more. +install/stage2/mdkinst.clp + for the compressed loopback of install. + generated from install/stage2/live tree using misc/mdkinst_stage2_tool -install/stage2/rescue_stage2.bz2 - rescue ramdisk. live sytem in ext2 filesystem bzipped2. +install/stage2/rescue.clp + rescue ramdisk. create_compressed_fs iso file this is the ramdisk loaded when typing rescue on boot prompt. - there is no live system available, only the ramdisk is used. install/images/*.img floppy boot images to use with DrakX. Use: @@ -160,9 +159,6 @@ set to developer (!)... DrakX uses .po files for its translation. A script takes the different strings out of the .pm files. It generates the DrakX.pot file which contains all the english strings to translate. -To add a new language, you just have to add it to lang.pm (if it's not there -already) and put the .po in the perl-install/po directory (see ``Ramdisk or -not'' to know if you have to regenerate the mdkinst_stage2.gz) ******************************************************************************** * PCMCIA install *************************************************************** @@ -170,41 +166,6 @@ not'' to know if you have to regenerate the mdkinst_stage2.gz) If the media you use to install is a pcmcia device, use the pcmcia boot disk. ******************************************************************************** -* Ramdisk or not *************************************************************** -******************************************************************************** -The DrakX install is much bigger than the newt one. So the ramdisk which was -used is getting big, and costs a lot in memory -(eg: the mdkinst_stage2 is 14MB - 23/09/99) -(update! now size is 21MB - 24/01/01) -(update! now size is 19MB - 26/04/01) - -| | newt | DrakX -|-------+---------+---------------------------------------------------------- -| nfs | live | live -| ftp | ramdisk | ramdisk -| http | ramdisk | ramdisk -| hd | ramdisk | live if install/stage2/live/usr/bin/runinstall2 is a link, -| | | ramdisk otherwise -| cdrom | ramdisk | live if memory < 52MB, ramdisk otherwise - -Where ramdisk is needed, if detected memory is below the limit allowed for -ramdisk (maintained in file gi/mdk-stage1/config-stage1.h; currently 52 Mb), -a failure dialog will be printed explaining that there is not enough memory -to perform the installation. - -When i say live, it means that the stage1 will *mount* the -install/stage2/live and use it that way. - -The ramdisk is used in place of the live in some cases. This ramdisk is filled -with mdkinst_stage2.gz - -For cdrom install, the ramdisk is used to speed up things (access time is quite -high on cdrom drives) - -For pcmcia, it depends on the type of install. - - -******************************************************************************** * modules ********************************************************************** ******************************************************************************** Modules can be found in at least 2 places: diff --git a/kernel/list_modules.pm b/kernel/list_modules.pm index c1a8e2280..9ddd3b5e6 100644 --- a/kernel/list_modules.pm +++ b/kernel/list_modules.pm @@ -122,7 +122,7 @@ our %l = ( { network => [ qw(af_packet nfs) ], cdrom => [ qw(isofs) ], - loopback => [ qw(isofs loop), if_($ENV{MOVE}, qw(cryptoloop gzloop supermount)) ], + loopback => [ qw(isofs loop cryptoloop gzloop), if_($ENV{MOVE}, qw(supermount)) ], local => [ if_(arch() =~ /^i.86|x86_64/, qw(vfat ntfs)), if_(arch() =~ /^ppc/, qw(hfs)), diff --git a/mdk-stage1/Makefile b/mdk-stage1/Makefile index 83672a25c..543115741 100644 --- a/mdk-stage1/Makefile +++ b/mdk-stage1/Makefile @@ -111,10 +111,10 @@ STAGE1_NETWORK_LIBS = /usr/$(LIB)/libresolv.a endif #- stage1 itself -STAGE1SRC = stage1.c log.c tools.c modules.c probing.c mount.c automatic.c frontend-common.c +STAGE1SRC = stage1.c log.c tools.c modules.c probing.c mount.c automatic.c frontend-common.c lomount.c CDROMSRC = cdrom.c -DISKSRC = disk.c directory.c lomount.c -NETWORKSRC = network.c nfsmount.c dhcp.c url.c dns.c adsl.c directory.c lomount.c +DISKSRC = disk.c directory.c +NETWORKSRC = network.c nfsmount.c dhcp.c url.c dns.c adsl.c directory.c # use sort to remove duplicates STAGE1_ALLSRC = $(sort $(STAGE1SRC) $(CDROMSRC) $(DISKSRC) $(NETWORKSRC)) diff --git a/mdk-stage1/cdrom.c b/mdk-stage1/cdrom.c index acb202628..f226020c4 100644 --- a/mdk-stage1/cdrom.c +++ b/mdk-stage1/cdrom.c @@ -65,8 +65,7 @@ static enum return_type do_with_device(char * dev_name, char * dev_model) log_message("found a " DISTRIB_NAME " CDROM, good news!"); #ifndef MANDRAKE_MOVE - if (IS_RESCUE || ramdisk_possible()) - load_ramdisk(); /* we don't care about return code, we'll do it live if we failed */ + may_load_clp(); if (IS_RESCUE) /* in rescue mode, we don't need the media anymore */ diff --git a/mdk-stage1/config-stage1.h b/mdk-stage1/config-stage1.h index df0646855..662ad4fb5 100644 --- a/mdk-stage1/config-stage1.h +++ b/mdk-stage1/config-stage1.h @@ -20,14 +20,15 @@ /* If we have more than that amount of memory (in Mbytes), we assume we can load the second stage as a ramdisk */ #define MEM_LIMIT_DRAKX 68 +/* If we have more than that amount of memory (in Mbytes), we preload the second stage as a ramdisk */ +#define MEM_LIMIT_DRAKX_PRELOAD 100 /* If we have more than that amount of memory (in Mbytes), we assume we can load the rescue as a ramdisk */ #define MEM_LIMIT_RESCUE 40 +/* If we have more than that amount of memory (in Mbytes), we preload the rescue as a ramdisk */ +#define MEM_LIMIT_RESCUE_PRELOAD 100 -#define RAMDISK_COMPRESSION_RATIO 1.95 - -#define RAMDISK_LOCATION_REL "install/stage2/" #define SLASH_LOCATION "/sysroot" #ifdef MANDRAKE_MOVE @@ -53,6 +54,11 @@ #define DISTRIB_NAME "Mandrakelinux" #define LIVE_LOCATION_REL "install/stage2/live/" +#define CLP_LOCATION_REL "install/stage2/" +#define CLP_STAGE2_NAME "mdkinst.clp" +#define CLP_RESCUE_NAME "rescue.clp" +#define CLP_NAME(prefix) (IS_RESCUE ? prefix CLP_RESCUE_NAME : prefix CLP_STAGE2_NAME) +#define CLP_FILE_REL(prefix) CLP_NAME(prefix CLP_LOCATION_REL) /* the remote media is mounted in - IMAGE_LOCATION_DIR "nfsimage", and IMAGE_LOCATION is a symlink image -> nfsimage/mdk/mirror/dir @@ -63,6 +69,11 @@ #define IMAGE_LOCATION_REL "image" #define IMAGE_LOCATION IMAGE_LOCATION_DIR IMAGE_LOCATION_REL +#define CLP_LOCATION IMAGE_LOCATION "/" CLP_LOCATION_REL + +/* - if we use a clp : STAGE2_LOCATION is a the mount point + - if we use the live: STAGE2_LOCATION is a relative symlink to IMAGE_LOCATION_REL/install/stage2/live +*/ #define STAGE2_LOCATION_ROOTED "/tmp/stage2" #define STAGE2_LOCATION SLASH_LOCATION STAGE2_LOCATION_ROOTED 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; } diff --git a/mdk-stage1/disk.c b/mdk-stage1/disk.c index c45d38412..1060cd199 100644 --- a/mdk-stage1/disk.c +++ b/mdk-stage1/disk.c @@ -370,8 +370,7 @@ process_recovery(void) log_message("going on with a recovery on disk %s partition %s", medias[i], *part); symlink(disk_own_mount, IMAGE_LOCATION); - if (ramdisk_possible()) - load_ramdisk(); /* if load of ramdisk failed, try to continue in live */ + may_load_clp(); /* no error check */ add_to_env("METHOD", "disk"); return 1; diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c index 6ea2b97b7..d47a39650 100644 --- a/mdk-stage1/network.c +++ b/mdk-stage1/network.c @@ -967,7 +967,7 @@ enum return_type ftp_prepare(void) results = RETURN_BACK; continue; } - kernels_list_file = asprintf_("%s/" RAMDISK_LOCATION_REL "mdkinst.kernels", location_full); + kernels_list_file = asprintf_("%s/" CLP_LOCATION_REL "mdkinst.kernels", location_full); log_message("FTP: trying to retrieve %s", kernels_list_file); fd = ftp_start_download(ftp_serv_response, kernels_list_file, &size); @@ -992,7 +992,7 @@ enum return_type ftp_prepare(void) } } - strcat(location_full, get_ramdisk_realname()); + strcat(location_full, CLP_FILE_REL("/")); log_message("FTP: trying to retrieve %s", location_full); @@ -1021,7 +1021,7 @@ enum return_type ftp_prepare(void) log_message("FTP: size of download %d bytes", size); - results = load_ramdisk_fd(fd, size); + results = load_clp_fd(fd, size); if (results == RETURN_OK) { if (!use_http_proxy) ftp_end_data_command(ftp_serv_response); @@ -1087,7 +1087,7 @@ enum return_type http_prepare(void) strcpy(location_full, answers[1][0] == '/' ? "" : "/"); strcat(location_full, answers[1]); - strcat(location_full, get_ramdisk_realname()); + strcat(location_full, CLP_FILE_REL("/")); log_message("HTTP: trying to retrieve %s from %s", location_full, answers[0]); @@ -1106,7 +1106,7 @@ enum return_type http_prepare(void) log_message("HTTP: size of download %d bytes", size); - if (load_ramdisk_fd(fd, size) != RETURN_OK) { + if (load_clp_fd(fd, size) != RETURN_OK) { unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */ return RETURN_ERROR; } diff --git a/mdk-stage1/tools.c b/mdk-stage1/tools.c index 4e3f17a27..be1043798 100644 --- a/mdk-stage1/tools.c +++ b/mdk-stage1/tools.c @@ -30,7 +30,6 @@ #include <stdio.h> #include <dirent.h> #include <sys/types.h> -#include <bzlib.h> #include <sys/mount.h> #include <sys/poll.h> #include <errno.h> @@ -228,7 +227,8 @@ int image_has_stage2() #ifdef MANDRAKE_MOVE return access(IMAGE_LOCATION "/live_tree.clp", R_OK) == 0; #else - return access(IMAGE_LOCATION "/" LIVE_LOCATION_REL, R_OK) == 0; + return access(CLP_FILE_REL(IMAGE_LOCATION "/"), R_OK) == 0 || + access(IMAGE_LOCATION "/" LIVE_LOCATION_REL, R_OK) == 0; #endif } @@ -242,6 +242,15 @@ int ramdisk_possible(void) } } +int clp_preload(void) +{ + if (total_memory() > (IS_RESCUE ? MEM_LIMIT_RESCUE_PRELOAD : MEM_LIMIT_DRAKX_PRELOAD)) + return 1; + else { + log_message("warning, not preloading clp due to low mem"); + return 0; + } +} enum return_type save_fd(int from_fd, char * to, void (*callback_func)(int overall)) { @@ -298,7 +307,6 @@ enum return_type copy_file(char * from, char * to, void (*callback_func)(int ove } } -#ifdef MANDRAKE_MOVE enum return_type mount_clp(char *clp, char *location_mount) { if (lomount(clp, location_mount, NULL, 1)) { @@ -348,106 +356,22 @@ enum return_type mount_clp_may_preload(char *clp_name, char *location_mount, int return mount_clp(clp, location_mount); } } -#endif #ifndef MANDRAKE_MOVE -enum return_type load_ramdisk_fd(int ramdisk_fd, int size) +enum return_type may_load_clp(void) { - BZFILE * st2; - char * ramdisk = "/dev/ram3"; /* warning, verify that this file exists in the initrd, and that root=/dev/ram3 is actually passed to the kernel at boot time */ - int ram_fd; - char buffer[32768]; - int z_errnum; - char * wait_msg = "Loading program into memory..."; - int bytes_read = 0; - int actually; - int seems_ok = 0; - - st2 = BZ2_bzdopen(ramdisk_fd, "r"); - - if (!st2) { - log_message("Opening compressed ramdisk: %s", BZ2_bzerror(st2, &z_errnum)); - stg1_error_message("Could not open compressed ramdisk file."); - return RETURN_ERROR; - } - - ram_fd = open(ramdisk, O_WRONLY); - if (ram_fd == -1) { - log_perror(ramdisk); - stg1_error_message("Could not open ramdisk device file."); - return RETURN_ERROR; - } - - init_progression(wait_msg, size); - - while ((actually = BZ2_bzread(st2, buffer, sizeof(buffer))) > 0) { - seems_ok = 1; - if (write(ram_fd, buffer, actually) != actually) { - log_perror("writing ramdisk"); - remove_wait_message(); - return RETURN_ERROR; - } - update_progression((int)((bytes_read += actually) / RAMDISK_COMPRESSION_RATIO)); - } - - if (!seems_ok) { - log_message("reading compressed ramdisk: %s", BZ2_bzerror(st2, &z_errnum)); - BZ2_bzclose(st2); /* opened by gzdopen, but also closes the associated fd */ - close(ram_fd); - remove_wait_message(); - stg1_error_message("Could not uncompress second stage ramdisk. " - "This is probably an hardware error while reading the data. " - "(this may be caused by a hardware failure or a Linux kernel bug)"); - return RETURN_ERROR; + if (!IS_RESCUE && access(IMAGE_LOCATION "/" LIVE_LOCATION_REL, R_OK) == 0) { + /* LIVE install */ + return RETURN_OK; + } else { + /* CLP install */ + return mount_clp_may_preload(CLP_NAME(""), STAGE2_LOCATION, clp_preload()); } - - end_progression(); - - BZ2_bzclose(st2); /* opened by gzdopen, but also closes the associated fd */ - close(ram_fd); - - if (my_mount(ramdisk, STAGE2_LOCATION, "ext2", 1)) - return RETURN_ERROR; - - return RETURN_OK; -} - - -char * get_ramdisk_realname(void) -{ - char img_name[500]; - - strcpy(img_name, "/" RAMDISK_LOCATION_REL); - strcat(img_name, IS_RESCUE ? "rescue" : "mdkinst"); - strcat(img_name, "_stage2.bz2"); - - return strdup(img_name); } - -enum return_type load_ramdisk(void) +enum return_type load_clp_fd(int fd, int size) { - int st2_fd; - off_t size; - char img_name[500]; - - strcpy(img_name, IMAGE_LOCATION); - strcat(img_name, get_ramdisk_realname()); - - log_message("trying to load %s as a ramdisk", img_name); - - st2_fd = open(img_name, O_RDONLY); /* to be able to see the progression */ - - if (st2_fd == -1) { - log_message("open ramdisk file (%s) failed", img_name); - stg1_error_message("Could not open compressed ramdisk file (%s).", img_name); - return RETURN_ERROR; - } - - if ((size = file_size(img_name)) == -1) - return RETURN_ERROR; - else - return load_ramdisk_fd(st2_fd, size); + return preload_mount_clp(fd, size, CLP_NAME(""), STAGE2_LOCATION); } #endif diff --git a/mdk-stage1/tools.h b/mdk-stage1/tools.h index 19e0a4ea1..bd4dc7683 100644 --- a/mdk-stage1/tools.h +++ b/mdk-stage1/tools.h @@ -34,13 +34,12 @@ int total_memory(void); int image_has_stage2(); int ramdisk_possible(void); enum return_type copy_file(char * from, char * to, void (*callback_func)(int overall)); -#ifdef MANDRAKE_MOVE +enum return_type preload_mount_clp(int clp_fd, int clp_size, char *clp_name, char *location_mount); +enum return_type mount_clp(char *clp, char *location_mount); enum return_type mount_clp_may_preload(char *clp_name, char *location_mount, int preload); -#endif #ifndef MANDRAKE_MOVE -char * get_ramdisk_realname(void); -enum return_type load_ramdisk(void); -enum return_type load_ramdisk_fd(int ramdisk_fd, int size); +enum return_type load_clp_fd(int fd, int size); +enum return_type may_load_clp(void); #endif void * memdup(void *src, size_t size); void add_to_env(char * name, char * value); diff --git a/perl-install/Makefile b/perl-install/Makefile index 7f1f37640..3937dde90 100644 --- a/perl-install/Makefile +++ b/perl-install/Makefile @@ -71,6 +71,8 @@ test_pms_all: msgfmt -o $@ $< install_pms: $(DIRS) + [ -d $(DEST) ] || $(MISC_DEST)/mdkinst_stage2_tool $(STAGE2_DEST) + for i in `perl -ne 's/sub (\w+?)_?(\(\))? {.*/$$1/ and print' commands.pm` sync; do ln -sf commands $(DEST)/usr/bin/$$i; done install -d $(DESTREP4PMS) @@ -214,10 +216,10 @@ endif full_stage2: $(MAKE) stage2 - $(MAKE) mdkinst_stage2 + $(MAKE) clp -mdkinst_stage2: - $(MISC_DEST)/make_mdkinst_stage2 $(DEST) $(STAGE2_DEST)/mdkinst_stage2 +clp: + $(MISC_DEST)/mdkinst_stage2_tool $(STAGE2_DEST) stage2: if [ `id -u` = 0 ]; then rm -rf $(DEST); else $(SUDO) rm -rf $(DEST); fi diff --git a/rescue/.cvsignore b/rescue/.cvsignore index c1a06f76b..b5f45186d 100644 --- a/rescue/.cvsignore +++ b/rescue/.cvsignore @@ -1,2 +1,2 @@ -rescue_stage2.bz2 +rescue.clp kernel_read_part diff --git a/rescue/Makefile b/rescue/Makefile index b43275b94..591676a70 100644 --- a/rescue/Makefile +++ b/rescue/Makefile @@ -1,12 +1,12 @@ include ../Makefile.config -all: rescue_stage2.bz2 +all: rescue.clp -install: rescue_stage2.bz2 +install: rescue.clp cp -f $< $(STAGE2_DEST) -rescue_stage2.bz2: kernel_read_part list list.$(ARCH) drvinst guessmounts lsparts rescue-doc make_rescue_img +rescue.clp: kernel_read_part list list.$(ARCH) drvinst guessmounts lsparts rescue-doc make_rescue_img ./make_rescue_img clean: - rm -f rescue_stage2.bz2 kernel_read_part + rm -f rescue.clp kernel_read_part diff --git a/rescue/make_rescue_img b/rescue/make_rescue_img index 076273f34..7dafd1923 100755 --- a/rescue/make_rescue_img +++ b/rescue/make_rescue_img @@ -6,9 +6,7 @@ use keyboard; $lib = (arch() =~ /x86_64/ ? "lib64" : "lib"); $tmp = "/tmp/rescue_tmp"; -$mnt = "/tmp/rescue_stage2_img"; -$mke2fs = "/sbin/mke2fs -q -m 0 -F -s 1"; -$rescue = "rescue_stage2"; +$rescue = "rescue.clp"; if ($>) { $sudo = "sudo"; @@ -114,26 +112,4 @@ __ "strip $tmp/{lib,$lib,bin,sbin}/* $tmp/usr/{bin,sbin}/* 2>/dev/null"; exit 0 if $ARGV[0]; -if (arch() =~ /ppc/) { - #- xfs module on PPC is 4MB! - need room to unpack it - $size = `du -s $tmp | cut -f1` + 4096; #- add 4MB of free space -} else { - $size = `du -s $tmp | cut -f1` + 2048; #- add 2MB of free space -} - -mkdir_p($mnt); -__ "$sudo umount $mnt 2>/dev/null"; - -_ "dd if=/dev/zero of=$rescue bs=1k count=$size"; -_ "$mke2fs $rescue"; -_ "$sudo mount -t ext2 $rescue $mnt -o loop"; -_ "rmdir $mnt/lost+found"; - -_ "$sudo chown -R root.root $tmp"; -_ "$sudo cp -a $tmp/* $mnt"; -_ "$sudo rm -rf $tmp"; - -_ "$sudo umount $mnt"; -_ "rmdir $mnt"; - -_ "bzip2 -f -9 $rescue"; +_ "mkisofs -quiet -D -R $tmp | create_compressed_fs - 65536 $rescue 200 2>/dev/null" |