Changeset 2462 in MondoRescue for branches/2.2.10/mondo/src/common


Ignore:
Timestamp:
Oct 20, 2009, 4:07:00 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3548@localhost: bruno | 2009-10-16 19:18:27 +0200

  • mindi now boots in a QEMU VM without busybox
  • mindi is now noarch as a consequence
  • MINDI_LIB becomes MINDI_DATA for coherency and as a consequence
  • CACHEDIR becomes MINDI_CACHE for coherency and it's a build parameter and not hardcoded anymore in mindi
  • THat variable is also used at restore time for mondorestore.cfg e.g.
  • FAILSAFE kernel is gone. Just use another kernel of your choice. Most std kernels work anyway
  • TurnTgzIntoRdz rewritten and now really computes data disk size and not suppose its size
  • Interface mondo/mindi changed again => incompatible
  • Non-bootable media not supported anymore.
  • Mondorescue adapted to these changes but not tested yet
  • Doc updated as well
Location:
branches/2.2.10/mondo/src/common
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-archive.c

    r2460 r2462  
    513513    char *bootldr_str = NULL;
    514514    char *tape_device = NULL;
    515     char *last_filelist_number = NULL;
    516515    char *broken_bios_sz = NULL;
    517516    char *cd_recovery_sz = NULL;
     
    546545    }
    547546    lines_in_filelist = count_lines_in_file(tmp);
    548     mr_free(tmp);
    549 
    550     mr_asprintf(tmp, "%s/LAST-FILELIST-NUMBER", bkpinfo->tmpdir);
    551     last_filelist_number = last_line_of_file(tmp);
    552547    mr_free(tmp);
    553548
     
    805800            (bkpinfo->image_devs == NULL) ? "\"\"" : bkpinfo->image_devs,   // parameter #10
    806801            broken_bios_sz,     // parameter #11
    807             last_filelist_number,   // parameter #12 (STRING)
    808             estimated_total_noof_slices,    // parameter #13 (INT)
    809             (bkpinfo->exclude_devs == NULL) ? "\"\"" : bkpinfo->exclude_devs,   // parameter #14
    810             use_comp_sz,        // parameter #15
    811             use_lilo_sz,        // parameter #16
    812             use_star_sz,        // parameter #17
    813             bkpinfo->internal_tape_block_size,  // parameter #18 (LONG)
    814             bkpinfo->differential,  // parameter #19 (INT)
    815             use_gzip_sz,        // parameter #20 (STRING)
    816             use_lzma_sz,        // parameter #21 (STRING)
     802            estimated_total_noof_slices,    // parameter #12 (INT)
     803            (bkpinfo->exclude_devs == NULL) ? "\"\"" : bkpinfo->exclude_devs,   // parameter #13
     804            use_comp_sz,        // parameter #14
     805            use_lilo_sz,        // parameter #15
     806            use_star_sz,        // parameter #16
     807            bkpinfo->internal_tape_block_size,  // parameter #17 (LONG)
     808            bkpinfo->differential,  // parameter #18 (INT)
     809            use_gzip_sz,        // parameter #19 (STRING)
     810            use_lzma_sz,        // parameter #20 (STRING)
    817811            MONDO_LOGFILE);
    818812
    819813    mr_free(tmp2);
    820     mr_free(last_filelist_number);
    821814    mr_free(tape_device);
    822815    mr_free(use_lzo_sz);
  • branches/2.2.10/mondo/src/common/libmondo-cli.c

    r2444 r2462  
    671671        mr_free(bkpinfo->kernel_path);
    672672        mr_asprintf(bkpinfo->kernel_path, "%s", flag_val['k']);
    673         if (!strcmp(bkpinfo->kernel_path, "failsafe")) {
    674             mr_free(bkpinfo->kernel_path);
    675             mr_asprintf(bkpinfo->kernel_path, "FAILSAFE");
    676         }
    677         if (strcmp(bkpinfo->kernel_path, "FAILSAFE") && !does_file_exist(bkpinfo->kernel_path)) {
     673        if (!does_file_exist(bkpinfo->kernel_path)) {
    678674            retval++;
    679675            log_to_screen("You specified kernel '%s', which does not exist\n", bkpinfo->kernel_path);
  • branches/2.2.10/mondo/src/common/libmondo-devices.c

    r2460 r2462  
    27312731                paranoid_fclose(fin);
    27322732            } else {
    2733                 if (does_file_exist("/tmp/mondo-restore.cfg")) {
     2733                if (does_file_exist(MINDI_CACHE"/mondorestore.cfg")) {
    27342734                    mr_free(bkpinfo->media_device);
    2735                     bkpinfo->media_device = read_cfg_var("/tmp/mondo-restore.cfg", "media-dev");
     2735                    bkpinfo->media_device = read_cfg_var(MINDI_CACHE"/mondorestore.cfg", "media-dev");
    27362736                }
    27372737            }
     
    30753075            ("Will you want to verify your backups after Mondo has created them?");
    30763076
    3077 #ifndef __FreeBSD__
    3078         if (!ask_me_yes_or_no
    3079             ("Are you confident that your kernel is a sane, sensible, standard Linux kernel? Say 'no' if you are using a Gentoo <1.4 or Debian <3.0, please."))
    3080 #endif
    3081         {
    3082             mr_free(bkpinfo->kernel_path);
    3083             mr_asprintf(bkpinfo->kernel_path, "FAILSAFE");
    3084         }
    3085 
    30863077        if (!ask_me_yes_or_no
    30873078            ("Are you sure you want to proceed? Hit 'no' to abort.")) {
  • branches/2.2.10/mondo/src/common/libmondo-filelist.c

    r2444 r2462  
    322322    mr_free(biggie_fname);
    323323
    324     mr_asprintf(outfname, "%s/LAST-FILELIST-NUMBER", bkpinfo->tmpdir);
    325     mr_asprintf(tmp, "%ld", curr_set_no);
    326     if (write_one_liner_data_file(outfname, tmp)) {
    327         log_OS_error
    328             ("Unable to echo write one-liner to LAST-FILELIST-NUMBER");
    329         err = 1;
    330     }
     324    mr_asprintf(tmp, "echo 'last-filelist-number %ld' >> "MINDI_CACHE"/mondorestore.cfg", curr_set_no);
     325    paranoid_system(tmp);
    331326    mr_free(tmp);
    332     mr_free(outfname);
    333327
    334328    if (curr_set_no == 0) {
     
    708702    assert(bkpinfo != NULL);
    709703
    710     mr_asprintf(cfg_fname, "%s/mondo-restore.cfg", bkpinfo->tmpdir);
     704    mr_asprintf(cfg_fname, "%s/mondorestore.cfg", MINDI_CACHE);
    711705    val_sz = read_cfg_var(cfg_fname, "last-filelist-number");
    712706    mr_free(cfg_fname);
  • branches/2.2.10/mondo/src/common/libmondo-files.c

    r2406 r2462  
    705705
    706706/**
    707  * Determine the size (in KB) of @p dev in the mountlist in <tt>tmpdir</tt>/mountlist.txt.
     707 * Determine the size (in KB) of @p dev in the mountlist in mountlist.txt.
    708708 * @param tmpdir The tempdir where the mountlist is stored.
    709709 * @param dev The device to search for.
     
    717717    long file_len_K;
    718718
    719     mr_asprintf(mountlist, "%s/mountlist.txt", tmpdir);
    720     mr_asprintf(command, "grep \"%s \" %s/mountlist.txt | head -n1 | awk '{print $4}'", dev, tmpdir);
     719    mr_asprintf(mountlist, "%s/mountlist.txt", MINDI_CACHE);
     720    mr_asprintf(command, "grep \"%s \" %s/mountlist.txt | head -n1 | awk '{print $4}'", dev, MINDI_CACHE);
    721721    mr_free(mountlist);
    722722
     
    992992 * Copy the files that Mondo/Mindi need to run to the scratchdir or tempdir.
    993993 * Currently this includes: copy Mondo's home directory to scratchdir,
    994  * copy LAST-FILELIST-NUMBER to scratchdir, copy post-nuke.tgz (if it exists) to tmpdir,
     994 * copy post-nuke.tgz (if it exists) to tmpdir,
    995995 * and run "hostname > scratchdir/HOSTNAME".
    996996 * @param bkpinfo The backup information structure. Fields used:
     
    10201020    if (res) {
    10211021        fatal_error("Failed to copy Mondo's stuff to scratchdir");
    1022     }
    1023 
    1024     mr_asprintf(command, "cp -f %s/LAST-FILELIST-NUMBER %s", bkpinfo->tmpdir, bkpinfo->scratchdir);
    1025     res = run_program_and_log_output(command, FALSE);
    1026     mr_free(command);
    1027 
    1028     if (res) {
    1029         fatal_error("Failed to copy LAST-FILELIST-NUMBER to scratchdir");
    10301022    }
    10311023
  • branches/2.2.10/mondo/src/common/libmondo-stream.c

    r2405 r2462  
    856856    (void) getcwd(old_cwd, MAX_STR_LEN);
    857857    chdir(bkpinfo->tmpdir);
    858     mr_asprintf(tmp, "tar -zxf %s ./tmp/mondo-restore.cfg 2> /dev/null", outfname);
     858    mr_asprintf(tmp, "tar -zxf %s ."MINDI_CACHE"/mondorestore.cfg 2> /dev/null", outfname);
    859859    paranoid_system(tmp);
    860860    mr_free(tmp);
    861861
    862     paranoid_system("cp -f tmp/mondo-restore.cfg . 2> /dev/null");
     862    paranoid_system("cp -f ."MINDI_CACHE"/mondorestore.cfg . 2> /dev/null");
    863863    chdir(old_cwd);
    864864    unlink(outfname);
  • branches/2.2.10/mondo/src/common/libmondo-tools.c

    r2444 r2462  
    10711071/**
    10721072 * Retrieve the line containing @p label from the config file.
    1073  * @param config_file The file to read from, usually @c /tmp/mondo-restore.cfg.
     1073 * @param config_file The file to read from, usually @c mondorestore.cfg.
    10741074 * @param label What to read from the file.
    10751075 * @param value Where to put it.
     
    12941294 * Write a line to a configuration file. Writes a line of the form,
    12951295 * @c label @c value.
    1296  * @param config_file The file to write to. Usually @c mondo-restore.cfg.
     1296 * @param config_file The file to write to. Usually @c mondorestore.cfg.
    12971297 * @param label What to call this bit of data you're writing.
    12981298 * @param value The bit of data you're writing.
  • branches/2.2.10/mondo/src/common/mondostructures.h

    r2428 r2462  
    557557
    558558  /**
    559    * Path to the user's kernel, or "FAILSAFE" or "SUCKS" to use the kernel
    560    * included with Mindi.
     559   * Path to the user's kernel included with Mindi.
    561560   */
    562561    char *kernel_path;
Note: See TracChangeset for help on using the changeset viewer.