Changeset 2462 in MondoRescue for branches/2.2.10/mondo/src/common
- Timestamp:
- Oct 20, 2009, 4:07:00 PM (15 years ago)
- Location:
- branches/2.2.10/mondo/src/common
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-archive.c
r2460 r2462 513 513 char *bootldr_str = NULL; 514 514 char *tape_device = NULL; 515 char *last_filelist_number = NULL;516 515 char *broken_bios_sz = NULL; 517 516 char *cd_recovery_sz = NULL; … … 546 545 } 547 546 lines_in_filelist = count_lines_in_file(tmp); 548 mr_free(tmp);549 550 mr_asprintf(tmp, "%s/LAST-FILELIST-NUMBER", bkpinfo->tmpdir);551 last_filelist_number = last_line_of_file(tmp);552 547 mr_free(tmp); 553 548 … … 805 800 (bkpinfo->image_devs == NULL) ? "\"\"" : bkpinfo->image_devs, // parameter #10 806 801 broken_bios_sz, // parameter #11 807 last_filelist_number, // parameter #12 (STRING) 808 estimated_total_noof_slices, // parameter #13 (INT) 809 (bkpinfo->exclude_devs == NULL) ? "\"\"" : bkpinfo->exclude_devs, // parameter #14 810 use_comp_sz, // parameter #15 811 use_lilo_sz, // parameter #16 812 use_star_sz, // parameter #17 813 bkpinfo->internal_tape_block_size, // parameter #18 (LONG) 814 bkpinfo->differential, // parameter #19 (INT) 815 use_gzip_sz, // parameter #20 (STRING) 816 use_lzma_sz, // parameter #21 (STRING) 802 estimated_total_noof_slices, // parameter #12 (INT) 803 (bkpinfo->exclude_devs == NULL) ? "\"\"" : bkpinfo->exclude_devs, // parameter #13 804 use_comp_sz, // parameter #14 805 use_lilo_sz, // parameter #15 806 use_star_sz, // parameter #16 807 bkpinfo->internal_tape_block_size, // parameter #17 (LONG) 808 bkpinfo->differential, // parameter #18 (INT) 809 use_gzip_sz, // parameter #19 (STRING) 810 use_lzma_sz, // parameter #20 (STRING) 817 811 MONDO_LOGFILE); 818 812 819 813 mr_free(tmp2); 820 mr_free(last_filelist_number);821 814 mr_free(tape_device); 822 815 mr_free(use_lzo_sz); -
branches/2.2.10/mondo/src/common/libmondo-cli.c
r2444 r2462 671 671 mr_free(bkpinfo->kernel_path); 672 672 mr_asprintf(bkpinfo->kernel_path, "%s", flag_val['k']); 673 if (!strcmp(bkpinfo->kernel_path, "failsafe")) { 674 mr_free(bkpinfo->kernel_path); 675 mr_asprintf(bkpinfo->kernel_path, "FAILSAFE"); 676 } 677 if (strcmp(bkpinfo->kernel_path, "FAILSAFE") && !does_file_exist(bkpinfo->kernel_path)) { 673 if (!does_file_exist(bkpinfo->kernel_path)) { 678 674 retval++; 679 675 log_to_screen("You specified kernel '%s', which does not exist\n", bkpinfo->kernel_path); -
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2460 r2462 2731 2731 paranoid_fclose(fin); 2732 2732 } else { 2733 if (does_file_exist( "/tmp/mondo-restore.cfg")) {2733 if (does_file_exist(MINDI_CACHE"/mondorestore.cfg")) { 2734 2734 mr_free(bkpinfo->media_device); 2735 bkpinfo->media_device = read_cfg_var( "/tmp/mondo-restore.cfg", "media-dev");2735 bkpinfo->media_device = read_cfg_var(MINDI_CACHE"/mondorestore.cfg", "media-dev"); 2736 2736 } 2737 2737 } … … 3075 3075 ("Will you want to verify your backups after Mondo has created them?"); 3076 3076 3077 #ifndef __FreeBSD__3078 if (!ask_me_yes_or_no3079 ("Are you confident that your kernel is a sane, sensible, standard Linux kernel? Say 'no' if you are using a Gentoo <1.4 or Debian <3.0, please."))3080 #endif3081 {3082 mr_free(bkpinfo->kernel_path);3083 mr_asprintf(bkpinfo->kernel_path, "FAILSAFE");3084 }3085 3086 3077 if (!ask_me_yes_or_no 3087 3078 ("Are you sure you want to proceed? Hit 'no' to abort.")) { -
branches/2.2.10/mondo/src/common/libmondo-filelist.c
r2444 r2462 322 322 mr_free(biggie_fname); 323 323 324 mr_asprintf(outfname, "%s/LAST-FILELIST-NUMBER", bkpinfo->tmpdir); 325 mr_asprintf(tmp, "%ld", curr_set_no); 326 if (write_one_liner_data_file(outfname, tmp)) { 327 log_OS_error 328 ("Unable to echo write one-liner to LAST-FILELIST-NUMBER"); 329 err = 1; 330 } 324 mr_asprintf(tmp, "echo 'last-filelist-number %ld' >> "MINDI_CACHE"/mondorestore.cfg", curr_set_no); 325 paranoid_system(tmp); 331 326 mr_free(tmp); 332 mr_free(outfname);333 327 334 328 if (curr_set_no == 0) { … … 708 702 assert(bkpinfo != NULL); 709 703 710 mr_asprintf(cfg_fname, "%s/mondo -restore.cfg", bkpinfo->tmpdir);704 mr_asprintf(cfg_fname, "%s/mondorestore.cfg", MINDI_CACHE); 711 705 val_sz = read_cfg_var(cfg_fname, "last-filelist-number"); 712 706 mr_free(cfg_fname); -
branches/2.2.10/mondo/src/common/libmondo-files.c
r2406 r2462 705 705 706 706 /** 707 * Determine the size (in KB) of @p dev in the mountlist in <tt>tmpdir</tt>/mountlist.txt.707 * Determine the size (in KB) of @p dev in the mountlist in mountlist.txt. 708 708 * @param tmpdir The tempdir where the mountlist is stored. 709 709 * @param dev The device to search for. … … 717 717 long file_len_K; 718 718 719 mr_asprintf(mountlist, "%s/mountlist.txt", tmpdir);720 mr_asprintf(command, "grep \"%s \" %s/mountlist.txt | head -n1 | awk '{print $4}'", dev, tmpdir);719 mr_asprintf(mountlist, "%s/mountlist.txt", MINDI_CACHE); 720 mr_asprintf(command, "grep \"%s \" %s/mountlist.txt | head -n1 | awk '{print $4}'", dev, MINDI_CACHE); 721 721 mr_free(mountlist); 722 722 … … 992 992 * Copy the files that Mondo/Mindi need to run to the scratchdir or tempdir. 993 993 * Currently this includes: copy Mondo's home directory to scratchdir, 994 * copy LAST-FILELIST-NUMBER to scratchdir, copypost-nuke.tgz (if it exists) to tmpdir,994 * copy post-nuke.tgz (if it exists) to tmpdir, 995 995 * and run "hostname > scratchdir/HOSTNAME". 996 996 * @param bkpinfo The backup information structure. Fields used: … … 1020 1020 if (res) { 1021 1021 fatal_error("Failed to copy Mondo's stuff to scratchdir"); 1022 }1023 1024 mr_asprintf(command, "cp -f %s/LAST-FILELIST-NUMBER %s", bkpinfo->tmpdir, bkpinfo->scratchdir);1025 res = run_program_and_log_output(command, FALSE);1026 mr_free(command);1027 1028 if (res) {1029 fatal_error("Failed to copy LAST-FILELIST-NUMBER to scratchdir");1030 1022 } 1031 1023 -
branches/2.2.10/mondo/src/common/libmondo-stream.c
r2405 r2462 856 856 (void) getcwd(old_cwd, MAX_STR_LEN); 857 857 chdir(bkpinfo->tmpdir); 858 mr_asprintf(tmp, "tar -zxf %s . /tmp/mondo-restore.cfg 2> /dev/null", outfname);858 mr_asprintf(tmp, "tar -zxf %s ."MINDI_CACHE"/mondorestore.cfg 2> /dev/null", outfname); 859 859 paranoid_system(tmp); 860 860 mr_free(tmp); 861 861 862 paranoid_system("cp -f tmp/mondo-restore.cfg . 2> /dev/null");862 paranoid_system("cp -f ."MINDI_CACHE"/mondorestore.cfg . 2> /dev/null"); 863 863 chdir(old_cwd); 864 864 unlink(outfname); -
branches/2.2.10/mondo/src/common/libmondo-tools.c
r2444 r2462 1071 1071 /** 1072 1072 * Retrieve the line containing @p label from the config file. 1073 * @param config_file The file to read from, usually @c /tmp/mondo-restore.cfg.1073 * @param config_file The file to read from, usually @c mondorestore.cfg. 1074 1074 * @param label What to read from the file. 1075 1075 * @param value Where to put it. … … 1294 1294 * Write a line to a configuration file. Writes a line of the form, 1295 1295 * @c label @c value. 1296 * @param config_file The file to write to. Usually @c mondo -restore.cfg.1296 * @param config_file The file to write to. Usually @c mondorestore.cfg. 1297 1297 * @param label What to call this bit of data you're writing. 1298 1298 * @param value The bit of data you're writing. -
branches/2.2.10/mondo/src/common/mondostructures.h
r2428 r2462 557 557 558 558 /** 559 * Path to the user's kernel, or "FAILSAFE" or "SUCKS" to use the kernel 560 * included with Mindi. 559 * Path to the user's kernel included with Mindi. 561 560 */ 562 561 char *kernel_path;
Note:
See TracChangeset
for help on using the changeset viewer.