Changeset 2816 in MondoRescue for branches/2.2.10/mondo/src
- Timestamp:
- Apr 29, 2011, 3:42:55 PM (13 years ago)
- Location:
- branches/2.2.10/mondo/src
- Files:
-
- 15 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). -
branches/2.2.10/mondo/src/include/mr_conf.h
r2208 r2816 59 59 /* Default compression level */ 60 60 int compression_level; 61 /* Subdir for ISO images on HDD */ 62 char *subdir; 61 63 /* Paths to exclude from backup */ 62 64 char *exclude_paths; -
branches/2.2.10/mondo/src/mondorestore/Makefile.am
r2209 r2816 14 14 sbin_PROGRAMS = mondorestore 15 15 mondorestore_SOURCES = mondo-prep.c mondorestore.c mondo-rstr-newt.c \ 16 mondo-rstr-compare.c mondo-rstr-tools.c 16 mondo-rstr-compare.c mondo-rstr-tools.c ../common/newt-specific.c 17 17 mondorestore_LDADD = ${top_builddir}/src/common/libmondo.a ${top_builddir}/src/lib/libmr.a @MONDORESTORE_STATIC@ -
branches/2.2.10/mondo/src/mondorestore/mondo-prep.c
r2704 r2816 466 466 { 467 467 if (!does_file_exist("/etc/raidtab")) { 468 log_to_screen 469 ("Cannot find /etc/raidtab - cannot extrapolate the fdisk entries"); 468 log_to_screen("Cannot find /etc/raidtab - cannot extrapolate the fdisk entries"); 470 469 finish(1); 471 470 } … … 690 689 if (!vinum_started_yet) { 691 690 if (!does_file_exist("/tmp/raidconf.txt")) { 692 log_to_screen 693 ("/tmp/raidconf.txt does not exist. I therefore cannot start Vinum."); 691 log_to_screen("/tmp/raidconf.txt does not exist. I therefore cannot start Vinum."); 694 692 } else { 695 693 int res; … … 698 696 ("vinum create /tmp/raidconf.txt", TRUE); 699 697 if (res) { 700 log_to_screen 701 ("`vinum create /tmp/raidconf.txt' returned errors. Please fix them and re-run mondorestore."); 698 log_to_screen("`vinum create /tmp/raidconf.txt' returned errors. Please fix them and re-run mondorestore."); 702 699 finish(1); 703 700 } … … 757 754 } 758 755 #else 759 log_to_screen(tmp, "Initializing RAID device %s", device); 760 log_to_screen(tmp); 761 mr_free(tmp); 756 log_to_screen("Initializing RAID device %s", device); 762 757 763 758 // Shouldn't be necessary. … … 808 803 mr_asprintf(tmp, "Formatting %s as %s", device, format); 809 804 update_progress_form(tmp); 810 mr_free(tmp);811 805 812 806 res = run_program_and_log_output(program, FALSE); … … 1005 999 if (retval) { 1006 1000 mvaddstr_and_log_it(g_currentY++, 74, "Failed."); 1007 log_to_screen 1008 ("Errors occurred during the formatting of your hard drives."); 1001 log_to_screen("Errors occurred during the formatting of your hard drives."); 1009 1002 } else { 1010 1003 mvaddstr_and_log_it(g_currentY++, 74, "Done."); … … 1016 1009 if (retval > 0 && !interactively) { 1017 1010 //123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1018 log_to_screen 1019 ("Partition table locked up %d times. At least one 'mkfs' (format) command", 1020 g_partition_table_locked_up); 1021 log_to_screen 1022 ("failed. I think these two events are related. Sometimes, fdisk's ioctl() call"); 1023 log_to_screen 1024 ("to refresh its copy of the partition table causes the kernel to lock the "); 1025 log_to_screen 1026 ("partition table. I believe this has just happened."); 1027 if (ask_me_yes_or_no 1028 ("Please choose 'yes' to reboot and try again; or 'no' to ignore this warning and continue.")) 1029 { 1011 log_to_screen("Partition table locked up %d times. At least one 'mkfs' (format) command", g_partition_table_locked_up); 1012 log_to_screen("failed. I think these two events are related. Sometimes, fdisk's ioctl() call"); 1013 log_to_screen("to refresh its copy of the partition table causes the kernel to lock the "); 1014 log_to_screen("partition table. I believe this has just happened."); 1015 if (ask_me_yes_or_no("Please choose 'yes' to reboot and try again; or 'no' to ignore this warning and continue.")) { 1030 1016 sync(); 1031 1017 sync(); … … 1034 1020 } 1035 1021 } else { 1036 log_to_screen 1037 ("Partition table locked up %d time%c. However, disk formatting succeeded.", 1038 g_partition_table_locked_up, 1039 (g_partition_table_locked_up == 1) ? '.' : 's'); 1022 log_to_screen("Partition table locked up %d time%c. However, disk formatting succeeded.", g_partition_table_locked_up, (g_partition_table_locked_up == 1) ? '.' : 's'); 1040 1023 } 1041 1024 } … … 1462 1445 mr_asprintf(command, "disklabel -B %s", basename(drivename)); 1463 1446 if (system(command)) { 1464 log_to_screen 1465 ("Warning! Unable to make the drive bootable."); 1447 log_to_screen("Warning! Unable to make the drive bootable."); 1466 1448 } 1467 1449 mr_free(command); … … 1550 1532 #ifndef __IA64__ 1551 1533 if (current_devno == 5 && previous_devno == 4) { 1552 log_to_screen 1553 ("You must leave at least one partition spare as the Extended partition."); 1534 log_to_screen("You must leave at least one partition spare as the Extended partition."); 1554 1535 mr_free(device_str); 1555 1536 mr_free(format); … … 1566 1547 retval += label_drive_or_slice(mountlist, device_str, 0); 1567 1548 if (system(tmp)) { 1568 log_to_screen 1569 ("Warning! Unable to make the slice bootable."); 1549 log_to_screen("Warning! Unable to make the slice bootable."); 1570 1550 } 1571 1551 mr_free(tmp); … … 1611 1591 1612 1592 if (g_partition_table_locked_up > 0) { 1613 log_to_screen 1614 ("A flaw in the Linux kernel has locked the partition table. Even calling partprobe did not suceed :-("); 1593 log_to_screen("A flaw in the Linux kernel has locked the partition table. Even calling partprobe did not suceed :-("); 1615 1594 } 1616 1595 } … … 1875 1854 if (retval) { 1876 1855 mvaddstr_and_log_it(g_currentY++, 74, "Failed."); 1877 log_to_screen 1878 ("Errors occurred during the partitioning of your hard drives."); 1856 log_to_screen("Errors occurred during the partitioning of your hard drives."); 1879 1857 } else { 1880 1858 mvaddstr_and_log_it(g_currentY++, 74, "Done."); … … 2311 2289 2312 2290 /** float ***********************************************************/ 2313 float factor; 2314 float new_size; 2315 // float newcylinderno; 2291 long long factor; 2292 long long new_size; 2316 2293 2317 2294 /** long *************************************************************/ 2318 long newsizL = 0L;2319 long current_size_of_drive = 0L;2320 long original_size_of_drive = 0L;2321 long final_size = 0L; /* all in Megabytes*/2295 long long newsizL = 0LL; 2296 long long totalsizL = 0LL; 2297 long long current_size_of_drive = 0LL; /* use KB interally for precision */ 2298 long long original_size_of_drive = 0LL; /* use KB interally for precision */ 2322 2299 struct mountlist_reference *drivemntlist; 2323 2300 … … 2336 2313 } 2337 2314 2338 current_size_of_drive = get_phys_size_of_drive(drive_name);2339 2340 if (current_size_of_drive <= 0 ) {2315 current_size_of_drive = (long long) get_phys_size_of_drive(drive_name) * 1024LL; 2316 2317 if (current_size_of_drive <= 0LL) { 2341 2318 log_it("Not resizing to match %s - can't find drive", drive_name); 2342 2319 return; 2343 2320 } 2344 log_to_screen("Expanding entries to suit drive %s (%l d MB)", drive_name, current_size_of_drive);2321 log_to_screen("Expanding entries to suit drive %s (%lld MB)", drive_name, current_size_of_drive / 1024); 2345 2322 2346 2323 drivemntlist = malloc(sizeof(struct mountlist_reference)); … … 2354 2331 2355 2332 for (partno = 0; partno < drivemntlist->entries; partno++) { 2356 if (drivemntlist->el[partno]->size > 0) { 2357 original_size_of_drive += (drivemntlist->el[partno]->size / 1024L); 2333 if (drivemntlist->el[partno]->size > 0LL) { 2334 /* Keep KB here */ 2335 original_size_of_drive += drivemntlist->el[partno]->size; 2358 2336 } 2359 2337 } … … 2363 2341 return; 2364 2342 } 2365 factor = ( float) (current_size_of_drive) / (float)(original_size_of_drive);2366 log_to_screen("Disk %s was %l d MB; is now %ld MB; factor = %f", drive_name, original_size_of_drive, current_size_of_drive, factor);2343 factor = (current_size_of_drive) / (original_size_of_drive); 2344 log_to_screen("Disk %s was %lld MB; is now %lld MB; Proportionally resizing partitions (factor ~= %lld)", drive_name, original_size_of_drive/1024, current_size_of_drive/1024, factor); 2367 2345 2368 2346 lastpart = drivemntlist->entries - 1; … … 2370 2348 /* the 'atoi' thing is to make sure we don't try to resize _images_, whose formats will be numeric */ 2371 2349 if (!atoi(drivemntlist->el[partno]->format)) { 2372 new_size = ( float) (drivemntlist->el[partno]->size) * factor;2350 new_size = (drivemntlist->el[partno]->size) * factor; 2373 2351 } else { 2374 2352 new_size = drivemntlist->el[partno]->size; … … 2379 2357 drivemntlist->el[partno]->device, 2380 2358 drivemntlist->el[partno]->mountpoint); 2381 newsizL = (long) new_size; // It looks wrong but it's not 2382 } else { 2383 newsizL = (long) new_size; 2384 } 2359 } 2360 newsizL = new_size; 2385 2361 2386 2362 /* Do not apply the factor if partition was of negative size */ 2387 if (newsizL < 0 ) {2363 if (newsizL < 0LL) { 2388 2364 newsizL = drivemntlist->el[partno]->size; 2389 2365 } 2390 2391 log_to_screen("Changing %s from %lld KB to %ld KB", drivemntlist->el[partno]->device, drivemntlist->el[partno]->size, newsizL); 2366 totalsizL += newsizL; 2367 2368 log_to_screen("Changing %s from %lld KB to %lld KB", drivemntlist->el[partno]->device, drivemntlist->el[partno]->size, newsizL); 2392 2369 drivemntlist->el[partno]->size = newsizL; 2393 2370 } 2394 final_size = get_phys_size_of_drive(drive_name); 2395 log_to_screen("final_size = %ld MB", final_size); 2371 // Ensures over-allocation alert and prompt for interactive mode does not happen 2372 if (totalsizL > current_size_of_drive) { 2373 log_to_screen("Last partition size calculated would be over-allocated, reducing %s from %lld KB to %lld KB.", drivemntlist->el[lastpart]->device, drivemntlist->el[lastpart]->size, drivemntlist->el[lastpart]->size - (totalsizL - current_size_of_drive)); 2374 drivemntlist->el[drivemntlist->entries-1]->size -= (totalsizL - current_size_of_drive); 2375 } else if (totalsizL < current_size_of_drive) { 2376 log_to_screen("Last partition size calculated would be under-allocated, increasing %s from %lld KB to %lld KB.",drivemntlist->el[lastpart]->device, drivemntlist->el[lastpart]->size, drivemntlist->el[lastpart]->size + (current_size_of_drive - totalsizL)); 2377 drivemntlist->el[drivemntlist->entries-1]->size += (current_size_of_drive - totalsizL); 2378 } 2379 log_to_screen("final_size = %lld MB", current_size_of_drive / 1024); 2396 2380 } 2397 2381 -
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-newt.c
r2512 r2816 16 16 //static char cvsid[] = "$Id$"; 17 17 18 extern bool popup_with_buttons(char *p, char *button1, char *button2); 18 19 extern char err_log_lines[NOOF_ERR_LINES][MAX_STR_LEN]; 19 20 … … 2268 2269 * @return TRUE if OK was pressed, FALSE otherwise. 2269 2270 */ 2270 bool get_isodir_info(char *isodir_device, char *isodir_format, char *isodir_path, bool nuke_me_please) {2271 bool get_isodir_info(char *isodir_device, char *isodir_format, char *isodir_path, char *subdir_path, bool nuke_me_please) { 2271 2272 2272 2273 char *p = NULL; 2273 2274 char *q = NULL; 2274 2275 char *r = NULL; 2276 char *s = NULL; 2275 2277 char *idev = NULL; 2276 2278 bool ret = FALSE; /* Should be false by default, and modfiy if conditions respected */ 2277 2279 bool HDD = FALSE; 2278 2280 /** initialize ********************************************************/ 2279 2281 … … 2303 2305 p = popup_and_get_string("ISO Mode - device", "On what device do the ISO files live?", idev); 2304 2306 if (p != NULL) { 2307 if (popup_with_buttons("Are you restoring from an external hard drive ?", "Yes", "No")) { 2308 HDD = TRUE; 2309 } 2305 2310 q = popup_and_get_string("ISO Mode - format", "What is the disk format of the device? (Hit ENTER if you don't know.)", isodir_format); 2306 2311 mr_free(isodir_format); … … 2323 2328 2324 2329 ret = TRUE; 2330 } 2331 if (HDD) { 2332 /* We need an additional param */ 2333 subdir_path = isodir_path; 2334 mr_asprintf(isodir_path, "/tmp/isodir"); 2325 2335 } 2326 2336 } -
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-newt.h
r2508 r2816 141 141 int find_next_free_index_in_disklist(struct list_of_disks *); 142 142 int find_raid_device_in_raidlist(struct raidlist_itself *, char *); 143 bool get_isodir_info(char *, char *, char *, bool);143 bool get_isodir_info(char *, char *, char *, char *, bool); 144 144 void initiate_new_raidlist_entry(struct raidlist_itself *, 145 145 struct mountlist_itself *, int, char *); -
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c
r2704 r2816 201 201 202 202 /* g_isodir_device is passed and modified in this function - memory is managed correctly in it */ 203 if (!get_isodir_info(g_isodir_device, isodir_format, bkpinfo->isodir, nuke_me_please)) {203 if (!get_isodir_info(g_isodir_device, isodir_format, bkpinfo->isodir, bkpinfo->subdir, nuke_me_please)) { 204 204 mr_free(isodir_format); 205 205 return (1); … … 1213 1213 ("You will now be able to re-generate your initrd.\nThis is especially useful if you changed of hardware configuration, cloned, made P2V, used multipath...\nDo you need to do it ?")) { 1214 1214 log_msg(1,"Launching shell for manual initrd recreation"); 1215 popup_and_OK("You'll now be chrooted under your future / partition.\nGo under /boot and rebuild your initrd with\nmkinitrd -f -v initrd-2.x.y.img 2.x.y e.g.\nThen type exit to finish."); 1215 if (does_file_exist(MNT_RESTORING"/etc/arch-release")) { 1216 popup_and_OK("You'll now be chrooted under your future / partition.\nEdit /etc/mkinitcpio.conf if needed and rebuild your initrd with the kernel preset name e.g.\nmkinitcpio -p kernel26\nThen type exit to finish.\n"); 1217 } else { 1218 popup_and_OK("You'll now be chrooted under your future / partition.\nGo under /boot and rebuild your initrd with\nmkinitrd -f -v initrd-2.x.y.img 2.x.y e.g.\nThen type exit to finish."); 1219 } 1216 1220 mvaddstr_and_log_it(g_currentY, 0, "Modifying initrd..."); 1217 1221 if (!g_text_mode) { -
branches/2.2.10/mondo/src/mondorestore/mondorestore.c
r2704 r2816 838 838 "Using tune2fs to identify your ext2,3 partitions"); 839 839 840 mr_asprintf(tmp, "label-partitions-as-necessary %s < /tmp/fstab ", MINDI_CACHE"/mountlist.txt");840 mr_asprintf(tmp, "label-partitions-as-necessary %s < /tmp/fstab >> %s 2>> %s", g_mountlist_fname, fstab_fname, MONDO_LOGFILE, MONDO_LOGFILE); 841 841 res = run_program_and_log_output(tmp, TRUE); 842 842 mr_free(tmp); -
branches/2.2.10/mondo/src/mondorestore/mr-externs.h
r2704 r2816 32 32 extern void free_filelist(struct s_node *); 33 33 extern long get_time(void); 34 extern bool get_isodir_info(char *, char *, char *, bool);34 extern bool get_isodir_info(char *, char *, char *, char *, bool); 35 35 extern void fatal_error(char *); 36 36 extern void initialize_raid_record(struct raid_device_record *);
Note:
See TracChangeset
for help on using the changeset viewer.