Ignore:
Timestamp:
Feb 8, 2007, 12:10:16 AM (13 years ago)
Author:
Bruno Cornec
Message:

log_msg => mr_msg for main files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c

    r1103 r1108  
    207207        || (!does_file_exist(output_mountlist_file)
    208208            && does_file_exist(orig_fname))) {
    209         log_msg(2, "Failed to extract %s and/or %s from ramdisk",
     209        mr_msg(2, "Failed to extract %s and/or %s from ramdisk",
    210210                output_cfg_file, output_mountlist_file);
    211211        retval = 1;
     
    275275            "Checking to see if f=%s, file=%s, is in the list of biggiefiles",
    276276            f, file);
    277     log_msg(2, tmp);
     277    mr_msg(2, tmp);
    278278    sprintf(command, "grep -E '^%s$' %s", file, list_fname);
    279279    res = run_program_and_log_output(command, FALSE);
     
    324324        sprintf(command, "mkdir -p %s", bkpinfo->isodir);
    325325        run_program_and_log_output(command, 5);
    326         log_msg(2, "Setting isodir to %s", bkpinfo->isodir);
     326        mr_msg(2, "Setting isodir to %s", bkpinfo->isodir);
    327327    }
    328328
     
    349349                "The 'mount' command is '%s'. PLEASE report this command to be if you have problems, ok?",
    350350                mount_isodir_command);
    351         log_msg(1, tmp);
     351        mr_msg(1, tmp);
    352352        if (run_program_and_log_output(mount_isodir_command, FALSE)) {
    353353            popup_and_OK
     
    364364    sprintf(tmp, "%s #%d has been mounted via loopback mount",
    365365            media_descriptor_string(bkpinfo->backup_media_type), i);
    366     log_msg(1, tmp);
     366    mr_msg(1, tmp);
    367367    if (i < 0) {
    368368        popup_and_OK
     
    370370        retval = 1;
    371371    }
    372     log_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__,
     372    mr_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__,
    373373            bkpinfo->isodir);
    374374    mr_free(mount_isodir_command);
     
    501501    for (lino = 0; lino < mountlist->entries; lino++) {
    502502        if (!strcmp(mountlist->el[lino].device, "/proc")) {
    503             log_msg(1,
     503            mr_msg(1,
    504504                    "Again with the /proc - why is this in your mountlist?");
    505505        } else if (is_this_device_mounted(mountlist->el[lino].device)) {
     
    591591    if (bkpinfo->backup_media_type == tape
    592592        || bkpinfo->backup_media_type == udev) {
    593         log_msg(8, "Tape/udev. Therefore, no need to mount CDROM.");
     593        mr_msg(8, "Tape/udev. Therefore, no need to mount CDROM.");
    594594        mr_free(mount_cmd);
    595595        return 0;
     
    597597
    598598    if (!run_program_and_log_output("mount | grep -F " MNT_CDROM, FALSE)) {
    599         log_msg(2, "mount_cdrom() - CD already mounted. Fair enough.");
     599        mr_msg(2, "mount_cdrom() - CD already mounted. Fair enough.");
    600600        mr_free(mount_cmd);
    601601        return (0);
     
    603603
    604604    if (bkpinfo->backup_media_type == nfs) {
    605         log_msg(2, "Mounting for NFS thingy");
    606         log_msg(2, "isodir = %s", bkpinfo->isodir);
     605        mr_msg(2, "Mounting for NFS thingy");
     606        mr_msg(2, "isodir = %s", bkpinfo->isodir);
    607607        if ((!bkpinfo->isodir[0] || !strcmp(bkpinfo->isodir, "/"))
    608608            && am_I_in_disaster_recovery_mode()) {
    609609            strcpy(bkpinfo->isodir, "/tmp/isodir");
    610             log_msg(1, "isodir is being set to %s", bkpinfo->isodir);
     610            mr_msg(1, "isodir is being set to %s", bkpinfo->isodir);
    611611        }
    612612#ifdef __FreeBSD__
     
    663663
    664664    }
    665     log_msg(2, "(mount_cdrom) --- command = %s", mount_cmd);
     665    mr_msg(2, "(mount_cdrom) --- command = %s", mount_cmd);
    666666    for (i = 0; i < 2; i++) {
    667667        res = run_program_and_log_output(mount_cmd, FALSE);
     
    669669            break;
    670670        } else {
    671             log_msg(2, "Failed to mount CD-ROM drive.");
     671            mr_msg(2, "Failed to mount CD-ROM drive.");
    672672            sleep(5);
    673673            run_program_and_log_output("sync", FALSE);
     
    675675    }
    676676    if (res) {
    677         log_msg(2, "Failed, despite %d attempts", i);
    678     } else {
    679         log_msg(2, "Mounted CD-ROM drive OK");
     677        mr_msg(2, "Failed, despite %d attempts", i);
     678    } else {
     679        mr_msg(2, "Mounted CD-ROM drive OK");
    680680    }
    681681    mr_free(mount_cmd);
     
    718718    if (!strcmp(mpt, "/1")) {
    719719        strcpy(mountpoint, "/");
    720         log_msg(3, "Mommm! SME is being a dildo!");
     720        mr_msg(3, "Mommm! SME is being a dildo!");
    721721    } else {
    722722        strcpy(mountpoint, mpt);
     
    730730    }
    731731    sprintf(tmp, "Mounting device %s   ", device);
    732     log_msg(1, tmp);
     732    mr_msg(1, tmp);
    733733    if (writeable) {
    734734        strcpy(additional_parameters, "-o rw");
     
    755755        sprintf(command, "mount -t %s %s %s %s 2>> %s", format, device,
    756756                additional_parameters, mountdir, MONDO_LOGFILE);
    757         log_msg(2, "command='%s'", command);
     757        mr_msg(2, "command='%s'", command);
    758758    }
    759759    res = run_program_and_log_output(command, TRUE);
    760760    if (res && (strstr(command, "xattr") || strstr(command, "acl"))) {
    761         log_msg(1, "Re-trying without the fancy extra parameters");
     761        mr_msg(1, "Re-trying without the fancy extra parameters");
    762762        sprintf(command, "mount -t %s %s %s 2>> %s", format, device,
    763763                mountdir, MONDO_LOGFILE);
     
    765765    }
    766766    if (res) {
    767         log_msg(1, "Unable to mount device %s (type %s) at %s", device,
     767        mr_msg(1, "Unable to mount device %s (type %s) at %s", device,
    768768                format, mountdir);
    769         log_msg(1, "command was '%s'", command);
     769        mr_msg(1, "command was '%s'", command);
    770770        if (!strcmp(mountpoint, "swap")) {
    771771            log_to_screen(tmp);
    772772        } else {
    773             log_msg(2, "Retrying w/o the '-t' switch");
     773            mr_msg(2, "Retrying w/o the '-t' switch");
    774774            sprintf(command, "mount %s %s 2>> %s", device, mountdir,
    775775                    MONDO_LOGFILE);
    776             log_msg(2, "2nd command = '%s'", command);
     776            mr_msg(2, "2nd command = '%s'", command);
    777777            res = run_program_and_log_output(command, TRUE);
    778778            if (res == 0) {
    779                 log_msg(1,
     779                mr_msg(1,
    780780                        "That's OK. I called mount w/o a filesystem type and it worked fine in the end.");
    781781            } else {
     
    785785    }
    786786    if (res && !strcmp(mountpoint, "swap")) {
    787         log_msg(2, "That's ok. It's just a swap partition.");
    788         log_msg(2, "Non-fatal error. Returning 0.");
     787        mr_msg(2, "That's ok. It's just a swap partition.");
     788        mr_msg(2, "Non-fatal error. Returning 0.");
    789789        res = 0;
    790790    }
     
    898898                /* Check to see if CD is already mounted before mounting it... */
    899899                if (!is_this_device_mounted("/dev/cdrom")) {
    900                     log_msg(2,
     900                    mr_msg(2,
    901901                            "NB: CDROM device not mounted, mounting...");
    902902                    run_program_and_log_output("mount /dev/cdrom "
     
    959959            sprintf(tmp, "Backup medium is TAPE --- dev=%s",
    960960                    bkpinfo->media_device);
    961             log_msg(2, tmp);
     961            mr_msg(2, tmp);
    962962        } else {
    963963            strcpy(bkpinfo->media_device, "/dev/cdrom");    /* we don't really need this var */
    964964            bkpinfo->media_size[0] = 1999 * 1024;   /* 650, probably, but we don't need this var anyway */
    965965            bkpinfo->media_size[1] = 1999 * 1024;   /* 650, probably, but we don't need this var anyway */
    966             log_msg(2, "Backup medium is CD-R[W]");
    967         }
    968     } else {
    969         log_msg(2,
     966            mr_msg(2, "Backup medium is CD-R[W]");
     967        }
     968    } else {
     969        mr_msg(2,
    970970                "Not in Disaster Recovery Mode. No need to derive device name from config file.");
    971971    }
     
    974974    if (strstr(value, "yes")) {
    975975        bkpinfo->use_star = TRUE;
    976         log_msg(1, "Goody! ... bkpinfo->use_star is now true.");
     976        mr_msg(1, "Goody! ... bkpinfo->use_star is now true.");
    977977    }
    978978
     
    980980    if (strstr(value, "yes")) {
    981981        mr_asprintf(&g_getfacl,"setfacl");
    982         log_msg(1, "We will restore ACLs");
     982        mr_msg(1, "We will restore ACLs");
    983983        if (! find_home_of_exe("setfacl")) {
    984             log_msg(1, "Unable to restore ACLs as no setfacl found");
     984            mr_msg(1, "Unable to restore ACLs as no setfacl found");
    985985        }
    986986    }
     
    988988    if (strstr(value, "yes")) {
    989989        mr_asprintf(&g_getfattr,"setfattr");
    990         log_msg(1, "We will restore XATTRs");
     990        mr_msg(1, "We will restore XATTRs");
    991991        if (! find_home_of_exe("setfattr")) {
    992             log_msg(1, "Unable to restore XATTRs as no setfattr found");
     992            mr_msg(1, "Unable to restore XATTRs as no setfattr found");
    993993        }
    994994    }
     
    996996    if (0 == read_cfg_var(cfg_file, "internal-tape-block-size", value)) {
    997997        bkpinfo->internal_tape_block_size = atol(value);
    998         log_msg(1, "Internal tape block size has been custom-set to %ld",
     998        mr_msg(1, "Internal tape block size has been custom-set to %ld",
    999999                bkpinfo->internal_tape_block_size);
    10001000    } else {
    10011001        bkpinfo->internal_tape_block_size =
    10021002            DEFAULT_INTERNAL_TAPE_BLOCK_SIZE;
    1003         log_msg(1, "Internal tape block size = default (%ld)",
     1003        mr_msg(1, "Internal tape block size = default (%ld)",
    10041004                DEFAULT_INTERNAL_TAPE_BLOCK_SIZE);
    10051005    }
     
    10361036        bkpinfo->differential = TRUE;
    10371037    }
    1038     log_msg(2, "differential var = '%s'", value);
     1038    mr_msg(2, "differential var = '%s'", value);
    10391039    if (bkpinfo->differential) {
    1040         log_msg(2, "THIS IS A DIFFERENTIAL BACKUP");
    1041     } else {
    1042         log_msg(2, "This is a regular (full) backup");
     1040        mr_msg(2, "THIS IS A DIFFERENTIAL BACKUP");
     1041    } else {
     1042        mr_msg(2, "This is a regular (full) backup");
    10431043    }
    10441044
     
    10491049               ("cat /proc/cmdline"), "donteject")) {
    10501050        bkpinfo->please_dont_eject = TRUE;
    1051         log_msg(2, "Ok, I shan't eject when restoring! Groovy.");
     1051        mr_msg(2, "Ok, I shan't eject when restoring! Groovy.");
    10521052    }
    10531053
    10541054    if (bkpinfo->backup_media_type == nfs) {
    10551055        if (!cfgf) {
    1056             log_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);
    1057             log_msg(2, "nfs_remote_dir remains %s",
     1056            mr_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);
     1057            mr_msg(2, "nfs_remote_dir remains %s",
    10581058                    bkpinfo->nfs_remote_dir);
    1059             log_msg(2,
     1059            mr_msg(2,
    10601060                    "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place");
    10611061        } else {
     
    10641064            read_cfg_var(g_mondo_cfg_file, "nfs-server-path",
    10651065                         bkpinfo->nfs_remote_dir);
    1066             log_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);
    1067             log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
     1066            mr_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);
     1067            mr_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
    10681068        }
    10691069        if (strstr(call_program_and_get_last_line_of_output
     
    11031103        }
    11041104        read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device);
    1105         log_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir,
     1105        mr_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir,
    11061106                g_isodir_device);
    11071107        if (bkpinfo->disaster_recovery) {
    11081108            if (is_this_device_mounted(g_isodir_device)) {
    1109                 log_msg(2, "NB: isodir is already mounted");
     1109                mr_msg(2, "NB: isodir is already mounted");
    11101110                /* Find out where it's mounted */
    11111111                sprintf(command,
     
    11231123                sprintf(tmp, "mount %s %s", g_isodir_device, iso_mnt);
    11241124                if (run_program_and_log_output(tmp, 3)) {
    1125                     log_msg(1,
     1125                    mr_msg(1,
    11261126                            "Unable to mount isodir. Perhaps this is really a CD backup?");
    11271127                    bkpinfo->backup_media_type = cdr;
     
    11321132                            ("Unable to mount isodir. Failed to mount CD-ROM as well.");
    11331133                    } else {
    1134                         log_msg(1,
     1134                        mr_msg(1,
    11351135                                "You backed up to disk, then burned some CDs.");
    11361136                    }
     
    11471147        if (g_restoring_live_from_cd) {
    11481148            if (bkpinfo->backup_media_type != media_specified_by_user) {
    1149                 log_msg(2,
     1149                mr_msg(2,
    11501150                        "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)");
    11511151                interactively_obtain_media_parameters_from_user(bkpinfo,
     
    12061206    if (does_file_exist(g_filelist_full)
    12071207        && does_file_exist(g_biggielist_txt)) {
    1208         log_msg(1, "%s exists", g_filelist_full);
    1209         log_msg(1, "%s exists", g_biggielist_txt);
    1210         log_msg(2,
     1208        mr_msg(1, "%s exists", g_filelist_full);
     1209        mr_msg(1, "%s exists", g_biggielist_txt);
     1210        mr_msg(2,
    12111211                "Filelist and biggielist already recovered from media. Yay!");
    12121212    } else {
    12131213        getcwd(tmp, MAX_STR_LEN);
    12141214        chdir(bkpinfo->tmpdir);
    1215         log_msg(1, "chdir(%s)", bkpinfo->tmpdir);
     1215        mr_msg(1, "chdir(%s)", bkpinfo->tmpdir);
    12161216        log_to_screen("Extracting filelist and biggielist from media...");
    12171217        unlink("/tmp/filelist.full");
     
    12261226                    FILELIST_FULL_STUB,
    12271227                    "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    1228             log_msg(1, "tarcommand = %s", command);
     1228            mr_msg(1, "tarcommand = %s", command);
    12291229            run_program_and_log_output(command, 1);
    12301230        } else {
    1231             log_msg(2,
     1231            mr_msg(2,
    12321232                    "Calling insist_on_this_cd_number; bkpinfo->isodir=%s",
    12331233                    bkpinfo->isodir);
    12341234            insist_on_this_cd_number(bkpinfo, 1);
    1235             log_msg(2, "Back from iotcn");
     1235            mr_msg(2, "Back from iotcn");
    12361236            run_program_and_log_output("mount", 1);
    12371237            sprintf(command,
     
    12431243                    "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    12441244
    1245             log_msg(1, "tarcommand = %s", command);
     1245            mr_msg(1, "tarcommand = %s", command);
    12461246            run_program_and_log_output(command, 1);
    12471247//    popup_and_OK("Press ENTER to continue");
     
    12611261        sprintf(command, "cp -f %s/%s %s", bkpinfo->tmpdir,
    12621262                BIGGIELIST_TXT_STUB, g_biggielist_txt);
    1263         log_msg(1, "command = %s", command);
     1263        mr_msg(1, "command = %s", command);
    12641264        paranoid_system(command);
    12651265        sprintf(command, "ln -sf %s/%s %s", bkpinfo->tmpdir,
    12661266                FILELIST_FULL_STUB, g_filelist_full);
    1267         log_msg(1, "command = %s", command);
     1267        mr_msg(1, "command = %s", command);
    12681268        paranoid_system(command);
    12691269    }
     
    12821282
    12831283    if (!does_file_exist(g_biggielist_txt)) {
    1284         log_msg(1, "Warning - %s not found", g_biggielist_txt);
     1284        mr_msg(1, "Warning - %s not found", g_biggielist_txt);
    12851285    }
    12861286    if (!does_file_exist(g_filelist_full)) {
    1287         log_msg(1, "Warning - %s does not exist", g_filelist_full);
     1287        mr_msg(1, "Warning - %s does not exist", g_filelist_full);
    12881288    }
    12891289//  popup_and_OK("Wonderful.");
    12901290
    1291     log_msg(2, "Forking");
     1291    mr_msg(2, "Forking");
    12921292    pid = fork();
    12931293    switch (pid) {
     
    13171317    close_evalcall_form();
    13181318
    1319     log_msg(3, "loading filelist");
     1319    mr_msg(3, "loading filelist");
    13201320    filelist = load_filelist(g_filelist_full);
    1321     log_msg(3, "deleting original filelist");
     1321    mr_msg(3, "deleting original filelist");
    13221322    unlink(g_filelist_full);
    13231323    if (g_text_mode) {
     
    13341334    }
    13351335    if (res) {
    1336         log_msg(2, "User hit 'cancel'. Freeing filelist and aborting.");
     1336        mr_msg(2, "User hit 'cancel'. Freeing filelist and aborting.");
    13371337        free_filelist(filelist);
    13381338        return (NULL);
     
    14181418    read_cfg_var(g_mondo_cfg_file, "bootloader.name", name);
    14191419    sprintf(tmp, "run_boot_loader: device='%s', name='%s'", device, name);
    1420     log_msg(2, tmp);
     1420    mr_msg(2, tmp);
    14211421    system("sync");
    14221422    if (!strcmp(name, "LILO")) {
     
    14321432//      else
    14331433//        {
    1434 //    log_msg(1, "Not running run_grub(). Was a bad idea anyway.");
     1434//    mr_msg(1, "Not running run_grub(). Was a bad idea anyway.");
    14351435//    res = 1;
    14361436//  }
     
    14481448            res = run_program_and_log_output(tmp, 3);
    14491449        } else {
    1450             log_msg(1,
     1450            mr_msg(1,
    14511451                    "I'm not running any boot loader. You have a DD boot drive. It's already loaded up.");
    14521452        }
     
    14971497    }
    14981498    if (!find_home_of_exe(output)) {
    1499         log_msg(2, " (find_my_editor) --- warning - %s not found", output);
     1499        mr_msg(2, " (find_my_editor) --- warning - %s not found", output);
    15001500    }
    15011501    return (output);
     
    15351535
    15361536    if (!run_program_and_log_output("which grub-MR", FALSE)) {
    1537         log_msg(1, "Yay! grub-MR found...");
     1537        mr_msg(1, "Yay! grub-MR found...");
    15381538        sprintf(command, "grub-MR %s /tmp/mountlist.txt", boot_device);
    1539         log_msg(1, "command = %s", command);
     1539        mr_msg(1, "command = %s", command);
    15401540    } else {
    15411541        sprintf(command, "chroot " MNT_RESTORING " grub-install %s",
    15421542                boot_device);
    1543         log_msg(1, "WARNING - grub-MR not found; using grub-install");
     1543        mr_msg(1, "WARNING - grub-MR not found; using grub-install");
    15441544    }
    15451545    if (offer_to_run_stabgrub
     
    15991599        log_to_screen
    16001600            ("GRUB ran w/error(s). See /tmp/mondo-restore.log for more info.");
    1601         log_msg(1, "Type:-");
    1602         log_msg(1, "    mount-me");
    1603         log_msg(1, "    chroot " MNT_RESTORING);
    1604         log_msg(1, "    mount /boot");
    1605         log_msg(1, "    grub-install '(hd0)'");
    1606         log_msg(1, "    exit");
    1607         log_msg(1, "    unmount-me");
    1608         log_msg(1,
     1601        mr_msg(1, "Type:-");
     1602        mr_msg(1, "    mount-me");
     1603        mr_msg(1, "    chroot " MNT_RESTORING);
     1604        mr_msg(1, "    mount /boot");
     1605        mr_msg(1, "    grub-install '(hd0)'");
     1606        mr_msg(1, "    exit");
     1607        mr_msg(1, "    unmount-me");
     1608        mr_msg(1,
    16091609                "If you're really stuck, please e-mail the mailing list.");
    16101610    } else {
     
    18321832    strcpy(boot_device, bd);
    18331833    sprintf(command, "raw-MR %s /tmp/mountlist.txt", boot_device);
    1834     log_msg(2, "run_raw_mbr() --- command='%s'", command);
     1834    mr_msg(2, "run_raw_mbr() --- command='%s'", command);
    18351835
    18361836    if (offer_to_hack_scripts
     
    20662066void termination_in_progress(int sig)
    20672067{
    2068     log_msg(1, "Termination in progress");
     2068    mr_msg(1, "Termination in progress");
    20692069    usleep(1000);
    20702070    pthread_exit(0);
     
    21132113         i++) {
    21142114        sleep(1);
    2115         log_msg(2, "Waiting for buffer() to finish");
     2115        mr_msg(2, "Waiting for buffer() to finish");
    21162116    }
    21172117
     
    21202120    if (run_program_and_log_output
    21212121        ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/tmp/", FALSE)) {
    2122         log_msg(1,
     2122        mr_msg(1,
    21232123                "Error. Failed to copy log to PC's /tmp dir. (Mounted read-only?)");
    21242124    }
    21252125    if (run_program_and_log_output
    21262126        ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/root/", FALSE)) {
    2127         log_msg(1,
     2127        mr_msg(1,
    21282128                "Error. Failed to copy log to PC's /root dir. (Mounted read-only?)");
    21292129    }
     
    21452145                if (!strcmp(mountlist->el[lino].mountpoint, "/1")) {
    21462146                    sprintf(command, "umount %s/", MNT_RESTORING);
    2147                     log_msg(3,
     2147                    mr_msg(3,
    21482148                            "Well, I know a certain kitty-kitty who'll be sleeping with Mommy tonight...");
    21492149                } else {
     
    21522152                }
    21532153            }
    2154             log_msg(10, "The 'umount' command is '%s'", command);
     2154            mr_msg(10, "The 'umount' command is '%s'", command);
    21552155            res = run_program_and_log_output(command, 3);
    21562156        } else {
     
    21642164            log_to_screen(tmp);
    21652165        } else {
    2166             log_msg(2, tmp);
     2166            mr_msg(2, tmp);
    21672167        }
    21682168    }
     
    22132213            MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB,
    22142214            BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm");
    2215     log_msg(2, "command = '%s'", command);
     2215    mr_msg(2, "command = '%s'", command);
    22162216    res = run_program_and_log_output(command, -1);
    22172217    if (res != 0 && does_file_exist(MONDO_CFG_FILE_STUB)) {
     
    22582258    malloc_string(command);
    22592259    malloc_string(tmp);
    2260     log_msg(2, "gcffa --- starting");
     2260    mr_msg(2, "gcffa --- starting");
    22612261    log_to_screen("I'm thinking...");
    22622262    sprintf(mountpt, "%s/mount.bootdisk", bkpinfo->tmpdir);
     
    22782278    //   make_hole_for_file( cfg_file );
    22792279    //   make_hole_for_file( mountlist_file);
    2280     log_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file);
     2280    mr_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file);
    22812281
    22822282    /* Floppy? */
     
    22902290            "(sleep 15; kill `ps | grep \"%s\" | cut -d' ' -f1` 2> /dev/null) &",
    22912291            command);
    2292     log_msg(1, "tmp = '%s'", tmp);
     2292    mr_msg(1, "tmp = '%s'", tmp);
    22932293    system(tmp);
    22942294    res = run_program_and_log_output(command, FALSE);
     
    23012301    } else {
    23022302        try_plan_B = TRUE;
    2303         log_msg(2,
     2303        mr_msg(2,
    23042304                "Mounted floppy OK but I don't trust it because the archives might contain more up-to-date config file than the floppy does.");
    23052305// NB: If busybox does not support 'mount -o loop' then Plan A WILL NOT WORK.
    2306         log_msg(2, "Processing floppy (plan A?)");
     2306        mr_msg(2, "Processing floppy (plan A?)");
    23072307        sprintf(ramdisk_fname, "%s/mindi.rdz", mountpt);
    23082308        if (!does_file_exist(ramdisk_fname)) {
     
    23102310        }
    23112311        if (!does_file_exist(ramdisk_fname)) {
    2312             log_msg(2,
     2312            mr_msg(2,
    23132313                    "Cannot find ramdisk file on mountpoint. Are you sure that's a boot disk in the drive?");
    23142314        }
    23152315        if (extract_config_file_from_ramdisk
    23162316            (bkpinfo, ramdisk_fname, cfg_file, mountlist_file)) {
    2317             log_msg(2,
     2317            mr_msg(2,
    23182318                    "Warning - failed to extract config file from ramdisk. I think this boot disk is mangled.");
    23192319        }
     
    23232323    }
    23242324    if (!does_file_exist(cfg_file)) {
    2325         log_msg(2, "gcffa --- we don't have cfg file yet.");
     2325        mr_msg(2, "gcffa --- we don't have cfg file yet.");
    23262326        if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    23272327            try_plan_B = TRUE;
    23282328        } else {
    2329             log_msg(2, "gcffa --- calling mount_cdrom now :)");
     2329            mr_msg(2, "gcffa --- calling mount_cdrom now :)");
    23302330            if (!mount_cdrom(bkpinfo)) {
    2331                 log_msg(2,
     2331                mr_msg(2,
    23322332                        "gcffa --- managed to mount CD; so, no need for Plan B");
    23332333                try_plan_B = FALSE;
     
    23412341        }
    23422342        if (try_plan_B) {
    2343             log_msg(2, "gcffa --- OK, switching to Plan B");
     2343            mr_msg(2, "gcffa --- OK, switching to Plan B");
    23442344            chdir(bkpinfo->tmpdir);
    23452345            run_program_and_log_output("mkdir -p tmp", FALSE);
     
    23472347            if (strlen(bkpinfo->media_device) == 0) {
    23482348                strcpy(bkpinfo->media_device, "/dev/st0");
    2349                 log_msg(2, "media_device is blank; assuming %s");
     2349                mr_msg(2, "media_device is blank; assuming %s");
    23502350            }
    23512351            strcpy(tmp, bkpinfo->media_device);
     
    23612361                        if (extract_cfg_file_and_mountlist_from_tape_dev
    23622362                            (bkpinfo->media_device)) {
    2363                             log_msg(3,
     2363                            mr_msg(3,
    23642364                                    "I tried lots of devices but none worked.");
    23652365                            strcpy(bkpinfo->media_device, tmp);
     
    23742374            }
    23752375        } else {
    2376             log_msg(2,
     2376            mr_msg(2,
    23772377                    "gcffa --- looking at mounted CD for mindi-boot.2880.img");
    23782378            sprintf(command,
     
    23812381            sprintf(mounted_cfgf_path, "%s/%s", mountpt, cfg_file);
    23822382            if (!does_file_exist(mounted_cfgf_path)) {
    2383                 log_msg(2,
     2383                mr_msg(2,
    23842384                        "gcffa --- Plan C, a.k.a. untarring some file from all.tar.gz");
    23852385                sprintf(command, "tar -zxvf " MNT_CDROM "/images/all.tar.gz %s %s %s %s %s", MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm");  // add -b TAPE_BLOCK_SIZE if you _really_ think it's necessary
     
    23932393    }
    23942394    if (does_file_exist(MONDO_CFG_FILE_STUB)) {
    2395         log_msg(1, "gcffa --- great! We've got the config file");
     2395        mr_msg(1, "gcffa --- great! We've got the config file");
    23962396        sprintf(tmp, "%s/%s",
    23972397                call_program_and_get_last_line_of_output("pwd"),
     
    24012401        if (strcmp(tmp, cfg_file)
    24022402            && run_program_and_log_output(command, 1)) {
    2403             log_msg(1,
     2403            mr_msg(1,
    24042404                    "... but an error occurred when I tried to move it to %s",
    24052405                    cfg_file);
    24062406        } else {
    2407             log_msg(1, "... and I moved it successfully to %s", cfg_file);
     2407            mr_msg(1, "... and I moved it successfully to %s", cfg_file);
    24082408        }
    24092409        sprintf(command, "cp -f %s/%s %s",
     
    24132413        if (strcmp(tmp, cfg_file)
    24142414            && run_program_and_log_output(command, 1)) {
    2415             log_msg(1, "Failed to get mountlist");
     2415            mr_msg(1, "Failed to get mountlist");
    24162416        } else {
    2417             log_msg(1, "Got mountlist too");
     2417            mr_msg(1, "Got mountlist too");
    24182418            sprintf(command, "cp -f %s %s", mountlist_file,
    24192419                    g_mountlist_fname);
    24202420            if (run_program_and_log_output(command, 1)) {
    2421                 log_msg(1, "Failed to copy mountlist to /tmp");
     2421                mr_msg(1, "Failed to copy mountlist to /tmp");
    24222422            } else {
    2423                 log_msg(1, "Copied mountlist to /tmp as well OK");
     2423                mr_msg(1, "Copied mountlist to /tmp as well OK");
    24242424                sprintf(command, "cp -f tmp/i-want-my-lvm /tmp/");
    24252425                run_program_and_log_output(command, 1);
     
    24272427          if (!run_program_and_log_output(command, 5) && !does_file_exist("/tmp/i-want-my-lvm"))
    24282428            {
    2429           log_msg(1, "Warning. You want LVM but I don't have i-want-my-lvm. FIXME.");
     2429          mr_msg(1, "Warning. You want LVM but I don't have i-want-my-lvm. FIXME.");
    24302430        }
    24312431              else if (run_program_and_log_output(command,5) && does_file_exist("/tmp/i-want-my-lvm"))
    24322432                {
    2433           log_msg(1, "Warning. You don't want LVM but i-want-my-lvm exists. I'll delete it. Cool.");
     2433          mr_msg(1, "Warning. You don't want LVM but i-want-my-lvm exists. I'll delete it. Cool.");
    24342434              do_my_funky_lvm_stuff(TRUE, FALSE); // ...after I stop any LVMs :)
    24352435          stop_raid_device("/dev/md0");
     
    24402440          else if (!run_program_and_log_output(command,5) && does_file_exist("/tmp/i-want-my-lvm"))
    24412441            {
    2442           log_msg(1, "You had better pray that i-want-my-lvm patches your mountlist. FIXME.");
     2442          mr_msg(1, "You had better pray that i-want-my-lvm patches your mountlist. FIXME.");
    24432443        }
    24442444*/
     
    24492449    if (!does_file_exist(cfg_file)) {
    24502450        iamhere(cfg_file);
    2451         log_msg(1, "%s not found", cfg_file);
     2451        mr_msg(1, "%s not found", cfg_file);
    24522452        log_to_screen
    24532453            ("Oh dear. Unable to recover configuration file from boot disk");
     
    25292529        if (parse_mdstat(raidlist, "/dev/")) {
    25302530            log_to_screen("Sorry, cannot read %s", MDSTAT_FILE);
    2531             log_msg(1,"Sorry, cannot read %s", MDSTAT_FILE);
     2531            mr_msg(1,"Sorry, cannot read %s", MDSTAT_FILE);
    25322532            return;
    25332533        }
     
    25392539                    continue;
    25402540                }
    2541                 log_msg(1,"Sync'ing %s (i=%d)", raidlist->el[i].raid_device, i);
     2541                mr_msg(1,"Sync'ing %s (i=%d)", raidlist->el[i].raid_device, i);
    25422542                sprintf(screen_message, "Sync'ing %s",
    25432543                        raidlist->el[i].raid_device);
    25442544                open_evalcall_form(screen_message);
    25452545                while (raidlist->el[i].progress < wait_for_percentage) {
    2546                     log_msg(1,"Percentage sync'ed: %d", raidlist->el[i].progress);
     2546                    mr_msg(1,"Percentage sync'ed: %d", raidlist->el[i].progress);
    25472547                    update_evalcall_form(raidlist->el[i].progress);
    25482548                    sleep(2);
Note: See TracChangeset for help on using the changeset viewer.