Changeset 1437


Ignore:
Timestamp:
May 10, 2007, 11:41:11 PM (12 years ago)
Author:
andree
Message:

New define 'MINDI_CACHE' set to '/var/cache/mindi' rather than
hardcoding this in the code. Makes it easy to change the location. Also
adjusted some of the messages related to boot floppies or CDs.

(Also added missing debug level to log_debug() call.)

Location:
branches/2.2.4/mondo/src
Files:
5 edited

Legend:

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

    r1402 r1437  
    10471047    if (!res) {
    10481048        log_to_screen("Boot+data disks were created OK");
    1049         sprintf(command, "mkdir -p /var/cache/mindi/");
    1050         log_msg(2, command);
    1051         run_program_and_log_output(command, FALSE);
    1052         sprintf(command,
    1053                 "cp -f %s/images/mindi.iso /var/cache/mindi/mondorescue.iso",
    1054                 bkpinfo->scratchdir);
     1049        sprintf(command, "cp -f %s/images/mindi.iso %s/mondorescue.iso",
     1050                bkpinfo->scratchdir, MINDI_CACHE);
    10551051        log_msg(2, command);
    10561052        run_program_and_log_output(command, FALSE);
     
    22742270            ftmp = fopen(bigfile_fname, "w");
    22752271            if (ftmp == NULL) {
    2276                 log_msg("Unable to write to %s", bigfile_fname);
     2272                log_msg(3, "Unable to write to %s", bigfile_fname);
    22772273                // So skip it as it doesn't exist
    22782274                continue;
     
    27792775 * @c backup_media_type field is used in this function.
    27802776 * @param imagesdir The directory containing the floppy images (usually
    2781  * /var/cache/mindi).
     2777 * /root/images/mindi).
    27822778 *
    27832779 * @return The number of errors encountered (0 for success)
     
    29582954    if (!bkpinfo->nonbootable_backup) {
    29592955#ifdef __FreeBSD__
    2960         if (!does_file_exist("/var/cache/mindi/mindi-kern.1722.img"))
     2956        if (!does_file_exist(MINDI_CACHE"/mindi-kern.1722.img"))
    29612957#else
    2962         if (!does_file_exist("/var/cache/mindi/mindi-bootroot.1722.img")
    2963             && !does_file_exist("/var/cache/mindi/mindi-boot.1440.img"))
     2958        if (!does_file_exist(MINDI_CACHE"/mindi-bootroot.1722.img") && !does_file_exist(MINDI_CACHE"/mindi-boot.1440.img"))
    29642959#endif
    29652960        {
    29662961            mvaddstr_and_log_it(g_currentY++, 74, "No Imgs");
    2967             if (does_file_exist("/var/cache/mindi/mondorescue.iso")) {
    2968                 popup_and_OK
    2969                     ("Boot+data floppy creation failed. However, FYI, you may burn /var/cache/mindi/mondorescue.iso to a CD and boot from that instead if you wish.");
     2962            if (does_file_exist(MINDI_CACHE"/mondorescue.iso")) {
     2963                popup_and_OK
     2964                    ("No regular Boot+data floppies were created due of space constraints. However, you can burn "MINDI_CACHE"/mondorescue.iso to a CD and boot from that.");
    29702965                res++;
    29712966            }
    29722967        } else {
    2973             offer_to_write_floppies(bkpinfo, "/var/cache/mindi");
     2968            offer_to_write_floppies(bkpinfo, MINDI_CACHE);
    29742969            mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    29752970        }
  • branches/2.2.4/mondo/src/common/libmondo-filelist.c

    r1316 r1437  
    17501750        sprintf(exclude_paths, " %s %s %s %s %s %s . .. \
    17511751" MNT_CDROM " " MNT_FLOPPY " /media \
    1752 /proc /sys /root/images/mondo /root/images/mindi ", excp, call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"), call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"), call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"), (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir);
     1752/proc /sys /root/images/mondo MINDI_CACHE ", excp, call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"), call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"), call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"), (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir);
    17531753
    17541754        log_msg(2, "Excluding paths = '%s'", exclude_paths);
  • branches/2.2.4/mondo/src/common/libmondo-tools.c

    r1381 r1437  
    11001100#endif
    11011101
    1102     if ((Lres = free_space_on_given_partition("/root")) == -1) {
    1103         Lres = free_space_on_given_partition("/");
    1104     }
    1105     log_it("Free space on given partition = %ld MB", Lres);
     1102    Lres = free_space_on_given_partition(MINDI_CACHE);
     1103    log_it("Free space on partition of %s = %ld MB", MINDI_CACHE, Lres);
    11061104
    11071105    if (Lres < 50) {
    1108         run_program_and_log_output
    1109             ("rm -Rf /root/images/mindi; mkdir -p /home/root/images/mindi; mkdir -p /root/images; ln -sf /home/root/images/mindi /root/images/mindi",
    1110              3);
    1111         //      fatal_error("Your / (or /root) partition has <50MB free. Please adjust your partition table to something saner.");
     1106        sprintf(tmp, "The partition of %s has <50MB free. Please free up space or enlarge the partition or make %s a symbolic link.", MINDI_CACHE, MINDI_CACHE);
     1107        fatal_error(tmp);
    11121108    }
    11131109
  • branches/2.2.4/mondo/src/common/my-stuff.h

    r1315 r1437  
    231231 */
    232232#define MONDO_CFG_FILE_STUB "tmp/mondo-restore.cfg"
     233/**
     234 * The location where mindi CD and floppy images are stored.
     235 */
     236#define MINDI_CACHE "/var/cache/mindi"
    233237
    234238/**
  • branches/2.2.4/mondo/src/mondoarchive/main.c

    r1383 r1437  
    501501    }
    502502
    503     if (does_file_exist("/root/images/mindi/mondorescue.iso")) {
     503    if (does_file_exist(MINDI_CACHE"/mondorescue.iso")) {
    504504        log_to_screen
    505             ("/root/images/mindi/mondorescue.iso, a boot/utility CD, is available if you want it.");
     505            (MINDI_CACHE"/mondorescue.iso, a boot/utility CD, is available if you want it.");
    506506    }
    507507
Note: See TracChangeset for help on using the changeset viewer.