Changeset 3147 in MondoRescue for branches/3.1/mondo/src/common/libmondo-devices.c
- Timestamp:
- Jun 19, 2013, 8:34:46 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mondo/src/common/libmondo-devices.c
r2937 r3147 331 331 char *searchstr = NULL; 332 332 char *tmp = NULL; 333 char *p; 333 334 334 335 /*@ ints ******************************************************* */ … … 816 817 } 817 818 818 mr_asprintf(command, "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2", cdr_exe, g_cdrw_drive_is_here);819 mr_asprintf(command, "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep -E \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2", cdr_exe, g_cdrw_drive_is_here); 819 820 mr_free(cdr_exe); 820 821 … … 848 849 } 849 850 850 tmp = call_program_and_get_last_line_of_output("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\"| grep -E '[D|C][V|D]' | cut -d':' -f1",TRUE);851 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",TRUE); 851 852 log_msg(5, "tmp = '%s'", tmp); 852 853 if (!tmp[0]) 853 854 mr_free(tmp); 854 tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep \ ") '\" | grep -n \"\"| grep -E '[D|C][V|D]' | cut -d':' -f1",TRUE);855 tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep \)\ \' | grep -n '' | grep -E '[D|C][V|D]' | cut -d':' -f1",TRUE); 855 856 if (tmp[0]) { 856 857 devno = atoi(tmp) - 1; … … 886 887 #if linux 887 888 unsigned long long s = 0; 888 int fileid, cylinders = 0 , cylindersleft = 0;889 int fileid, cylinders = 0; 889 890 int cylindersize = 0; 890 891 int gotgeo = 0; … … 935 936 if (ioctl(fileid, HDIO_GETGEO, &hdgeo) != -1) { 936 937 if (hdgeo.cylinders && hdgeo.heads && hdgeo.sectors) { 937 cylindersleft = cylinders = hdgeo.cylinders;938 938 cylindersize = hdgeo.heads * hdgeo.sectors / 2; 939 939 outvalA = cylindersize * cylinders / 1024; … … 983 983 char *command = NULL; 984 984 char *format_sz = NULL; 985 char *p; 985 986 986 987 FILE *pin; … … 1822 1823 1823 1824 /* Check for LVM */ 1824 mr_asprintf(command, "pvdisplay -c %s | grep '%s:' 2> /dev/null", partitions[i], partitions[i]);1825 mr_asprintf(command, "pvdisplay -c %s 2> /dev/null", partitions[i]); 1825 1826 log_msg(5, " Running: %s", command); 1826 1827 tmp = call_program_and_get_last_line_of_output(command,TRUE); … … 2638 2639 char *p = NULL; 2639 2640 char *q = NULL; 2641 char *tmpro = NULL; 2642 char *tmp1 = NULL; 2640 2643 char *mds = NULL; 2641 2644 char *sz_size = NULL; … … 2873 2876 bkpinfo->media_size[i] = bkpinfo->media_size[0]; 2874 2877 } 2878 bkpinfo->use_obdr = ask_me_yes_or_no 2879 ("Do you want to activate OBDR support for your tapes ?"); 2880 if (bkpinfo->use_obdr) { 2881 log_msg(4, "obdr mode = TRUE"); 2882 } else { 2883 log_msg(4, "obdr mode = FALSE"); 2884 } 2875 2885 if (archiving_to_media) { 2876 2886 if ((compression_type = which_compression_type()) == NULL) { … … 2968 2978 if (bkpinfo->disaster_recovery) { 2969 2979 mr_asprintf(command ,"umount %s/isodir 2> /dev/null", bkpinfo->tmpdir); 2970 (void)system(command);2980 paranoid_system(command); 2971 2981 mr_free(command); 2972 2982 2973 2983 } 2974 p = popup_and_get_string("Network protocol", "Which Network protocol should I use?", bkpinfo->netfs_proto); 2984 <<<<<<< .courant 2985 p = popup_and_get_string("Network protocol", "Which Network protocol should I use (nfs/sshfs/smbfs) ?", bkpinfo->netfs_proto); 2975 2986 if (p == NULL) { 2976 2987 log_to_screen("User has chosen not to backup the PC"); … … 3016 3027 3017 3028 if (bkpinfo->restore_data) { 3029 /* mount th FS read-only in restore mode to avoid any erase of whatever */ 3030 mr_asprintf(tmpro, "-o ro"); 3031 } else { 3032 mr_asprintf(tmpro, ""); 3033 } 3034 3035 /* Build the mount string */ 3036 if (strstr(bkpinfo->netfs_proto, "smbfs")) { 3037 mr_asprintf(tmp, "mount -t cifs %s %s %s",bkpinfo->netfs_mount, bkpinfo->isodir,tmpro); 3038 if (bkpinfo->netfs_user) { 3039 mr_strcat(tmp, " -o user=%s", bkpinfo->netfs_user); 3040 } 3041 else { 3018 3042 if (strstr(bkpinfo->netfs_proto, "sshfs")) { 3019 mr_asprintf(tmp, "sshfs -o ro");3043 mr_asprintf(tmp, "sshfs %s ",tmpro); 3020 3044 } else { 3021 mr_asprintf(tmp, "mount -t %s -o nolock ,ro", bkpinfo->netfs_proto);3045 mr_asprintf(tmp, "mount -t %s -o nolock %s ", bkpinfo->netfs_proto,tmpro); 3022 3046 } 3023 } else { 3024 if (strstr(bkpinfo->netfs_proto, "sshfs")) { 3025 mr_asprintf(tmp, "sshfs"); 3026 } else { 3027 mr_asprintf(tmp, "mount -t %s -o nolock", bkpinfo->netfs_proto); 3047 if (bkpinfo->netfs_user) { 3048 mr_strcat(tmp, "%s@", bkpinfo->netfs_user); 3028 3049 } 3029 } 3030 if (bkpinfo->netfs_user) { 3031 mr_strcat(tmp, "%s@", bkpinfo->netfs_user); 3032 } 3033 mr_strcat(tmp, "%s %s", bkpinfo->netfs_mount, bkpinfo->isodir); 3050 mr_strcat(tmp, "%s %s", bkpinfo->netfs_mount, bkpinfo->isodir); 3051 } 3034 3052 run_program_and_log_output(tmp, 3); 3035 3053 mr_free(tmp); … … 3037 3055 malloc_string(g_selfmounted_isodir); 3038 3056 strcpy(g_selfmounted_isodir, bkpinfo->isodir); 3057 } 3039 3058 } 3040 3059 if (!is_this_device_mounted(bkpinfo->netfs_mount)) { … … 3193 3212 } 3194 3213 3195 3196 3214 p = popup_and_get_string("Exclude paths", "Please enter paths which you do NOT want to backup. Separate them with '|'. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.", bkpinfo->exclude_paths); 3197 3215 if (p == NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.