Changeset 1709 in MondoRescue for branches/2.2.5/mondo/src
- Timestamp:
- Oct 27, 2007, 5:07:52 PM (17 years ago)
- Location:
- branches/2.2.5/mondo/src/common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.5/mondo/src/common/libmondo-archive.c
r1708 r1709 1895 1895 log_msg(1, message_to_screen); 1896 1896 1897 if (is_this_device_mounted(bkpinfo->media_device)) { 1897 asprintf(&tmp1, "umount %s1", bkpinfo->media_device); 1898 if (is_this_device_mounted(tmp1)) { 1898 1899 log_msg(1, "USB device mounted. Remounting it at the right place"); 1899 asprintf(&tmp, "umount %s 1", bkpinfo->media_device);1900 asprintf(&tmp, "umount %s", tmp1); 1900 1901 run_program_and_log_output(tmp, FALSE); 1901 1902 paranoid_free(tmp); 1902 1903 } 1904 1paranoid_free(tmp); 1905 1903 1906 log_msg(1, "Mounting USB device."); 1904 1907 asprintf(&tmp1, "%s/usb", bkpinfo->tmpdir); … … 3965 3968 media_descriptor_string(g_backup_media_type)); 3966 3969 chdir("/"); 3967 iamhere("Before calling verify_cd_image()"); 3968 res += verify_cd_image(); 3969 iamhere("After calling verify_cd_image()"); 3970 iamhere("Before calling verification of image()"); 3971 if (bkpinfo->backup_media_type == usb) { 3972 res += verify_usb_image(); 3973 } else { 3974 res += verify_cd_image(); 3975 } 3976 iamhere("After calling verification of image()"); 3970 3977 } 3971 3978 if (!res) { 3972 3979 that_one_was_ok = TRUE; 3973 3980 } else { 3974 sprintf(tmp, "Failed to burn%s #%d. Retry?",3981 sprintf(tmp, "Failed to create %s #%d. Retry?", 3975 3982 media_descriptor_string(bkpinfo->backup_media_type), 3976 3983 g_current_media_number); … … 3998 4005 g_current_media_number++; 3999 4006 if (g_current_media_number > MAX_NOOF_MEDIA) { 4000 fatal_error("Too many CD-R(W)'s. Use tape or net.");4007 fatal_error("Too many media. Use tape or net."); 4001 4008 } 4002 4009 wipe_archives(bkpinfo->scratchdir); … … 4010 4017 4011 4018 if (last_cd) { 4012 log_msg(2, "This was your last CD.");4019 log_msg(2, "This was your last media."); 4013 4020 } else { 4014 4021 log_msg(2, "Continuing to backup your data..."); -
branches/2.2.5/mondo/src/common/libmondo-devices.c
r1708 r1709 721 721 722 722 723 724 /**725 * Locate a CD-R/W writer's SCSI node.726 * @param cdrw_device SCSI node will be placed here.727 * @return 0 for success, nonzero for failure.728 */729 723 730 724 … … 1967 1961 MAX_STR_LEN / 4); 1968 1962 } else { 1969 i = popup_and_get_string("/dev entry?", 1963 if (bkpinfo->backup_media_type == usb) { 1964 i = popup_and_get_string("/dev entry?", 1965 "What is the /dev entry of your USB Disk/Key, please?", 1966 bkpinfo->media_device, 1967 MAX_STR_LEN / 4); 1968 } else { 1969 i = popup_and_get_string("/dev entry?", 1970 1970 "What is the /dev entry of your CD (re)writer, please?", 1971 1971 bkpinfo->media_device, 1972 1972 MAX_STR_LEN / 4); 1973 } 1973 1974 } 1974 1975 if (!i) { -
branches/2.2.5/mondo/src/common/libmondo-verify.c
r1648 r1709 1038 1038 1039 1039 /** 1040 * Verify the USB device 1041 * @param bkpinfo The backup information structure. Fields used: 1042 * - @c bkpinfo->isodir 1043 * - @c bkpinfo->media_device 1044 * - @c bkpinfo->tmpdir 1045 * - @c bkpinfo->verify_data 1046 * 1047 * @return 0 for success (even if differences are found), nonzero for failure. 1048 * @ingroup verifyGroup 1049 */ 1050 int verify_usb_image() 1051 { 1052 1053 /*@ int ************************************************************ */ 1054 int retval = 0; 1055 1056 /*@ buffers ******************************************************** */ 1057 char *mountpoint = NULL; 1058 char *tmp = NULL; 1059 char *tmp1 = NULL; 1060 char *fname = NULL; 1061 #ifdef __FreeBSD__ 1062 char mdd[32]; 1063 char *mddevice = mdd; 1064 int ret = 0; 1065 int vndev = 2; 1066 #else 1067 //skip 1068 #endif 1069 1070 assert(bkpinfo != NULL); 1071 1072 asprintf(&fname, "%s1", bkpinfo->media_device); 1073 if (is_this_device_mounted(fname)) { 1074 log_msg(1, "USB device mounted. Remounting it at the right place"); 1075 asprintf(&tmp, "umount %s", fname); 1076 run_program_and_log_output(tmp, FALSE); 1077 paranoid_free(tmp); 1078 } 1079 paranoid_free(fname); 1080 1081 log_msg(1, "Mounting USB device."); 1082 asprintf(&mountpoint, "%s/usb", bkpinfo->tmpdir); 1083 asprintf(&tmp, "mkdir -p %s", mountpoint); 1084 run_program_and_log_output(tmp, FALSE); 1085 paranoid_free(tmp); 1086 /* Mindi always create one single parition on the USB dev */ 1087 asprintf(&tmp, "mount %s1 %s", bkpinfo->media_device, mountpoint); 1088 ret = run_program_and_log_output(tmp, FALSE); 1089 paranoid_free(tmp); 1090 if (ret) { 1091 paranoid_free(mountpoint); 1092 return(ret); 1093 } 1094 1095 sync(); 1096 log_msg(2, "OK, I've mounted the USB Disk/Key\n"); 1097 asprintf(&tmp, "%s/archives/NOT-THE-LAST", mountpoint); 1098 if (!does_file_exist(tmp)) { 1099 log_msg 1100 (2, 1101 "This is the last USB device. I am therefore setting bkpinfo->verify_data to FALSE."); 1102 bkpinfo->verify_data = FALSE; 1103 /* 1104 (a) It's an easy way to tell the calling subroutine that we've finished & 1105 there are no more device to be verified; (b) It stops the post-backup verifier 1106 from running after the per-device verifier has run too. 1107 */ 1108 } 1109 paranoid_free(tmp); 1110 verify_afioballs_on_CD(mountpoint); 1111 iamhere("before verify_all_slices"); 1112 verify_all_slices_on_CD(mountpoint); 1113 1114 asprintf(&tmp1, "umount %s", mountpoint); 1115 #ifdef __FreeBSD__ 1116 ret = 0; 1117 ret += system(tmp1); 1118 ret += kick_vn(mddevice); 1119 if (ret) 1120 #else 1121 if (system(tmp1)) 1122 #endif 1123 { 1124 asprintf(&tmp, "%s failed; unable to unmount USB device\n", tmp1); 1125 log_to_screen(tmp); 1126 paranoid_free(tmp); 1127 retval++; 1128 } else { 1129 log_msg(2, "OK, I've unmounted the USB device\n"); 1130 } 1131 paranoid_free(tmp1); 1132 paranoid_free(mountpoint); 1133 return (retval); 1134 } 1135 1136 1137 /** 1040 1138 * Verify the CD indicated by @c g_current_media_number. 1041 1139 * @param bkpinfo The backup information structure. Fields used:
Note:
See TracChangeset
for help on using the changeset viewer.