Changeset 3872 in MondoRescue
- Timestamp:
- Mar 7, 2024, 7:00:38 PM (12 months ago)
- Location:
- branches/3.3/mondo/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/common/libmondo-devices-EXT.h
r3853 r3872 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 char *find_dvd_device(void); 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
r3870 r3872 22 22 #include "libmondo-fork-EXT.h" 23 23 #include "libmondo-stream-EXT.h" 24 #include " libmondo-newt-specific-EXT.h"24 #include "newt-specific-EXT.h" 25 25 26 26 #ifdef __FreeBSD__ … … 867 867 * and return it's device file to the caller that needs to free it 868 868 */ 869 char *find_dvd_device( )870 { 871 char * tmp= NULL;869 char *find_dvd_device(void) 870 { 871 char *dev = NULL; 872 872 char *tmp1 = NULL; 873 int retval = 0, devno = -1; 873 char *command = NULL; 874 875 log_to_screen("I am looking for your optical burner. Please wait."); 874 876 875 877 if (bkpinfo->media_device != NULL) { … … 879 881 880 882 mr_asprintf(tmp1, "cdrecord -inq 2> /dev/null | grep -E '^Detected ' | cut -d':' -f2"); 881 tmp= call_program_and_get_last_line_of_output(tmp1);883 dev = call_program_and_get_last_line_of_output(tmp1); 882 884 mr_free(tmp1); 883 log_msg(5, "find_dvd_device found device '%s'", tmp); 884 885 if (tmp != NULL) { 886 log_msg(2, "I think DVD is at %s", bkpinfo->media_device); 885 886 if ((dev != NULL) && does_file_exist(dev)) { 887 log_msg(2, "find_dvd_device found %s automatically", dev); 887 888 } else { 888 log_msg(2, "I cannot find DVD"); 889 } 890 bkpinfo->media_device = tmp; 891 return(bkpinfo->media_device); 889 mr_free(dev); 890 tmp1 = find_home_of_exe("lsscsi"); 891 if (tmp1 != NULL) { 892 mr_asprintf(command, "%s | grep ' cd' | awk '{print $NF}' | head -1", tmp1); 893 dev = call_program_and_get_last_line_of_output(command); 894 mr_free(command); 895 } 896 mr_free(tmp1); 897 898 if ((dev == NULL) || !does_file_exist(dev)) { 899 /* trying something else then */ 900 mr_asprintf(dev, "%s", VANILLA_SCSI_CDROM); 901 if (!does_file_exist(dev)) { 902 mr_asprintf(dev, "%s", ALT_CDROM); 903 if (!does_file_exist(dev)) { 904 log_it("Unable to find a tape device on this system"); 905 } 906 } 907 } 908 if (dev != NULL) { 909 log_it("find_dvd_device found %s manually", dev); 910 } 911 } 912 913 if ((dev != NULL) && does_file_exist(dev)) { 914 log_it("find_dvd_device returns %s", dev); 915 } else { 916 mr_free(dev); 917 log_it("find_dvd_device found no optical burner on your system returning NULL"); 918 } 919 return(dev); 892 920 } 893 921 … … 2246 2274 mr_asprintf(comment, "What speed is your %s (re)writer?", mds); 2247 2275 if (bkpinfo->backup_media_type == dvd) { 2248 find_dvd_device(bkpinfo->media_device); 2276 bkpinfo->media_device = find_dvd_device(); 2277 if (bkpinfo->media_device == NULL) { 2278 log_msg(1, "No backup device found for your DVD"); 2279 } 2249 2280 strcpy(tmp1, "1"); 2250 2281 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-stream.c
r3870 r3872 310 310 log_to_screen("I am looking for your tape streamer. Please wait."); 311 311 312 if (bkpinfo->media_device != NULL) { 313 log_msg(3, "Been there, done that. Returning %s", bkpinfo->media_device); 314 return (bkpinfo->media_device); 315 } 316 312 317 tmp = find_home_of_exe("lsscsi"); 313 318 if (tmp != NULL) { … … 318 323 mr_free(tmp); 319 324 320 if ( dev != NULL) && does_file_exist(dev) {325 if ((dev != NULL) && does_file_exist(dev)) { 321 326 if (mt_says_tape_exists(dev)) { 322 327 log_it("find_tape_device found %s automatically", dev); … … 334 339 } 335 340 } 336 log_it("find_tape_device found %s manually", dev); 337 } 338 339 if (dev != NULL) { 341 if (dev != NULL) { 342 log_it("find_tape_device found %s manually", dev); 343 } 344 } 345 346 if ((dev != NULL) && does_file_exist(dev)) { 340 347 log_it("find_tape_device returns %s", dev); 341 348 } else { 349 mr_free(dev); 342 350 log_it("find_tape_device found no tape on your system returning NULL"); 343 351 } -
branches/3.3/mondo/src/include/my-stuff.h
r3866 r3872 315 315 #define CP_BIN "gcp" 316 316 #else 317 #define VANILLA_SCSI_CDROM "/dev/scd0" 317 #define VANILLA_SCSI_CDROM "/dev/sr0" 318 #define ALT_CDROM "/dev/scd0" 318 319 #define VANILLA_SCSI_TAPE "/dev/st0" 319 320 #define VANILLA_USB_DEVICE "/dev/hda" -
branches/3.3/mondo/src/mondoarchive/mondoarchive.c
r3853 r3872 300 300 g_loglevel = 10; 301 301 setup_newt_stuff(); 302 malloc_string(tmp); 303 if (find_dvd_device(tmp)) { 302 if (tmp = find_dvd_device()) { 304 303 printf("Failed to find DVD drive\n"); 305 304 } else {
Note:
See TracChangeset
for help on using the changeset viewer.