Changeset 3844 in MondoRescue for branches/3.3/mondo
- Timestamp:
- Mar 6, 2024, 2:09:16 AM (4 months ago)
- Location:
- branches/3.3/mondo/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/common/libmondo-cli.c
r3843 r3844 354 354 } 355 355 if (!flag_set['d']) { 356 if (!find_dvd_device(flag_val['d'] )) {356 if (!find_dvd_device(flag_val['d'], FALSE)) { 357 357 flag_set['d'] = TRUE; 358 358 log_to_screen("I guess DVD drive is at %s", flag_val['d']); -
branches/3.3/mondo/src/common/libmondo-devices-EXT.h
r3843 r3844 10 10 char *mountpoint); 11 11 extern int find_cdrom_device(char *output, bool try_to_mount); 12 extern int find_dvd_device(char *output );12 extern int find_dvd_device(char *output, bool try_to_mount); 13 13 extern long get_phys_size_of_drive(char *drive); 14 14 extern bool is_this_a_valid_disk_format(char *format); -
branches/3.3/mondo/src/common/libmondo-devices.c
r3843 r3844 479 479 strcpy(dev, g_dvd_drive_is_here); 480 480 if (!dev[0]) { 481 find_dvd_device(dev );481 find_dvd_device(dev, FALSE); 482 482 } 483 483 } else { 484 484 strcpy(dev, g_cdrom_drive_is_here); 485 485 if (!dev[0]) { 486 find_cdrom_device(dev );486 find_cdrom_device(dev, FALSE); 487 487 } 488 488 } … … 870 870 871 871 872 int find_dvd_device(char *output )872 int find_dvd_device(char *output, bool try_to_mount) 873 873 { 874 874 char *tmp = NULL; 875 char *tmp1 = NULL;876 875 int retval = 0, devno = -1; 877 876 … … 882 881 } 883 882 884 mr_asprintf(tmp1, "cdrecord -inq dev=%s 2> /dev/null | grep -E 'Device seems to be' | cut -d':' -f2", output); 885 tmp = call_program_and_get_last_line_of_output(tmp1); 886 mr_free(tmp1); 887 log_msg(5, "cdrecord tmp = '%s'", tmp); 883 tmp = call_program_and_get_last_line_of_output("dvdrecord -scanbus 2> /dev/null | grep -E '\)\ \'' | grep -n '' | grep -E '[D|C][V|D]' | cut -d':' -f1"); 884 log_msg(5, "tmp = '%s'", tmp); 885 if (!tmp[0]) { 886 mr_free(tmp); 887 tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep -E '\)\ \'' | grep -n '' | grep -E '[D|C][V|D]' | cut -d':' -f1"); 888 } 889 if (tmp[0]) { 890 devno = atoi(tmp) - 1; 891 } 888 892 mr_free(tmp); 889 893 890 if (tmp != NULL) { 894 if (devno >= 0) { 895 retval = 0; 896 sprintf(output, "/dev/scd%d", devno); 891 897 strcpy(g_dvd_drive_is_here, output); 892 898 log_msg(2, "I think DVD is at %s", output); … … 895 901 retval = 1; 896 902 } 897 return(retval); 903 904 return (retval); 898 905 } 899 906 … … 2252 2259 mr_asprintf(comment, "What speed is your %s (re)writer?", mds); 2253 2260 if (bkpinfo->backup_media_type == dvd) { 2254 find_dvd_device(bkpinfo->media_device );2261 find_dvd_device(bkpinfo->media_device, FALSE); 2255 2262 strcpy(tmp1, "1"); 2256 2263 mr_asprintf(sz_size, "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4482 MB -
branches/3.3/mondo/src/common/libmondo-devices.h
r3843 r3844 9 9 int find_and_mount_actual_cd(char *mountpoint); 10 10 int find_cdrom_device(char *output, bool try_to_mount); 11 int find_dvd_device(char *output );11 int find_dvd_device(char *output, bool try_to_mount); 12 12 long get_phys_size_of_drive(char *drive); 13 13 bool is_this_a_valid_disk_format(char *format); -
branches/3.3/mondo/src/mondoarchive/mondoarchive.c
r3843 r3844 301 301 setup_newt_stuff(); 302 302 malloc_string(tmp); 303 if (find_dvd_device(tmp )) {303 if (find_dvd_device(tmp, atoi(argv[2]))) { 304 304 printf("Failed to find DVD drive\n"); 305 305 } else {
Note:
See TracChangeset
for help on using the changeset viewer.