Changeset 3881 in MondoRescue for branches/3.3/mondo/src
- Timestamp:
- Mar 9, 2024, 3:31:21 PM (4 months ago)
- Location:
- branches/3.3/mondo/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/common/libmondo-archive.c
r3879 r3881 917 917 } 918 918 919 if (bkpinfo->backup_media_type == cdr) {919 if (bkpinfo->backup_media_type == optical) { 920 920 if (is_this_device_mounted(bkpinfo->media_device)) { 921 921 log_msg(2, "Warning - %s mounted. I'm unmounting it before I burn to it.", bkpinfo->media_device); … … 1089 1089 } 1090 1090 if (g_current_media_number == 1 && !res 1091 && (bkpinfo->backup_media_type == cdr)) {1092 if ((tmp = find_optical_device()) 1093 log_msg(3, "*Sigh* Mike, I hate your computer.");1091 && (bkpinfo->backup_media_type == optical)) { 1092 if ((tmp = find_optical_device()) == NULL) { // make sure find_optical_device() finds, records CD-R's loc 1093 log_msg(3, "*Sigh* no optical drive found, I hate your computer ;-)"); 1094 1094 // if it can't be found then force pausing 1095 1095 bkpinfo->manual_cd_tray = TRUE; 1096 1096 } else { 1097 log_msg(3, "Great. Found Mike's CD-ROMdrive.");1097 log_msg(3, "Great. Found an optical drive."); 1098 1098 } 1099 1099 mr_free(tmp); … … 2848 2848 2849 2849 switch (bkpinfo->backup_media_type) { 2850 case cdr:2851 mr_asprintf(value, " cdr");2850 case optical: 2851 mr_asprintf(value, "optical"); 2852 2852 break; 2853 2853 case cdstream: … … 2865 2865 case netfs: 2866 2866 mr_asprintf(value, "netfs"); 2867 break;2868 case dvd:2869 mr_asprintf(value, "dvd");2870 2867 break; 2871 2868 case usb: … … 3180 3177 if (bkpinfo->backup_media_type != iso) { 3181 3178 mr_free(bkpinfo->media_device); 3182 bkpinfo->media_device = find_optical_device(); // replace 0,0,0 with /dev/cdrom3179 bkpinfo->media_device = find_optical_device(); 3183 3180 } 3184 3181 if (chdir("/")) { -
branches/3.3/mondo/src/common/libmondo-cli.c
r3880 r3881 204 204 /* compulsory */ 205 205 i = flag_set['c'] + flag_set['i'] + flag_set['n'] + 206 flag_set['t'] + flag_set['u'] + flag_set['r'] + 207 flag_set['C'] + flag_set['U']; 206 flag_set['t'] + flag_set['u'] + flag_set['U']; 208 207 if ((i == 0) && (! bkpinfo->restore_data)) { 209 208 retval++; … … 325 324 } 326 325 327 if ( (flag_set['c'] || flag_set['C'] || flag_set['r'])&& (! bkpinfo->restore_data)) {326 if (flag_set['c'] && (! bkpinfo->restore_data)) { 328 327 if (system("which cdrecord > /dev/null 2> /dev/null") && system("which dvdrecord > /dev/null 2> /dev/null")) { 329 328 fatal_error("Please install dvdrecord/cdrecord and try again."); 330 }331 if (flag_set['C']) {332 bkpinfo->cdrw_speed = atoi(flag_val['C']);333 if (bkpinfo->cdrw_speed < 1) {334 fatal_error("You specified a silly speed for a CD-R[W] drive");335 }336 if (!flag_set['L']) {337 log_to_screen("You must use -L with -C. Therefore I am setting it for you.");338 flag_set['L'] = 1;339 flag_val['L'][0] = '\0';340 }341 329 } else { 342 330 log_msg(3, "flag_val['c'] = %s", flag_val['c']); 343 331 if (flag_set['c']) { 344 332 bkpinfo->cdrw_speed = atoi(flag_val['c']); 345 } else if (flag_set['r']) { 346 bkpinfo->cdrw_speed = 1; /*atoi(flag_val['r']); */ 347 } 348 349 if (bkpinfo->cdrw_speed < 1) { 350 fatal_error("You specified a silly speed for a CD-R[W] drive"); 333 } 334 } 335 if (!flag_set['d']) { 336 if ((bkpinfo->media_device = find_optical_device()) != NULL) { 337 flag_set['d'] = TRUE; 338 log_to_screen("I guess optical drive is at %s", bkpinfo->media_device); 339 } 340 } 341 342 if (! bkpinfo->restore_data) { 343 if (!flag_set['s']) { 344 sprintf(flag_val['s'], "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB 345 strcat(flag_val['s'], "m"); 346 log_to_screen("You did not specify a size (-s) for your media. I'm guessing %s.", flag_val['s']); 347 flag_set['s'] = 1; 351 348 } 352 349 } … … 369 366 if ((!flag_set['s']) && (! bkpinfo->restore_data)) { 370 367 fatal_error("You did not specify a size (-s) for your USB device. Aborting"); 371 }372 }373 374 if (flag_set['r']) // DVD375 {376 if (flag_set['m']) {377 fatal_error("Manual CD tray (-m) not yet supported in conjunction w/ DVD drives. Drop -m.");378 }379 if (!flag_set['d']) {380 if ((bkpinfo->media_device = find_optical_device()) != NULL) {381 flag_set['d'] = TRUE;382 log_to_screen("I guess DVD drive is at %s", bkpinfo->media_device);383 }384 }385 if (strchr(bkpinfo->media_device, ',')) {386 fatal_error("Please don't give a SCSI node. Give a _device_, preferably a /dev entry, for the parameter of the -d flag.");387 }388 if (! bkpinfo->restore_data) {389 if (!flag_set['s']) {390 sprintf(flag_val['s'], "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB391 strcat(flag_val['s'], "m");392 log_to_screen("You did not specify a size (-s) for DVD. I'm guessing %s.", flag_val['s']);393 flag_set['s'] = 1;394 }395 368 } 396 369 } … … 542 515 543 516 if (flag_set['c']) { 544 bkpinfo->backup_media_type = cdr;517 bkpinfo->backup_media_type = optical; 545 518 } 546 519 if (flag_set['C']) { … … 554 527 /* Never try to eject a Network device */ 555 528 bkpinfo->please_dont_eject = TRUE; 556 }557 if (flag_set['r']) {558 bkpinfo->backup_media_type = dvd;559 529 } 560 530 if (flag_set['t']) { -
branches/3.3/mondo/src/common/libmondo-devices.c
r3879 r3881 698 698 /** 699 699 * Turn @c bkpinfo->backup_media_type into a human-readable string. 700 * @return The human readable string (e.g. @c cdr becomes <tt>"cdr"</tt>).700 * @return The human readable string (e.g. @c optical becomes <tt>"optical"</tt>). 701 701 * @note The returned string points to static storage that will be overwritten with each call. 702 702 * @ingroup stringGroup … … 712 712 mr_asprintf(output, "%s", "iso"); 713 713 break; 714 case cdr:715 mr_asprintf(output, "%s", " cdr");714 case optical: 715 mr_asprintf(output, "%s", "optical"); 716 716 break; 717 717 case cdstream: … … 1229 1229 } else if (media_type == tape) { 1230 1230 return(find_tape_device()); 1231 } else if ( (media_type == dvd) || (media_type == cdr)) {1231 } else if (media_type == optical) { 1232 1232 return(find_optical_device()); 1233 1233 } else { … … 2017 2017 // Tape, CD, NETFS, ...? 2018 2018 srandom(getpid()); 2019 bkpinfo->backup_media_type = (g_restoring_live_from_cd) ? cdr: which_backup_media_type(bkpinfo->restore_data);2019 bkpinfo->backup_media_type = (g_restoring_live_from_cd) ? optical : which_backup_media_type(bkpinfo->restore_data); 2020 2020 if (bkpinfo->backup_media_type == none) { 2021 2021 log_to_screen("User has chosen not to backup the machine"); … … 2070 2070 // Find device's /dev (or SCSI) entry 2071 2071 switch (bkpinfo->backup_media_type) { 2072 case cdr: 2073 case dvd: 2072 case optical: 2074 2073 case usb: 2075 2074 /* Never try to eject a USB device */ … … 2081 2080 if (ask_me_yes_or_no("Is your computer a laptop type (manual insert of MondoRescue media)?")) { 2082 2081 bkpinfo->manual_cd_tray = TRUE; 2082 } 2083 if (ask_me_yes_or_no("Do you want to blank your media before burning them (RW type of media)?")) { 2084 bkpinfo->wipe_media_first = TRUE; 2083 2085 } 2084 2086 } -
branches/3.3/mondo/src/common/libmondo-string.c
r3878 r3881 976 976 977 977 switch (type_of_bkp) { 978 case dvd: 979 mr_asprintf(type_of_backup, "DVD"); 980 break; 981 case cdr: 982 mr_asprintf(type_of_backup, "CDR"); 978 case optical: 979 mr_asprintf(type_of_backup, "optical"); 983 980 break; 984 981 case tape: -
branches/3.3/mondo/src/common/libmondo-tools.c
r3880 r3881 484 484 485 485 // CD-R or CD-RW 486 if (bkpinfo->backup_media_type == cdr) {486 if (bkpinfo->backup_media_type == optical) { 487 487 if (!bkpinfo->manual_cd_tray) { 488 488 mr_asprintf(extra_cdrom_params, "-waiti "); -
branches/3.3/mondo/src/common/mondostructures.h
r3880 r3881 172 172 typedef enum { none = 0, ///< No type has been set yet. 173 173 iso, ///< Back up to ISO images. 174 cdr, ///< Back up to recordable CDs (do not erase them). 175 dvd, ///< Back up to DVD+R[W] or DVD-R[W] disks. 176 // To be removed 177 cdstream, ///< Back up to recordable CDs but treat them like a tape streamer. 174 optical, ///< Back up to optical media 178 175 netfs, ///< Back up to an NETFS mount on the local subnet. 179 176 tape, ///< Back up to tapes. … … 339 336 /** 340 337 * The device we're backing up to. 341 * If backup_media_type is @b cdr, or @b cdstream, this should be the SCSI node (e.g. 0,1,0). 342 * If backup_media_type is @b dvd, @b tape, @b usb or @b udev, this should be a /dev entry. 338 * If backup_media_type is @b optical, @b tape, @b usb or @b udev, this should be a /dev entry. 343 339 * If backup_media_type is anything else, this should be blank. 344 340 */ -
branches/3.3/mondo/src/common/newt-specific.c
r3874 r3881 1225 1225 /** 1226 1226 * Ask the user which backup media type they would like to use. 1227 * The choices are @p none (exit to shell), @c cdr, @c dvd,1227 * The choices are @p none (exit to shell), @c optical, 1228 1228 * @c tape, @c cdstream, @c udev (only when @p g_text_mode is TRUE), @c netfs, 1229 1229 * and @c iso. … … 1240 1240 char *title_sz = NULL; 1241 1241 char *minimsg_sz = NULL; 1242 static t_bkptype possible_bkptypes[] = { none, cdr, dvd, tape, cdstream, udev, netfs, iso };1243 static char *possible_responses[] = { "none", " cdr", "dvd", "tape", "cdstream", "udev", "netfs", "iso", NULL };1242 static t_bkptype possible_bkptypes[] = { none, optical, tape, cdstream, udev, netfs, iso }; 1243 static char *possible_responses[] = { "none", "optical", "tape", "cdstream", "udev", "netfs", "iso", NULL }; 1244 1244 char *outstr = NULL; 1245 1245 char *instr = NULL; … … 1248 1248 1249 1249 newtComponent b1; 1250 newtComponent b2;1251 1250 newtComponent b3; 1252 1251 newtComponent b4; 1253 newtComponent b5;1254 1252 newtComponent b6; 1255 1253 newtComponent b7; … … 1288 1286 newtPushHelpLine(title_sz); 1289 1287 newtCenteredWindow(34, 17, minimsg_sz); 1290 b1 = newtButton(1, 1, " CD-Rdisks ");1288 b1 = newtButton(1, 1, "Optical disks "); 1291 1289 b3 = newtButton(1, 9, "Tape drive "); 1292 1290 b4 = newtButton(17, 5, "USB Key/Disk"); 1293 b5 = newtButton(1, 5, " DVD disks ");1294 1291 b6 = newtButton(17, 9, " Net mount "); 1295 1292 b7 = newtButton(1, 13, " Hard disk "); 1296 1293 b8 = newtButton(17, 13, " Exit "); 1297 1294 myForm = newtForm(NULL, NULL, 0); 1298 newtFormAddComponents(myForm, b1, b 5, b3, b7, b4, b6, b8, NULL);1295 newtFormAddComponents(myForm, b1, b3, b7, b4, b6, b8, NULL); 1299 1296 b_res = newtRunForm(myForm); 1300 1297 newtFormDestroy(myForm); 1301 1298 newtPopWindow(); 1302 1299 if (b_res == b1) { 1303 output = cdr;1300 output = optical; 1304 1301 } else if (b_res == b3) { 1305 1302 output = tape; 1306 1303 } else if (b_res == b4) { 1307 1304 output = usb; 1308 } else if (b_res == b5) {1309 output = dvd;1310 1305 } else if (b_res == b6) { 1311 1306 output = netfs; -
branches/3.3/mondo/src/mondorestore/mondo-rstr-tools.c
r3879 r3881 942 942 if (!strcmp(value, "cdstream")) { 943 943 bkpinfo->backup_media_type = cdstream; 944 } else if (!strcmp(value, "cdr")) { 945 bkpinfo->backup_media_type = cdr; 946 } else if (!strcmp(value, "dvd")) { 947 bkpinfo->backup_media_type = dvd; 944 } else if (!strcmp(value, "optical")) { 945 bkpinfo->backup_media_type = optical; 948 946 } else if (!strcmp(value, "usb")) { 949 947 bkpinfo->backup_media_type = usb; … … 958 956 } 959 957 if (does_file_exist(ARCHIVES_PATH "/filelist.0")) { 960 bkpinfo->backup_media_type = cdr;958 bkpinfo->backup_media_type = optical; 961 959 run_program_and_log_output("umount -d "MNT_CDROM, 1); 962 log_it("Re-jigging configuration AGAIN. CD-R, not ISO.");960 log_it("Re-jigging configuration AGAIN. Optical, not ISO."); 963 961 } 964 962 } … … 1252 1250 mr_asprintf(tmp1, "mount %s %s", g_isodir_device, iso_mnt); 1253 1251 if (run_program_and_log_output(tmp1, 3)) { 1254 log_msg(1, "Unable to mount isodir. Perhaps this is really a CDbackup?");1255 bkpinfo->backup_media_type = cdr;1252 log_msg(1, "Unable to mount isodir. Perhaps this is really an optical based backup?"); 1253 bkpinfo->backup_media_type = optical; 1256 1254 mr_asprintf(bkpinfo->media_device, "%s", "/dev/cdrom"); /* superfluous */ 1257 1255 mr_free(bkpinfo->isodir);
Note:
See TracChangeset
for help on using the changeset viewer.