Changeset 1108 in MondoRescue for branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
- Timestamp:
- Feb 8, 2007, 12:10:16 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
r1103 r1108 207 207 || (!does_file_exist(output_mountlist_file) 208 208 && 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", 210 210 output_cfg_file, output_mountlist_file); 211 211 retval = 1; … … 275 275 "Checking to see if f=%s, file=%s, is in the list of biggiefiles", 276 276 f, file); 277 log_msg(2, tmp);277 mr_msg(2, tmp); 278 278 sprintf(command, "grep -E '^%s$' %s", file, list_fname); 279 279 res = run_program_and_log_output(command, FALSE); … … 324 324 sprintf(command, "mkdir -p %s", bkpinfo->isodir); 325 325 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); 327 327 } 328 328 … … 349 349 "The 'mount' command is '%s'. PLEASE report this command to be if you have problems, ok?", 350 350 mount_isodir_command); 351 log_msg(1, tmp);351 mr_msg(1, tmp); 352 352 if (run_program_and_log_output(mount_isodir_command, FALSE)) { 353 353 popup_and_OK … … 364 364 sprintf(tmp, "%s #%d has been mounted via loopback mount", 365 365 media_descriptor_string(bkpinfo->backup_media_type), i); 366 log_msg(1, tmp);366 mr_msg(1, tmp); 367 367 if (i < 0) { 368 368 popup_and_OK … … 370 370 retval = 1; 371 371 } 372 log_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__,372 mr_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__, 373 373 bkpinfo->isodir); 374 374 mr_free(mount_isodir_command); … … 501 501 for (lino = 0; lino < mountlist->entries; lino++) { 502 502 if (!strcmp(mountlist->el[lino].device, "/proc")) { 503 log_msg(1,503 mr_msg(1, 504 504 "Again with the /proc - why is this in your mountlist?"); 505 505 } else if (is_this_device_mounted(mountlist->el[lino].device)) { … … 591 591 if (bkpinfo->backup_media_type == tape 592 592 || 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."); 594 594 mr_free(mount_cmd); 595 595 return 0; … … 597 597 598 598 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."); 600 600 mr_free(mount_cmd); 601 601 return (0); … … 603 603 604 604 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); 607 607 if ((!bkpinfo->isodir[0] || !strcmp(bkpinfo->isodir, "/")) 608 608 && am_I_in_disaster_recovery_mode()) { 609 609 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); 611 611 } 612 612 #ifdef __FreeBSD__ … … 663 663 664 664 } 665 log_msg(2, "(mount_cdrom) --- command = %s", mount_cmd);665 mr_msg(2, "(mount_cdrom) --- command = %s", mount_cmd); 666 666 for (i = 0; i < 2; i++) { 667 667 res = run_program_and_log_output(mount_cmd, FALSE); … … 669 669 break; 670 670 } else { 671 log_msg(2, "Failed to mount CD-ROM drive.");671 mr_msg(2, "Failed to mount CD-ROM drive."); 672 672 sleep(5); 673 673 run_program_and_log_output("sync", FALSE); … … 675 675 } 676 676 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"); 680 680 } 681 681 mr_free(mount_cmd); … … 718 718 if (!strcmp(mpt, "/1")) { 719 719 strcpy(mountpoint, "/"); 720 log_msg(3, "Mommm! SME is being a dildo!");720 mr_msg(3, "Mommm! SME is being a dildo!"); 721 721 } else { 722 722 strcpy(mountpoint, mpt); … … 730 730 } 731 731 sprintf(tmp, "Mounting device %s ", device); 732 log_msg(1, tmp);732 mr_msg(1, tmp); 733 733 if (writeable) { 734 734 strcpy(additional_parameters, "-o rw"); … … 755 755 sprintf(command, "mount -t %s %s %s %s 2>> %s", format, device, 756 756 additional_parameters, mountdir, MONDO_LOGFILE); 757 log_msg(2, "command='%s'", command);757 mr_msg(2, "command='%s'", command); 758 758 } 759 759 res = run_program_and_log_output(command, TRUE); 760 760 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"); 762 762 sprintf(command, "mount -t %s %s %s 2>> %s", format, device, 763 763 mountdir, MONDO_LOGFILE); … … 765 765 } 766 766 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, 768 768 format, mountdir); 769 log_msg(1, "command was '%s'", command);769 mr_msg(1, "command was '%s'", command); 770 770 if (!strcmp(mountpoint, "swap")) { 771 771 log_to_screen(tmp); 772 772 } else { 773 log_msg(2, "Retrying w/o the '-t' switch");773 mr_msg(2, "Retrying w/o the '-t' switch"); 774 774 sprintf(command, "mount %s %s 2>> %s", device, mountdir, 775 775 MONDO_LOGFILE); 776 log_msg(2, "2nd command = '%s'", command);776 mr_msg(2, "2nd command = '%s'", command); 777 777 res = run_program_and_log_output(command, TRUE); 778 778 if (res == 0) { 779 log_msg(1,779 mr_msg(1, 780 780 "That's OK. I called mount w/o a filesystem type and it worked fine in the end."); 781 781 } else { … … 785 785 } 786 786 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."); 789 789 res = 0; 790 790 } … … 898 898 /* Check to see if CD is already mounted before mounting it... */ 899 899 if (!is_this_device_mounted("/dev/cdrom")) { 900 log_msg(2,900 mr_msg(2, 901 901 "NB: CDROM device not mounted, mounting..."); 902 902 run_program_and_log_output("mount /dev/cdrom " … … 959 959 sprintf(tmp, "Backup medium is TAPE --- dev=%s", 960 960 bkpinfo->media_device); 961 log_msg(2, tmp);961 mr_msg(2, tmp); 962 962 } else { 963 963 strcpy(bkpinfo->media_device, "/dev/cdrom"); /* we don't really need this var */ 964 964 bkpinfo->media_size[0] = 1999 * 1024; /* 650, probably, but we don't need this var anyway */ 965 965 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, 970 970 "Not in Disaster Recovery Mode. No need to derive device name from config file."); 971 971 } … … 974 974 if (strstr(value, "yes")) { 975 975 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."); 977 977 } 978 978 … … 980 980 if (strstr(value, "yes")) { 981 981 mr_asprintf(&g_getfacl,"setfacl"); 982 log_msg(1, "We will restore ACLs");982 mr_msg(1, "We will restore ACLs"); 983 983 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"); 985 985 } 986 986 } … … 988 988 if (strstr(value, "yes")) { 989 989 mr_asprintf(&g_getfattr,"setfattr"); 990 log_msg(1, "We will restore XATTRs");990 mr_msg(1, "We will restore XATTRs"); 991 991 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"); 993 993 } 994 994 } … … 996 996 if (0 == read_cfg_var(cfg_file, "internal-tape-block-size", value)) { 997 997 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", 999 999 bkpinfo->internal_tape_block_size); 1000 1000 } else { 1001 1001 bkpinfo->internal_tape_block_size = 1002 1002 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)", 1004 1004 DEFAULT_INTERNAL_TAPE_BLOCK_SIZE); 1005 1005 } … … 1036 1036 bkpinfo->differential = TRUE; 1037 1037 } 1038 log_msg(2, "differential var = '%s'", value);1038 mr_msg(2, "differential var = '%s'", value); 1039 1039 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"); 1043 1043 } 1044 1044 … … 1049 1049 ("cat /proc/cmdline"), "donteject")) { 1050 1050 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."); 1052 1052 } 1053 1053 1054 1054 if (bkpinfo->backup_media_type == nfs) { 1055 1055 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", 1058 1058 bkpinfo->nfs_remote_dir); 1059 log_msg(2,1059 mr_msg(2, 1060 1060 "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place"); 1061 1061 } else { … … 1064 1064 read_cfg_var(g_mondo_cfg_file, "nfs-server-path", 1065 1065 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); 1068 1068 } 1069 1069 if (strstr(call_program_and_get_last_line_of_output … … 1103 1103 } 1104 1104 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, 1106 1106 g_isodir_device); 1107 1107 if (bkpinfo->disaster_recovery) { 1108 1108 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"); 1110 1110 /* Find out where it's mounted */ 1111 1111 sprintf(command, … … 1123 1123 sprintf(tmp, "mount %s %s", g_isodir_device, iso_mnt); 1124 1124 if (run_program_and_log_output(tmp, 3)) { 1125 log_msg(1,1125 mr_msg(1, 1126 1126 "Unable to mount isodir. Perhaps this is really a CD backup?"); 1127 1127 bkpinfo->backup_media_type = cdr; … … 1132 1132 ("Unable to mount isodir. Failed to mount CD-ROM as well."); 1133 1133 } else { 1134 log_msg(1,1134 mr_msg(1, 1135 1135 "You backed up to disk, then burned some CDs."); 1136 1136 } … … 1147 1147 if (g_restoring_live_from_cd) { 1148 1148 if (bkpinfo->backup_media_type != media_specified_by_user) { 1149 log_msg(2,1149 mr_msg(2, 1150 1150 "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)"); 1151 1151 interactively_obtain_media_parameters_from_user(bkpinfo, … … 1206 1206 if (does_file_exist(g_filelist_full) 1207 1207 && 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, 1211 1211 "Filelist and biggielist already recovered from media. Yay!"); 1212 1212 } else { 1213 1213 getcwd(tmp, MAX_STR_LEN); 1214 1214 chdir(bkpinfo->tmpdir); 1215 log_msg(1, "chdir(%s)", bkpinfo->tmpdir);1215 mr_msg(1, "chdir(%s)", bkpinfo->tmpdir); 1216 1216 log_to_screen("Extracting filelist and biggielist from media..."); 1217 1217 unlink("/tmp/filelist.full"); … … 1226 1226 FILELIST_FULL_STUB, 1227 1227 "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1228 log_msg(1, "tarcommand = %s", command);1228 mr_msg(1, "tarcommand = %s", command); 1229 1229 run_program_and_log_output(command, 1); 1230 1230 } else { 1231 log_msg(2,1231 mr_msg(2, 1232 1232 "Calling insist_on_this_cd_number; bkpinfo->isodir=%s", 1233 1233 bkpinfo->isodir); 1234 1234 insist_on_this_cd_number(bkpinfo, 1); 1235 log_msg(2, "Back from iotcn");1235 mr_msg(2, "Back from iotcn"); 1236 1236 run_program_and_log_output("mount", 1); 1237 1237 sprintf(command, … … 1243 1243 "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1244 1244 1245 log_msg(1, "tarcommand = %s", command);1245 mr_msg(1, "tarcommand = %s", command); 1246 1246 run_program_and_log_output(command, 1); 1247 1247 // popup_and_OK("Press ENTER to continue"); … … 1261 1261 sprintf(command, "cp -f %s/%s %s", bkpinfo->tmpdir, 1262 1262 BIGGIELIST_TXT_STUB, g_biggielist_txt); 1263 log_msg(1, "command = %s", command);1263 mr_msg(1, "command = %s", command); 1264 1264 paranoid_system(command); 1265 1265 sprintf(command, "ln -sf %s/%s %s", bkpinfo->tmpdir, 1266 1266 FILELIST_FULL_STUB, g_filelist_full); 1267 log_msg(1, "command = %s", command);1267 mr_msg(1, "command = %s", command); 1268 1268 paranoid_system(command); 1269 1269 } … … 1282 1282 1283 1283 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); 1285 1285 } 1286 1286 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); 1288 1288 } 1289 1289 // popup_and_OK("Wonderful."); 1290 1290 1291 log_msg(2, "Forking");1291 mr_msg(2, "Forking"); 1292 1292 pid = fork(); 1293 1293 switch (pid) { … … 1317 1317 close_evalcall_form(); 1318 1318 1319 log_msg(3, "loading filelist");1319 mr_msg(3, "loading filelist"); 1320 1320 filelist = load_filelist(g_filelist_full); 1321 log_msg(3, "deleting original filelist");1321 mr_msg(3, "deleting original filelist"); 1322 1322 unlink(g_filelist_full); 1323 1323 if (g_text_mode) { … … 1334 1334 } 1335 1335 if (res) { 1336 log_msg(2, "User hit 'cancel'. Freeing filelist and aborting.");1336 mr_msg(2, "User hit 'cancel'. Freeing filelist and aborting."); 1337 1337 free_filelist(filelist); 1338 1338 return (NULL); … … 1418 1418 read_cfg_var(g_mondo_cfg_file, "bootloader.name", name); 1419 1419 sprintf(tmp, "run_boot_loader: device='%s', name='%s'", device, name); 1420 log_msg(2, tmp);1420 mr_msg(2, tmp); 1421 1421 system("sync"); 1422 1422 if (!strcmp(name, "LILO")) { … … 1432 1432 // else 1433 1433 // { 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."); 1435 1435 // res = 1; 1436 1436 // } … … 1448 1448 res = run_program_and_log_output(tmp, 3); 1449 1449 } else { 1450 log_msg(1,1450 mr_msg(1, 1451 1451 "I'm not running any boot loader. You have a DD boot drive. It's already loaded up."); 1452 1452 } … … 1497 1497 } 1498 1498 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); 1500 1500 } 1501 1501 return (output); … … 1535 1535 1536 1536 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..."); 1538 1538 sprintf(command, "grub-MR %s /tmp/mountlist.txt", boot_device); 1539 log_msg(1, "command = %s", command);1539 mr_msg(1, "command = %s", command); 1540 1540 } else { 1541 1541 sprintf(command, "chroot " MNT_RESTORING " grub-install %s", 1542 1542 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"); 1544 1544 } 1545 1545 if (offer_to_run_stabgrub … … 1599 1599 log_to_screen 1600 1600 ("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, 1609 1609 "If you're really stuck, please e-mail the mailing list."); 1610 1610 } else { … … 1832 1832 strcpy(boot_device, bd); 1833 1833 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); 1835 1835 1836 1836 if (offer_to_hack_scripts … … 2066 2066 void termination_in_progress(int sig) 2067 2067 { 2068 log_msg(1, "Termination in progress");2068 mr_msg(1, "Termination in progress"); 2069 2069 usleep(1000); 2070 2070 pthread_exit(0); … … 2113 2113 i++) { 2114 2114 sleep(1); 2115 log_msg(2, "Waiting for buffer() to finish");2115 mr_msg(2, "Waiting for buffer() to finish"); 2116 2116 } 2117 2117 … … 2120 2120 if (run_program_and_log_output 2121 2121 ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/tmp/", FALSE)) { 2122 log_msg(1,2122 mr_msg(1, 2123 2123 "Error. Failed to copy log to PC's /tmp dir. (Mounted read-only?)"); 2124 2124 } 2125 2125 if (run_program_and_log_output 2126 2126 ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/root/", FALSE)) { 2127 log_msg(1,2127 mr_msg(1, 2128 2128 "Error. Failed to copy log to PC's /root dir. (Mounted read-only?)"); 2129 2129 } … … 2145 2145 if (!strcmp(mountlist->el[lino].mountpoint, "/1")) { 2146 2146 sprintf(command, "umount %s/", MNT_RESTORING); 2147 log_msg(3,2147 mr_msg(3, 2148 2148 "Well, I know a certain kitty-kitty who'll be sleeping with Mommy tonight..."); 2149 2149 } else { … … 2152 2152 } 2153 2153 } 2154 log_msg(10, "The 'umount' command is '%s'", command);2154 mr_msg(10, "The 'umount' command is '%s'", command); 2155 2155 res = run_program_and_log_output(command, 3); 2156 2156 } else { … … 2164 2164 log_to_screen(tmp); 2165 2165 } else { 2166 log_msg(2, tmp);2166 mr_msg(2, tmp); 2167 2167 } 2168 2168 } … … 2213 2213 MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, 2214 2214 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); 2216 2216 res = run_program_and_log_output(command, -1); 2217 2217 if (res != 0 && does_file_exist(MONDO_CFG_FILE_STUB)) { … … 2258 2258 malloc_string(command); 2259 2259 malloc_string(tmp); 2260 log_msg(2, "gcffa --- starting");2260 mr_msg(2, "gcffa --- starting"); 2261 2261 log_to_screen("I'm thinking..."); 2262 2262 sprintf(mountpt, "%s/mount.bootdisk", bkpinfo->tmpdir); … … 2278 2278 // make_hole_for_file( cfg_file ); 2279 2279 // 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); 2281 2281 2282 2282 /* Floppy? */ … … 2290 2290 "(sleep 15; kill `ps | grep \"%s\" | cut -d' ' -f1` 2> /dev/null) &", 2291 2291 command); 2292 log_msg(1, "tmp = '%s'", tmp);2292 mr_msg(1, "tmp = '%s'", tmp); 2293 2293 system(tmp); 2294 2294 res = run_program_and_log_output(command, FALSE); … … 2301 2301 } else { 2302 2302 try_plan_B = TRUE; 2303 log_msg(2,2303 mr_msg(2, 2304 2304 "Mounted floppy OK but I don't trust it because the archives might contain more up-to-date config file than the floppy does."); 2305 2305 // 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?)"); 2307 2307 sprintf(ramdisk_fname, "%s/mindi.rdz", mountpt); 2308 2308 if (!does_file_exist(ramdisk_fname)) { … … 2310 2310 } 2311 2311 if (!does_file_exist(ramdisk_fname)) { 2312 log_msg(2,2312 mr_msg(2, 2313 2313 "Cannot find ramdisk file on mountpoint. Are you sure that's a boot disk in the drive?"); 2314 2314 } 2315 2315 if (extract_config_file_from_ramdisk 2316 2316 (bkpinfo, ramdisk_fname, cfg_file, mountlist_file)) { 2317 log_msg(2,2317 mr_msg(2, 2318 2318 "Warning - failed to extract config file from ramdisk. I think this boot disk is mangled."); 2319 2319 } … … 2323 2323 } 2324 2324 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."); 2326 2326 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2327 2327 try_plan_B = TRUE; 2328 2328 } else { 2329 log_msg(2, "gcffa --- calling mount_cdrom now :)");2329 mr_msg(2, "gcffa --- calling mount_cdrom now :)"); 2330 2330 if (!mount_cdrom(bkpinfo)) { 2331 log_msg(2,2331 mr_msg(2, 2332 2332 "gcffa --- managed to mount CD; so, no need for Plan B"); 2333 2333 try_plan_B = FALSE; … … 2341 2341 } 2342 2342 if (try_plan_B) { 2343 log_msg(2, "gcffa --- OK, switching to Plan B");2343 mr_msg(2, "gcffa --- OK, switching to Plan B"); 2344 2344 chdir(bkpinfo->tmpdir); 2345 2345 run_program_and_log_output("mkdir -p tmp", FALSE); … … 2347 2347 if (strlen(bkpinfo->media_device) == 0) { 2348 2348 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"); 2350 2350 } 2351 2351 strcpy(tmp, bkpinfo->media_device); … … 2361 2361 if (extract_cfg_file_and_mountlist_from_tape_dev 2362 2362 (bkpinfo->media_device)) { 2363 log_msg(3,2363 mr_msg(3, 2364 2364 "I tried lots of devices but none worked."); 2365 2365 strcpy(bkpinfo->media_device, tmp); … … 2374 2374 } 2375 2375 } else { 2376 log_msg(2,2376 mr_msg(2, 2377 2377 "gcffa --- looking at mounted CD for mindi-boot.2880.img"); 2378 2378 sprintf(command, … … 2381 2381 sprintf(mounted_cfgf_path, "%s/%s", mountpt, cfg_file); 2382 2382 if (!does_file_exist(mounted_cfgf_path)) { 2383 log_msg(2,2383 mr_msg(2, 2384 2384 "gcffa --- Plan C, a.k.a. untarring some file from all.tar.gz"); 2385 2385 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 … … 2393 2393 } 2394 2394 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"); 2396 2396 sprintf(tmp, "%s/%s", 2397 2397 call_program_and_get_last_line_of_output("pwd"), … … 2401 2401 if (strcmp(tmp, cfg_file) 2402 2402 && run_program_and_log_output(command, 1)) { 2403 log_msg(1,2403 mr_msg(1, 2404 2404 "... but an error occurred when I tried to move it to %s", 2405 2405 cfg_file); 2406 2406 } 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); 2408 2408 } 2409 2409 sprintf(command, "cp -f %s/%s %s", … … 2413 2413 if (strcmp(tmp, cfg_file) 2414 2414 && run_program_and_log_output(command, 1)) { 2415 log_msg(1, "Failed to get mountlist");2415 mr_msg(1, "Failed to get mountlist"); 2416 2416 } else { 2417 log_msg(1, "Got mountlist too");2417 mr_msg(1, "Got mountlist too"); 2418 2418 sprintf(command, "cp -f %s %s", mountlist_file, 2419 2419 g_mountlist_fname); 2420 2420 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"); 2422 2422 } else { 2423 log_msg(1, "Copied mountlist to /tmp as well OK");2423 mr_msg(1, "Copied mountlist to /tmp as well OK"); 2424 2424 sprintf(command, "cp -f tmp/i-want-my-lvm /tmp/"); 2425 2425 run_program_and_log_output(command, 1); … … 2427 2427 if (!run_program_and_log_output(command, 5) && !does_file_exist("/tmp/i-want-my-lvm")) 2428 2428 { 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."); 2430 2430 } 2431 2431 else if (run_program_and_log_output(command,5) && does_file_exist("/tmp/i-want-my-lvm")) 2432 2432 { 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."); 2434 2434 do_my_funky_lvm_stuff(TRUE, FALSE); // ...after I stop any LVMs :) 2435 2435 stop_raid_device("/dev/md0"); … … 2440 2440 else if (!run_program_and_log_output(command,5) && does_file_exist("/tmp/i-want-my-lvm")) 2441 2441 { 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."); 2443 2443 } 2444 2444 */ … … 2449 2449 if (!does_file_exist(cfg_file)) { 2450 2450 iamhere(cfg_file); 2451 log_msg(1, "%s not found", cfg_file);2451 mr_msg(1, "%s not found", cfg_file); 2452 2452 log_to_screen 2453 2453 ("Oh dear. Unable to recover configuration file from boot disk"); … … 2529 2529 if (parse_mdstat(raidlist, "/dev/")) { 2530 2530 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); 2532 2532 return; 2533 2533 } … … 2539 2539 continue; 2540 2540 } 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); 2542 2542 sprintf(screen_message, "Sync'ing %s", 2543 2543 raidlist->el[i].raid_device); 2544 2544 open_evalcall_form(screen_message); 2545 2545 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); 2547 2547 update_evalcall_form(raidlist->el[i].progress); 2548 2548 sleep(2);
Note:
See TracChangeset
for help on using the changeset viewer.