Changeset 1086 in MondoRescue for trunk/mondo/src/mondorestore/mondo-rstr-tools.c
- Timestamp:
- Feb 2, 2007, 11:21:27 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/src/mondorestore/mondo-rstr-tools.c
r1084 r1086 194 194 || (!does_file_exist(output_mountlist_file) 195 195 && does_file_exist(orig_fname))) { 196 log_msg(2, "Failed to extract %s and/or %s from ramdisk",196 mr_msg(2, "Failed to extract %s and/or %s from ramdisk", 197 197 output_cfg_file, output_mountlist_file); 198 198 retval = 1; … … 257 257 "Checking to see if f=%s, file=%s, is in the list of biggiefiles", 258 258 f, file); 259 log_msg(2, tmp);259 mr_msg(2, tmp); 260 260 mr_free(tmp); 261 261 … … 308 308 run_program_and_log_output(command, 5); 309 309 mr_free(command); 310 log_msg(2, "Setting isodir to %s", bkpinfo->isodir);310 mr_msg(2, "Setting isodir to %s", bkpinfo->isodir); 311 311 } 312 312 … … 331 331 "The 'mount' command is '%s'. PLEASE report this command to be if you have problems, ok?", 332 332 mount_isodir_command); 333 log_msg(1, tmp);333 mr_msg(1, tmp); 334 334 mr_free(tmp); 335 335 … … 352 352 mr_asprintf(&tmp, "%s #%d has been mounted via loopback mount", 353 353 bkpinfo->backup_media_string, i); 354 log_msg(1, tmp);354 mr_msg(1, tmp); 355 355 mr_free(tmp); 356 356 … … 360 360 retval = 1; 361 361 } 362 log_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__,362 mr_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__, 363 363 bkpinfo->isodir); 364 364 return (retval); … … 409 409 if (!strcmp(mpt, "/1")) { 410 410 mr_asprintf(&mountpoint, "/"); 411 log_msg(3, "Mommm! SME is being a dildo!");411 mr_msg(3, "Mommm! SME is being a dildo!"); 412 412 } else { 413 413 mr_asprintf(&mountpoint, mpt); … … 423 423 } 424 424 mr_asprintf(&tmp, "Mounting device %s ", device); 425 log_msg(1, tmp);425 mr_msg(1, tmp); 426 426 427 427 if (writeable) { … … 465 465 mr_asprintf(&command, "mount -t %s %s %s %s 2>> %s", format, device, 466 466 additional_parameters, mountdir, MONDO_LOGFILE); 467 log_msg(2, "command='%s'", command);467 mr_msg(2, "command='%s'", command); 468 468 } 469 469 mr_free(additional_parameters); … … 471 471 res = run_program_and_log_output(command, TRUE); 472 472 if (res && (strstr(command, "xattr") || strstr(command, "acl"))) { 473 log_msg(1, "Re-trying without the fancy extra parameters");473 mr_msg(1, "Re-trying without the fancy extra parameters"); 474 474 mr_free(command); 475 475 … … 479 479 } 480 480 if (res) { 481 log_msg(1, "Unable to mount device %s (type %s) at %s", device,481 mr_msg(1, "Unable to mount device %s (type %s) at %s", device, 482 482 format, mountdir); 483 log_msg(1, "command was '%s'", command);483 mr_msg(1, "command was '%s'", command); 484 484 if (!strcmp(mountpoint, "swap")) { 485 485 log_to_screen(tmp); 486 486 } else { 487 log_msg(2, "Retrying w/o the '-t' switch");487 mr_msg(2, "Retrying w/o the '-t' switch"); 488 488 mr_free(command); 489 489 490 490 mr_asprintf(&command, "mount %s %s 2>> %s", device, mountdir, 491 491 MONDO_LOGFILE); 492 log_msg(2, "2nd command = '%s'", command);492 mr_msg(2, "2nd command = '%s'", command); 493 493 res = run_program_and_log_output(command, TRUE); 494 494 if (res == 0) { 495 log_msg(1,495 mr_msg(1, 496 496 "That's OK. I called mount w/o a filesystem type and it worked fine in the end."); 497 497 } else { … … 505 505 506 506 if (res && !strcmp(mountpoint, "swap")) { 507 log_msg(2, "That's ok. It's just a swap partition.");508 log_msg(2, "Non-fatal error. Returning 0.");507 mr_msg(2, "That's ok. It's just a swap partition."); 508 mr_msg(2, "Non-fatal error. Returning 0."); 509 509 res = 0; 510 510 } … … 550 550 for (lino = 0; lino < mountlist->entries; lino++) { 551 551 if (!strcmp(mountlist->el[lino].device, "/proc")) { 552 log_msg(1,552 mr_msg(1, 553 553 "Again with the /proc - why is this in your mountlist?"); 554 554 } else if (is_this_device_mounted(mountlist->el[lino].device)) { … … 649 649 if (bkpinfo->backup_media_type == tape 650 650 || bkpinfo->backup_media_type == udev) { 651 log_msg(8, "Tape/udev. Therefore, no need to mount CDROM.");651 mr_msg(8, "Tape/udev. Therefore, no need to mount CDROM."); 652 652 return 0; 653 653 } 654 654 655 655 if (!run_program_and_log_output("mount | grep -F " MNT_CDROM, FALSE)) { 656 log_msg(2, "mount_cdrom() - CD already mounted. Fair enough.");656 mr_msg(2, "mount_cdrom() - CD already mounted. Fair enough."); 657 657 return (0); 658 658 } 659 659 660 660 if (bkpinfo->backup_media_type == nfs) { 661 log_msg(2, "Mounting for NFS thingy");662 log_msg(2, "isodir = %s", bkpinfo->isodir);661 mr_msg(2, "Mounting for NFS thingy"); 662 mr_msg(2, "isodir = %s", bkpinfo->isodir); 663 663 if ((!bkpinfo->isodir || !strcmp(bkpinfo->isodir, "/")) 664 664 && am_I_in_disaster_recovery_mode()) { 665 665 mr_allocstr(bkpinfo->isodir, "/tmp/isodir"); 666 log_msg(1, "isodir is being set to %s", bkpinfo->isodir);666 mr_msg(1, "isodir is being set to %s", bkpinfo->isodir); 667 667 } 668 668 #ifdef __FreeBSD__ … … 728 728 729 729 } 730 log_msg(2, "(mount_cdrom) --- command = %s", mount_cmd);730 mr_msg(2, "(mount_cdrom) --- command = %s", mount_cmd); 731 731 for (i = 0; i < 2; i++) { 732 732 res = run_program_and_log_output(mount_cmd, FALSE); … … 734 734 break; 735 735 } else { 736 log_msg(2, "Failed to mount CD-ROM drive.");736 mr_msg(2, "Failed to mount CD-ROM drive."); 737 737 sleep(5); 738 738 run_program_and_log_output("sync", FALSE); … … 742 742 743 743 if (res) { 744 log_msg(2, "Failed, despite %d attempts", i);745 } else { 746 log_msg(2, "Mounted CD-ROM drive OK");744 mr_msg(2, "Failed, despite %d attempts", i); 745 } else { 746 mr_msg(2, "Mounted CD-ROM drive OK"); 747 747 } 748 748 return (res); … … 830 830 /* Check to see if CD is already mounted before mounting it... */ 831 831 if (!is_this_device_mounted("/dev/cdrom")) { 832 log_msg(2,832 mr_msg(2, 833 833 "NB: CDROM device not mounted, mounting..."); 834 834 run_program_and_log_output("mount /dev/cdrom " … … 897 897 mr_asprintf(&tmp, "Backup medium is TAPE --- dev=%s", 898 898 bkpinfo->media_device); 899 log_msg(2, tmp);899 mr_msg(2, tmp); 900 900 mr_free(tmp); 901 901 } else { … … 903 903 bkpinfo->media_size[0] = 1999 * 1024; /* 650, probably, but we don't need this var anyway */ 904 904 bkpinfo->media_size[1] = 1999 * 1024; /* 650, probably, but we don't need this var anyway */ 905 log_msg(2, "Backup medium is CD-R[W]");906 } 907 } else { 908 log_msg(2,905 mr_msg(2, "Backup medium is CD-R[W]"); 906 } 907 } else { 908 mr_msg(2, 909 909 "Not in Disaster Recovery Mode. No need to derive device name from config file."); 910 910 } … … 913 913 if (strstr(value, "yes")) { 914 914 bkpinfo->use_star = TRUE; 915 log_msg(1, "Goody! ... bkpinfo->use_star is now true.");915 mr_msg(1, "Goody! ... bkpinfo->use_star is now true."); 916 916 } 917 917 mr_free(value); … … 920 920 if (strstr(value, "TRUE")) { 921 921 mr_asprintf(&g_getfacl,"setfacl"); 922 log_msg(1, "We will restore ACLs");922 mr_msg(1, "We will restore ACLs"); 923 923 if (! find_home_of_exe("setfacl")) { 924 log_msg(1, "Unable to restore ACLs as no setfacl found");924 mr_msg(1, "Unable to restore ACLs as no setfacl found"); 925 925 } 926 926 } … … 928 928 if (strstr(value, "TRUE")) { 929 929 mr_asprintf(&g_getfattr,"setfattr"); 930 log_msg(1, "We will restore XATTRs");930 mr_msg(1, "We will restore XATTRs"); 931 931 if (! find_home_of_exe("setfattr")) { 932 log_msg(1, "Unable to restore XATTRs as no setfattr found");932 mr_msg(1, "Unable to restore XATTRs as no setfattr found"); 933 933 } 934 934 } … … 936 936 if (0 == read_cfg_var(cfg_file, "internal-tape-block-size", value)) { 937 937 bkpinfo->internal_tape_block_size = atol(value); 938 log_msg(1, "Internal tape block size has been custom-set to %ld",938 mr_msg(1, "Internal tape block size has been custom-set to %ld", 939 939 bkpinfo->internal_tape_block_size); 940 940 } else { 941 941 bkpinfo->internal_tape_block_size = 942 942 DEFAULT_INTERNAL_TAPE_BLOCK_SIZE; 943 log_msg(1, "Internal tape block size = default (%ld)",943 mr_msg(1, "Internal tape block size = default (%ld)", 944 944 DEFAULT_INTERNAL_TAPE_BLOCK_SIZE); 945 945 } … … 980 980 bkpinfo->differential = TRUE; 981 981 } 982 log_msg(2, "differential var = '%s'", value);982 mr_msg(2, "differential var = '%s'", value); 983 983 mr_free(value); 984 984 985 985 if (bkpinfo->differential) { 986 log_msg(2, "THIS IS A DIFFERENTIAL BACKUP");987 } else { 988 log_msg(2, "This is a regular (full) backup");986 mr_msg(2, "THIS IS A DIFFERENTIAL BACKUP"); 987 } else { 988 mr_msg(2, "This is a regular (full) backup"); 989 989 } 990 990 … … 997 997 if ((tmp != NULL) || strstr(tmp1,"donteject")) { 998 998 bkpinfo->please_dont_eject = TRUE; 999 log_msg(2, "Ok, I shan't eject when restoring! Groovy.");999 mr_msg(2, "Ok, I shan't eject when restoring! Groovy."); 1000 1000 } 1001 1001 mr_free(tmp); … … 1004 1004 if (bkpinfo->backup_media_type == nfs) { 1005 1005 if (!cfgf) { 1006 log_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);1007 log_msg(2, "nfs_remote_dir remains %s",1006 mr_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount); 1007 mr_msg(2, "nfs_remote_dir remains %s", 1008 1008 bkpinfo->nfs_remote_dir); 1009 log_msg(2,1009 mr_msg(2, 1010 1010 "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place"); 1011 1011 } else { … … 1016 1016 read_cfg_var(g_mondo_cfg_file, "nfs-server-path", 1017 1017 bkpinfo->nfs_remote_dir); 1018 log_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);1019 log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);1018 mr_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount); 1019 mr_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir); 1020 1020 } 1021 1021 if (strstr(call_program_and_get_last_line_of_output … … 1060 1060 mr_free(g_isodir_device); 1061 1061 read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device); 1062 log_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir, g_isodir_device);1062 mr_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir, g_isodir_device); 1063 1063 if (bkpinfo->disaster_recovery) { 1064 1064 if (is_this_device_mounted(g_isodir_device)) { 1065 log_msg(2, "NB: isodir is already mounted");1065 mr_msg(2, "NB: isodir is already mounted"); 1066 1066 /* Find out where it's mounted */ 1067 1067 mr_asprintf(&command, … … 1081 1081 mr_asprintf(&tmp, "mount %s %s", g_isodir_device, iso_mnt); 1082 1082 if (run_program_and_log_output(tmp, 3)) { 1083 log_msg(1,1083 mr_msg(1, 1084 1084 "Unable to mount isodir. Perhaps this is really a CD backup?"); 1085 1085 bkpinfo->backup_media_type = cdr; … … 1095 1095 ("Unable to mount isodir. Failed to mount CD-ROM as well."); 1096 1096 } else { 1097 log_msg(1,1097 mr_msg(1, 1098 1098 "You backed up to disk, then burned some CDs."); 1099 1099 } … … 1114 1114 if (g_restoring_live_from_cd) { 1115 1115 if (bkpinfo->backup_media_type != media_specified_by_user) { 1116 log_msg(2,1116 mr_msg(2, 1117 1117 "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)"); 1118 1118 interactively_obtain_media_parameters_from_user(bkpinfo, FALSE); … … 1163 1163 if (does_file_exist(g_filelist_full) 1164 1164 && does_file_exist(g_biggielist_txt)) { 1165 log_msg(1, "%s exists", g_filelist_full);1166 log_msg(1, "%s exists", g_biggielist_txt);1167 log_msg(2,1165 mr_msg(1, "%s exists", g_filelist_full); 1166 mr_msg(1, "%s exists", g_biggielist_txt); 1167 mr_msg(2, 1168 1168 "Filelist and biggielist already recovered from media. Yay!"); 1169 1169 } else { 1170 1170 getcwd(tmp, MAX_STR_LEN); 1171 1171 chdir(bkpinfo->tmpdir); 1172 log_msg(1, "chdir(%s)", bkpinfo->tmpdir);1172 mr_msg(1, "chdir(%s)", bkpinfo->tmpdir); 1173 1173 log_to_screen("Extracting filelist and biggielist from media..."); 1174 1174 unlink("/tmp/filelist.full"); … … 1183 1183 FILELIST_FULL_STUB, 1184 1184 "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1185 log_msg(1, "tarcommand = %s", command);1185 mr_msg(1, "tarcommand = %s", command); 1186 1186 run_program_and_log_output(command, 1); 1187 1187 mr_free(command); 1188 1188 } else { 1189 log_msg(2,1189 mr_msg(2, 1190 1190 "Calling insist_on_this_cd_number; bkpinfo->isodir=%s", 1191 1191 bkpinfo->isodir); 1192 1192 insist_on_this_cd_number(bkpinfo, 1); 1193 log_msg(2, "Back from iotcn");1193 mr_msg(2, "Back from iotcn"); 1194 1194 run_program_and_log_output("mount", 1); 1195 1195 mr_asprintf(&command, … … 1201 1201 "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1202 1202 1203 log_msg(1, "tarcommand = %s", command);1203 mr_msg(1, "tarcommand = %s", command); 1204 1204 run_program_and_log_output(command, 1); 1205 1205 mr_free(command); … … 1221 1221 mr_asprintf(&command, "cp -f %s/%s %s", bkpinfo->tmpdir, 1222 1222 BIGGIELIST_TXT_STUB, g_biggielist_txt); 1223 log_msg(1, "command = %s", command);1223 mr_msg(1, "command = %s", command); 1224 1224 paranoid_system(command); 1225 1225 mr_free(command); … … 1227 1227 mr_asprintf(&command, "ln -sf %s/%s %s", bkpinfo->tmpdir, 1228 1228 FILELIST_FULL_STUB, g_filelist_full); 1229 log_msg(1, "command = %s", command);1229 mr_msg(1, "command = %s", command); 1230 1230 paranoid_system(command); 1231 1231 mr_free(command); … … 1247 1247 1248 1248 if (!does_file_exist(g_biggielist_txt)) { 1249 log_msg(1, "Warning - %s not found", g_biggielist_txt);1249 mr_msg(1, "Warning - %s not found", g_biggielist_txt); 1250 1250 } 1251 1251 if (!does_file_exist(g_filelist_full)) { 1252 log_msg(1, "Warning - %s does not exist", g_filelist_full);1252 mr_msg(1, "Warning - %s does not exist", g_filelist_full); 1253 1253 } 1254 1254 // popup_and_OK("Wonderful."); 1255 1255 1256 log_msg(2, "Forking");1256 mr_msg(2, "Forking"); 1257 1257 pid = fork(); 1258 1258 switch (pid) { … … 1284 1284 close_evalcall_form(); 1285 1285 1286 log_msg(3, "loading filelist");1286 mr_msg(3, "loading filelist"); 1287 1287 filelist = load_filelist(g_filelist_full); 1288 log_msg(3, "deleting original filelist");1288 mr_msg(3, "deleting original filelist"); 1289 1289 unlink(g_filelist_full); 1290 1290 if (g_text_mode) { … … 1302 1302 } 1303 1303 if (res) { 1304 log_msg(2, "User hit 'cancel'. Freeing filelist and aborting.");1304 mr_msg(2, "User hit 'cancel'. Freeing filelist and aborting."); 1305 1305 free_filelist(filelist); 1306 1306 return (NULL); … … 1370 1370 read_cfg_var(g_mondo_cfg_file, "bootloader.name", name); 1371 1371 mr_asprintf(&tmp, "run_boot_loader: device='%s', name='%s'", device, name); 1372 log_msg(2, tmp);1372 mr_msg(2, tmp); 1373 1373 mr_free(tmp); 1374 1374 … … 1386 1386 // else 1387 1387 // { 1388 // log_msg(1, "Not running run_grub(). Was a bad idea anyway.");1388 // mr_msg(1, "Not running run_grub(). Was a bad idea anyway."); 1389 1389 // res = 1; 1390 1390 // } … … 1404 1404 res = run_program_and_log_output(tmp, 3); 1405 1405 } else { 1406 log_msg(1,1406 mr_msg(1, 1407 1407 "I'm not running any boot loader. You have a DD boot drive. It's already loaded up."); 1408 1408 } … … 1464 1464 tmp = find_home_of_exe(output); 1465 1465 if (!tmp) { 1466 log_msg(2, " (find_my_editor) --- warning - %s not found", output);1466 mr_msg(2, " (find_my_editor) --- warning - %s not found", output); 1467 1467 } 1468 1468 mr_free(tmp); … … 1536 1536 /* nuke mode */ 1537 1537 if (!run_program_and_log_output("which grub-MR", FALSE)) { 1538 log_msg(1, "Yay! grub-MR found...");1538 mr_msg(1, "Yay! grub-MR found..."); 1539 1539 mr_asprintf(&command, "grub-MR %s /tmp/mountlist.txt", bd); 1540 log_msg(1, "command = %s", command);1540 mr_msg(1, "command = %s", command); 1541 1541 } else { 1542 1542 mr_asprintf(&command, "chroot " MNT_RESTORING " grub-install %s", bd); 1543 log_msg(1, "WARNING - grub-MR not found; using grub-install");1543 mr_msg(1, "WARNING - grub-MR not found; using grub-install"); 1544 1544 } 1545 1545 mvaddstr_and_log_it(g_currentY, … … 1566 1566 (_ 1567 1567 ("GRUB ran w/error(s). See /tmp/mondo-restore.log for more info.")); 1568 log_msg(1, "Type:-");1569 log_msg(1, " mount-me");1570 log_msg(1, " chroot " MNT_RESTORING);1571 log_msg(1, " mount /boot");1572 log_msg(1, " grub-install '(hd0)'");1573 log_msg(1, " exit");1574 log_msg(1, " unmount-me");1575 log_msg(1,1568 mr_msg(1, "Type:-"); 1569 mr_msg(1, " mount-me"); 1570 mr_msg(1, " chroot " MNT_RESTORING); 1571 mr_msg(1, " mount /boot"); 1572 mr_msg(1, " grub-install '(hd0)'"); 1573 mr_msg(1, " exit"); 1574 mr_msg(1, " unmount-me"); 1575 mr_msg(1, 1576 1576 "If you're really stuck, please e-mail the mailing list."); 1577 1577 } else { … … 1829 1829 ("Restoring MBR... ")); 1830 1830 mr_asprintf(&command, "raw-MR %s /tmp/mountlist.txt", bd); 1831 log_msg(2, "run_raw_mbr() --- command='%s'", command);1831 mr_msg(2, "run_raw_mbr() --- command='%s'", command); 1832 1832 res = run_program_and_log_output(command, 3); 1833 1833 mr_free(command); … … 1999 1999 void termination_in_progress(int sig) 2000 2000 { 2001 log_msg(1, "Termination in progress");2001 mr_msg(1, "Termination in progress"); 2002 2002 usleep(1000); 2003 2003 pthread_exit(0); … … 2047 2047 i++) { 2048 2048 sleep(1); 2049 log_msg(2, "Waiting for buffer() to finish");2049 mr_msg(2, "Waiting for buffer() to finish"); 2050 2050 } 2051 2051 … … 2054 2054 if (run_program_and_log_output 2055 2055 ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/tmp/", FALSE)) { 2056 log_msg(1,2056 mr_msg(1, 2057 2057 "Error. Failed to copy log to PC's /tmp dir. (Mounted read-only?)"); 2058 2058 } 2059 2059 if (run_program_and_log_output 2060 2060 ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/root/", FALSE)) { 2061 log_msg(1,2061 mr_msg(1, 2062 2062 "Error. Failed to copy log to PC's /root dir. (Mounted read-only?)"); 2063 2063 } … … 2081 2081 if (!strcmp(mountlist->el[lino].mountpoint, "/1")) { 2082 2082 mr_asprintf(&command, "umount %s/", MNT_RESTORING); 2083 log_msg(3,2083 mr_msg(3, 2084 2084 "Well, I know a certain kitty-kitty who'll be sleeping with Mommy tonight..."); 2085 2085 } else { … … 2088 2088 } 2089 2089 } 2090 log_msg(10, "The 'umount' command is '%s'", command);2090 mr_msg(10, "The 'umount' command is '%s'", command); 2091 2091 res = run_program_and_log_output(command, 3); 2092 2092 mr_free(command); … … 2105 2105 log_to_screen(tmp); 2106 2106 } else { 2107 log_msg(2, tmp);2107 mr_msg(2, tmp); 2108 2108 } 2109 2109 mr_free(tmp); … … 2149 2149 MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, 2150 2150 BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm"); 2151 log_msg(2, "command = '%s'", command);2151 mr_msg(2, "command = '%s'", command); 2152 2152 res = run_program_and_log_output(command, -1); 2153 2153 mr_free(command); … … 2185 2185 2186 2186 assert(bkpinfo != NULL); 2187 log_msg(2, "gcffa --- starting");2187 mr_msg(2, "gcffa --- starting"); 2188 2188 log_to_screen(_("I'm thinking...")); 2189 2189 mr_asprintf(&mountpt, "%s/mount.bootdisk", bkpinfo->tmpdir); … … 2202 2202 mr_asprintf(&mountlist_file, "%s/%s", bkpinfo->tmpdir, 2203 2203 MOUNTLIST_FNAME_STUB); 2204 log_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file);2204 mr_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file); 2205 2205 2206 2206 /* Floppy? */ … … 2217 2217 "(sleep 15; kill `ps | grep \"%s\" | cut -d' ' -f1` 2> /dev/null) &", 2218 2218 command); 2219 log_msg(1, "tmp = '%s'", tmp);2219 mr_msg(1, "tmp = '%s'", tmp); 2220 2220 system(tmp); 2221 2221 mr_free(tmp); … … 2233 2233 } else { 2234 2234 try_plan_B = TRUE; 2235 log_msg(2,2235 mr_msg(2, 2236 2236 "Mounted floppy OK but I don't trust it because the archives might contain more up-to-date config file than the floppy does."); 2237 2237 // NB: If busybox does not support 'mount -o loop' then Plan A WILL NOT WORK. 2238 log_msg(2, "Processing floppy (plan A?)");2238 mr_msg(2, "Processing floppy (plan A?)"); 2239 2239 mr_asprintf(&ramdisk_fname, "%s/mindi.rdz", mountpt); 2240 2240 if (!does_file_exist(ramdisk_fname)) { … … 2243 2243 } 2244 2244 if (!does_file_exist(ramdisk_fname)) { 2245 log_msg(2,2245 mr_msg(2, 2246 2246 "Cannot find ramdisk file on mountpoint. Are you sure that's a boot disk in the drive?"); 2247 2247 } 2248 2248 if (extract_config_file_from_ramdisk 2249 2249 (bkpinfo, ramdisk_fname, cfg_file, mountlist_file)) { 2250 log_msg(2,2250 mr_msg(2, 2251 2251 "Warning - failed to extract config file from ramdisk. I think this boot disk is mangled."); 2252 2252 } … … 2259 2259 } 2260 2260 if (!does_file_exist(cfg_file)) { 2261 log_msg(2, "gcffa --- we don't have cfg file yet.");2261 mr_msg(2, "gcffa --- we don't have cfg file yet."); 2262 2262 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2263 2263 try_plan_B = TRUE; 2264 2264 } else { 2265 log_msg(2, "gcffa --- calling mount_cdrom now :)");2265 mr_msg(2, "gcffa --- calling mount_cdrom now :)"); 2266 2266 if (!mount_cdrom(bkpinfo)) { 2267 log_msg(2,2267 mr_msg(2, 2268 2268 "gcffa --- managed to mount CD; so, no need for Plan B"); 2269 2269 try_plan_B = FALSE; … … 2277 2277 } 2278 2278 if (try_plan_B) { 2279 log_msg(2, "gcffa --- OK, switching to Plan B");2279 mr_msg(2, "gcffa --- OK, switching to Plan B"); 2280 2280 chdir(bkpinfo->tmpdir); 2281 2281 run_program_and_log_output("mkdir -p tmp", FALSE); … … 2283 2283 if (bkpinfo->media_device == NULL) { 2284 2284 mr_asprintf(&bkpinfo->media_device, "/dev/st0"); 2285 log_msg(2, "media_device is blank; assuming %s",2285 mr_msg(2, "media_device is blank; assuming %s", 2286 2286 bkpinfo->media_device); 2287 2287 } … … 2298 2298 if (extract_cfg_file_and_mountlist_from_tape_dev 2299 2299 (bkpinfo->media_device)) { 2300 log_msg(3,2300 mr_msg(3, 2301 2301 "I tried lots of devices but none worked."); 2302 2302 mr_allocstr(bkpinfo->media_device, sav); … … 2313 2313 } 2314 2314 } else { 2315 log_msg(2,2315 mr_msg(2, 2316 2316 "gcffa --- looking at mounted CD for mindi-boot.2880.img"); 2317 2317 /* BERLIOS : Useless ? … … 2322 2322 mr_asprintf(&mounted_cfgf_path, "%s/%s", mountpt, cfg_file); 2323 2323 if (!does_file_exist(mounted_cfgf_path)) { 2324 log_msg(2,2324 mr_msg(2, 2325 2325 "gcffa --- Plan C, a.k.a. untarring some file from all.tar.gz"); 2326 2326 mr_asprintf(&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 … … 2339 2339 2340 2340 if (does_file_exist(MONDO_CFG_FILE_STUB)) { 2341 log_msg(1, "gcffa --- great! We've got the config file");2341 mr_msg(1, "gcffa --- great! We've got the config file"); 2342 2342 tmp1 = call_program_and_get_last_line_of_output("pwd"); 2343 2343 mr_asprintf(&tmp, "%s/%s", tmp1,MONDO_CFG_FILE_STUB); … … 2347 2347 if (strcmp(tmp, cfg_file) 2348 2348 && run_program_and_log_output(command, 1)) { 2349 log_msg(1,2349 mr_msg(1, 2350 2350 "... but an error occurred when I tried to move it to %s", 2351 2351 cfg_file); 2352 2352 } else { 2353 log_msg(1, "... and I moved it successfully to %s", cfg_file);2353 mr_msg(1, "... and I moved it successfully to %s", cfg_file); 2354 2354 } 2355 2355 mr_free(command); … … 2362 2362 if (strcmp(tmp, cfg_file) 2363 2363 && run_program_and_log_output(command, 1)) { 2364 log_msg(1, "Failed to get mountlist");2364 mr_msg(1, "Failed to get mountlist"); 2365 2365 } else { 2366 log_msg(1, "Got mountlist too");2366 mr_msg(1, "Got mountlist too"); 2367 2367 mr_free(command); 2368 2368 mr_asprintf(&command, "cp -f %s %s", mountlist_file, 2369 2369 g_mountlist_fname); 2370 2370 if (run_program_and_log_output(command, 1)) { 2371 log_msg(1, "Failed to copy mountlist to /tmp");2371 mr_msg(1, "Failed to copy mountlist to /tmp"); 2372 2372 } else { 2373 log_msg(1, "Copied mountlist to /tmp as well OK");2373 mr_msg(1, "Copied mountlist to /tmp as well OK"); 2374 2374 mr_free(command); 2375 2375 mr_asprintf(&command, "cp -f tmp/i-want-my-lvm /tmp/"); … … 2383 2383 if (!does_file_exist(cfg_file)) { 2384 2384 iamhere(cfg_file); 2385 log_msg(1, "%s not found", cfg_file);2385 mr_msg(1, "%s not found", cfg_file); 2386 2386 log_to_screen 2387 2387 (_ … … 2448 2448 if (parse_mdstat(raidlist, "/dev/")) { 2449 2449 log_to_screen("Sorry, cannot read %s", MDSTAT_FILE); 2450 log_msg(1, "Sorry, cannot read %s", MDSTAT_FILE);2450 mr_msg(1, "Sorry, cannot read %s", MDSTAT_FILE); 2451 2451 return; 2452 2452 } … … 2455 2455 if (raidlist->el[i].progress < wait_for_percentage) { 2456 2456 unfinished_mdstat_devices++; 2457 log_msg(1, "Sync'ing %s (i=%d)",2457 mr_msg(1, "Sync'ing %s (i=%d)", 2458 2458 raidlist->el[i].raid_device, i); 2459 2459 mr_asprintf(&screen_message, "Sync'ing %s", … … 2466 2466 } 2467 2467 while (raidlist->el[i].progress < wait_for_percentage) { 2468 log_msg(1, "Percentage sync'ed: %d",2468 mr_msg(1, "Percentage sync'ed: %d", 2469 2469 raidlist->el[i].progress); 2470 2470 update_evalcall_form(raidlist->el[i].progress);
Note:
See TracChangeset
for help on using the changeset viewer.