Changeset 2816 in MondoRescue for branches/2.2.10/mondo/src/common
- Timestamp:
- Apr 29, 2011, 3:42:55 PM (13 years ago)
- Location:
- branches/2.2.10/mondo/src/common
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-cli.c
r2715 r2816 45 45 46 46 /* Do we use extended attributes and acl ? 47 * By default no, use - -acl & --attr optionsto force their usage */47 * By default no, use -z option to force their usage */ 48 48 extern char *g_getfacl; 49 49 extern char *g_getfattr; -
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2715 r2816 37 37 /*@unused@*/ 38 38 //static char cvsid[] = "$Id$"; 39 // 40 41 extern char *which_compression_type(); 42 /* Do we use extended attributes and acl ? */ 43 extern char *g_getfacl; 44 extern char *g_getfattr; 39 45 40 46 extern int g_current_media_number; … … 1283 1289 { 1284 1290 char *mount_cmd = NULL; 1291 char *mountdir = NULL; 1285 1292 int i, res; 1286 1293 #ifdef __FreeBSD__ … … 1326 1333 1327 1334 } else if (bkpinfo->backup_media_type == iso) { 1335 if (bkpinfo->subdir) { 1336 mr_asprintf(mountdir, "%s/%s", bkpinfo->isodir, bkpinfo->subdir); 1337 } else { 1338 mr_asprintf(mountdir, "%s", bkpinfo->isodir); 1339 } 1328 1340 #ifdef __FreeBSD__ 1329 mr_sprintf(mount_cmd, "%s/%s-%d.iso", bkpinfo->isodir, 1330 bkpinfo->prefix, g_current_media_number); 1341 mr_asprintf(mount_cmd, "%s/%s-%d.iso", mountdir, bkpinfo->prefix, g_current_media_number); 1331 1342 mddev = make_vn(mount_cmd); 1332 1343 mr_free(mount_cmd); … … 1334 1345 mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM); 1335 1346 #else 1336 mr_asprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, MNT_CDROM); 1337 #endif 1347 mr_asprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", mountdir, bkpinfo->prefix, g_current_media_number, MNT_CDROM); 1348 #endif 1349 mr_free(mountdir); 1338 1350 } else if (bkpinfo->backup_media_type == usb) { 1339 1351 mr_asprintf(mount_cmd, "mount -t vfat %s %s", bkpinfo->media_device, MNT_CDROM); … … 1984 1996 char *tmp1 = NULL; 1985 1997 1998 if (pathlist == NULL) { 1999 return; 2000 } 1986 2001 while ((token = mr_strtok(pathlist, token_chars, &lastpos)) != NULL) { 1987 2002 switch (get_dsf_mount_list(token, &mounted_on_dsf, ¬_mounted_on_dsf)) { … … 2614 2629 char *command = NULL; 2615 2630 char *comment = NULL; 2631 char *compression_type = NULL; 2616 2632 int i; 2617 2633 FILE *fin; … … 2657 2673 } 2658 2674 } 2675 if ((compression_type = which_compression_type()) == NULL) { 2676 log_to_screen("User has chosen not to backup the PC"); 2677 finish(1); 2678 } 2679 2659 2680 if ((bkpinfo->compression_level = which_compression_level()) == -1) { 2660 2681 log_to_screen("User has chosen not to backup the PC"); … … 2840 2861 } 2841 2862 if (archiving_to_media) { 2842 if ((bkpinfo->compression_level = 2843 which_compression_level()) == -1) { 2863 if ((compression_type = which_compression_type()) == NULL) { 2864 log_to_screen("User has chosen not to backup the PC"); 2865 finish(1); 2866 } 2867 if ((bkpinfo->compression_level = which_compression_level()) == -1) { 2844 2868 log_to_screen("User has chosen not to backup the PC"); 2845 2869 finish(1); … … 2876 2900 bkpinfo->netfs_mount = p; 2877 2901 if (!bkpinfo->restore_data) { 2878 if ((bkpinfo->compression_level = 2879 which_compression_level()) == -1) { 2902 if ((compression_type = which_compression_type()) == NULL) { 2903 log_to_screen("User has chosen not to backup the PC"); 2904 finish(1); 2905 } 2906 2907 if ((bkpinfo->compression_level = which_compression_level()) == -1) { 2880 2908 log_to_screen("User has chosen not to backup the PC"); 2881 2909 finish(1); … … 3004 3032 3005 3033 if (archiving_to_media) { 3006 if ((bkpinfo->compression_level = 3007 which_compression_level()) == -1) { 3034 if ((compression_type = which_compression_type()) == NULL) { 3035 log_to_screen("User has chosen not to backup the PC"); 3036 finish(1); 3037 } 3038 if ((bkpinfo->compression_level = which_compression_level()) == -1) { 3008 3039 log_to_screen("User has chosen not to backup the PC"); 3009 3040 finish(1); … … 3119 3150 3120 3151 3121 p = popup_and_get_string("Exclude paths", "Please enter paths which you do NOT want to backup. Separate them with pipes. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.", bkpinfo->exclude_paths);3152 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); 3122 3153 if (p == NULL) { 3123 3154 log_to_screen("User has chosen not to backup the PC"); … … 3145 3176 bkpinfo->scratchdir = p; 3146 3177 3178 if (ask_me_yes_or_no("Do you want to backup extended attributes?")) { 3179 if (find_home_of_exe("getfattr")) { 3180 mr_free(g_getfattr); 3181 mr_asprintf(g_getfattr,"getfattr"); 3182 } 3183 if (find_home_of_exe("getfacl")) { 3184 mr_free(g_getfacl); 3185 mr_asprintf(g_getfacl,"getfacl"); 3186 } 3187 } 3147 3188 // Interactive mode: 3148 3189 #ifdef __IA64__ … … 3152 3193 #endif 3153 3194 bkpinfo->backup_data = TRUE; 3195 3196 mr_free(bkpinfo->zip_exe); 3197 mr_free(bkpinfo->zip_suffix); 3198 if (strcmp(compression_type,"lzo") == 0) { 3199 mr_asprintf(bkpinfo->zip_exe, "lzop"); 3200 mr_asprintf(bkpinfo->zip_suffix, "lzo"); 3201 } else if (strcmp(compression_type,"gzip") == 0) { 3202 mr_asprintf(bkpinfo->zip_exe, "gzip"); 3203 mr_asprintf(bkpinfo->zip_suffix, "gz"); 3204 } else if (strcmp(compression_type,"lzma") == 0) { 3205 mr_asprintf(bkpinfo->zip_exe, "xy"); 3206 mr_asprintf(bkpinfo->zip_suffix, "xy"); 3207 } else if (strcmp(compression_type,"bzip2") == 0) { 3208 mr_asprintf(bkpinfo->zip_exe, "bzip2"); 3209 mr_asprintf(bkpinfo->zip_suffix, "bz2"); 3210 } else { 3211 bkpinfo->zip_exe = NULL; 3212 bkpinfo->zip_suffix = NULL; 3213 } 3154 3214 bkpinfo->verify_data = 3155 3215 ask_me_yes_or_no … … 3164 3224 bkpinfo->restore_data = TRUE; // probably... 3165 3225 } 3226 mr_free(compression_type); 3166 3227 3167 3228 if (bkpinfo->backup_media_type == iso … … 3229 3290 3230 3291 3231 3232 3233 3292 /* @} - end of deviceGroup */ -
branches/2.2.10/mondo/src/common/libmondo-filelist.c
r2715 r2816 1405 1405 last_time = this_time; 1406 1406 if (!g_text_mode) { 1407 mr_asprintf(tmp, "Reading %-68s", dir1); 1407 int cols, rows; 1408 newtGetScreenSize(&cols, &rows); 1409 mr_asprintf(tmp, "Reading %-*s", cols, dir1); 1408 1410 newtDrawRootText(0, g_noof_rows - 3, tmp); 1409 1411 mr_free(tmp); -
branches/2.2.10/mondo/src/common/libmondo-mountlist.c
r2696 r2816 410 410 411 411 if (physical_drive_size < 0) { 412 mr_asprintf(tmp, " %s does not exist.", drive); 413 log_it(tmp); 414 mr_strcat(flaws_str, "%s", tmp); 415 res++; 416 mr_free(tmp); 417 return(flaws_str); 412 if (strstr(drive,"/dev/dm-") == NULL) { 413 mr_asprintf(tmp, " %s does not exist.", drive); 414 log_it(tmp); 415 mr_strcat(flaws_str, "%s", tmp); 416 res++; 417 mr_free(tmp); 418 return(flaws_str); 419 } else { 420 log_it(" %s (dm) will be setup later on", drive); 421 } 418 422 } else { 419 423 log_it("%s is %ld MB", drive, physical_drive_size); 420 mr_free(tmp);421 424 } 422 425 -
branches/2.2.10/mondo/src/common/libmondo-tools.c
r2704 r2816 757 757 mr_free(bkpinfo->netfs_proto); 758 758 mr_free(bkpinfo->postnuke_tarball); 759 mr_free(bkpinfo->subdir); 759 760 760 761 /* Then free the structure */ … … 821 822 bkpinfo->netfs_proto = NULL; 822 823 bkpinfo->postnuke_tarball = NULL; 824 bkpinfo->subdir = NULL; 823 825 bkpinfo->wipe_media_first = FALSE; 824 826 bkpinfo->differential = 0; … … 938 940 #endif 939 941 retval += whine_if_not_found(MKE2FS_OR_NEWFS); 940 retval += whine_if_not_found("mkisofs"); 941 if (system("which dvdrecord > /dev/null 2> /dev/null")) { 942 if (system("which genisoimage > /dev/null 2> /dev/null")) { 943 retval += whine_if_not_found("mkisofs"); 944 } 945 if (system("which wodim > /dev/null 2> /dev/null")) { 942 946 retval += whine_if_not_found("cdrecord"); 943 947 } -
branches/2.2.10/mondo/src/common/mondostructures.h
r2508 r2816 579 579 */ 580 580 char *netfs_user; 581 582 /** 583 * The potential subdirectory under which are located ISO images on HDD (restore mode only) 584 */ 585 char *subdir; 581 586 582 587 /** -
branches/2.2.10/mondo/src/common/newt-specific.c
r2703 r2816 399 399 /* Free all allocated strings in bkpinfo */ 400 400 mr_free_bkpinfo(); 401 401 402 free_libmondo_global_strings(); 402 403 free_newt_stuff(); … … 1209 1210 1210 1211 /** 1212 * Ask the user which compression type they would like to use. 1213 * The choices are "bzip2", "gzip", "lzo". NULL for exit 1214 */ 1215 char *which_compression_type() { 1216 1217 /*@ char ************************************************************ */ 1218 char *output = NULL; 1219 1220 1221 /*@ newt ************************************************************ */ 1222 1223 newtComponent b1; 1224 newtComponent b2; 1225 newtComponent b3; 1226 //newtComponent b4; 1227 newtComponent b5; 1228 newtComponent b_res; 1229 newtComponent myForm; 1230 1231 newtDrawRootText(18, 0, WELCOME_STRING); 1232 newtPushHelpLine 1233 (" Please specify the type of compression that you want."); 1234 newtCenteredWindow(34, 13, "Type of compression?"); 1235 b1 = newtButton(4, 1, "bzip2"); 1236 b2 = newtButton(18, 1, "gzip"); 1237 b3 = newtButton(4, 5, "lzo"); 1238 //b4 = newtButton(18, 5, "lzma"); 1239 b5 = newtButton(4, 9, " Exit "); 1240 myForm = newtForm(NULL, NULL, 0); 1241 newtFormAddComponents(myForm, b1, b3, b2, b5, NULL); 1242 b_res = newtRunForm(myForm); 1243 newtFormDestroy(myForm); 1244 newtPopWindow(); 1245 if (b_res == b1) { 1246 mr_asprintf(output, "%s", "bzip2"); 1247 } else if (b_res == b2) { 1248 mr_asprintf(output, "%s", "gzip"); 1249 } else if (b_res == b3) { 1250 mr_asprintf(output, "%s", "lzo"); 1251 } else if (b_res == b4) { 1252 mr_asprintf(output, "%s", "lzma"); 1253 } 1254 newtPopHelpLine(); 1255 return(output); 1256 } 1257 1258 1259 /** 1211 1260 * Ask the user how much compression they would like to use. 1212 1261 * The choices are "None" (0), "Minimum" (1), "Average" (4), and "Maximum" (9).
Note:
See TracChangeset
for help on using the changeset viewer.