Changeset 3610 in MondoRescue for branches/3.2/mondo/src/mondorestore
- Timestamp:
- Nov 5, 2016, 6:12:23 PM (8 years ago)
- Location:
- branches/3.2/mondo/src/mondorestore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/mondorestore/mondo-prep.c
r3570 r3610 154 154 char *tmp; 155 155 char *tmp1 = NULL; 156 char *tmp2 = NULL; 156 157 char *incoming; 157 158 char *command; … … 186 187 #endif 187 188 188 if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "nolvm")) { 189 tmp = call_program_and_get_last_line_of_output("cat "CMDLINE); 190 if (strstr(tmp, "nolvm")) { 191 mr_free(tmp); 189 192 return(0); 190 193 } 194 mr_free(tmp); 195 191 196 if (!(fin = fopen("/tmp/i-want-my-lvm", "r"))) { 192 197 log_OS_error("/tmp/i-want-my-lvm"); … … 299 304 if (lvmversion == 2) { 300 305 mr_asprintf(tmp1, "tail -n5 %s | grep Insufficient | tail -n1", MONDO_LOGFILE); 301 strcpy(tmp, call_program_and_get_last_line_of_output(tmp1));302 free(tmp1);303 306 } else { 304 307 mr_asprintf(tmp1, "tail -n5 %s | grep lvcreate | tail -n1", MONDO_LOGFILE); 305 strcpy(tmp, call_program_and_get_last_line_of_output(tmp1));306 free(tmp1);307 308 } 309 tmp2 = call_program_and_get_last_line_of_output(tmp1); 310 strcpy(tmp, tmp2); 311 mr_free(tmp2); 312 mr_free(tmp1); 313 308 314 for (p = tmp; *p != '\0' && !isdigit(*p); p++); 309 315 extents = atol(p); … … 1482 1488 // mark relevant partition as bootable 1483 1489 mr_asprintf(tmp1,"mr-make-me-bootable /tmp/mountlist.txt %s",drivename); 1484 call_program_and_get_last_line_of_output(tmp1);1490 tmp = call_program_and_get_last_line_of_output(tmp1); 1485 1491 mr_free(tmp1); 1492 mr_free(tmp); 1486 1493 1487 1494 log_msg(0,"------------------- end of fdisk.log... ------------------"); -
branches/3.2/mondo/src/mondorestore/mondo-rstr-tools.c
r3601 r3610 695 695 strcpy(bkpinfo->prefix,STD_PREFIX); 696 696 } 697 if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "pxe")) { 697 tmp1 = call_program_and_get_last_line_of_output("cat "CMDLINE); 698 if (strstr(tmp1, "pxe")) { 698 699 /* We need to override prefix value in PXE mode as it's 699 700 * already done in start-netfs */ … … 704 705 strcpy(bkpinfo->prefix,envtmp1); 705 706 } 707 mr_free(tmp1); 706 708 } else if (!strcmp(value, "tape")) { 707 709 bkpinfo->backup_media_type = tape; … … 832 834 833 835 read_cfg_var(cfg_file, "please-dont-eject", value); 834 if (value[0] || strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "donteject")) { 836 tmp1 = call_program_and_get_last_line_of_output("cat "CMDLINE); 837 if (value[0] || strstr(tmp1, "donteject")) { 835 838 bkpinfo->please_dont_eject = TRUE; 836 839 log_msg(2, "Ok, I shan't eject when restoring! Groovy."); 837 840 } 841 mr_free(tmp1); 838 842 839 843 /* TODO: Read here the boot_* variables */ … … 881 885 } 882 886 } 883 if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "pxe")) { 887 tmp1 = call_program_and_get_last_line_of_output("cat "CMDLINE); 888 if (strstr(tmp1, "pxe")) { 884 889 /* We need to override values in PXE mode as it's 885 890 * already done in start-netfs */ … … 898 903 mr_asprintf(bkpinfo->netfs_remote_dir, "%s", envtmp2); 899 904 } 905 mr_free(tmp1); 900 906 } else if (bkpinfo->backup_media_type == iso) { 901 907 /* Patch by Conor Daly 23-june-2004 … … 932 938 mr_asprintf(command, "mount | grep -E '^%s' | tail -n1 | cut -d' ' -f3", g_isodir_device); 933 939 log_it("command = %s", command); 934 log_it("res of it = %s", call_program_and_get_last_line_of_output(command)); 935 sprintf(iso_mnt, "%s", call_program_and_get_last_line_of_output(command)); 940 tmp1 = call_program_and_get_last_line_of_output(command); 941 log_it("res of it = %s", tmp1); 942 sprintf(iso_mnt, "%s", tmp1); 936 943 mr_free(command); 944 mr_free(tmp1); 937 945 } else { 938 946 sprintf(iso_mnt, "/tmp/isodir"); … … 2064 2072 char *cfg_file = NULL; 2065 2073 char *tmp = NULL; 2074 char *tmp1 = NULL; 2066 2075 char *mountpt = NULL; 2067 2076 char *mountlist_file = NULL; … … 2177 2186 if (does_file_exist(MONDO_CFG_FILE_STUB)) { 2178 2187 log_msg(1, "gcffa --- great! We've got the config file"); 2179 mr_asprintf(tmp, "%s/%s", call_program_and_get_last_line_of_output("pwd"), MONDO_CFG_FILE_STUB); 2188 tmp1 = call_program_and_get_last_line_of_output("pwd"); 2189 mr_asprintf(tmp, "%s/%s", tmp1, MONDO_CFG_FILE_STUB); 2180 2190 mr_asprintf(command, "cp -f %s %s", tmp, cfg_file); 2181 2191 log_it("%s",command); … … 2189 2199 mr_free(command); 2190 2200 2191 mr_asprintf(command, "cp -f %s/%s %s", call_program_and_get_last_line_of_output("pwd"), MOUNTLIST_FNAME_STUB, mountlist_file); 2201 mr_asprintf(command, "cp -f %s/%s %s", tmp1, MOUNTLIST_FNAME_STUB, mountlist_file); 2202 mr_free(tmp1); 2192 2203 log_it("%s",command); 2193 2204 if (extract_mountlist_stub) { -
branches/3.2/mondo/src/mondorestore/mondorestore.c
r3564 r3610 1876 1876 log_it("Done loading config file; resizing ML"); 1877 1877 1878 mr_asprintf(tmp1, "%s", call_program_and_get_last_line_of_output("cat "CMDLINE));1878 tmp1 = call_program_and_get_last_line_of_output("cat "CMDLINE); 1879 1879 if (strstr(tmp1, "noresize")) { 1880 1880 log_msg(1, "Not resizing mountlist."); … … 2102 2102 get_cfg_file_from_archive_or_bust(); 2103 2103 load_mountlist(mountlist, g_mountlist_fname); // in case read_cfg_file_into_bkpinfo updated the mountlist 2104 #ifdef __FreeBSD__ 2105 if (strstr(call_program_and_get_last_line_of_output("cat /tmp/cmdline"), "noresize")) 2106 #else 2107 if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "noresize")) 2108 #endif 2109 { 2104 tmp = call_program_and_get_last_line_of_output("cat "CMDLINE); 2105 if (strstr(tmp, "noresize")) { 2110 2106 log_msg(2, "Not resizing mountlist."); 2111 2107 } else { 2112 2108 resize_mountlist_proportionately_to_suit_new_drives(mountlist); 2113 2109 } 2110 mr_free(tmp); 2111 2114 2112 flaws_str = evaluate_mountlist(mountlist); 2115 2113 if (flaws_str != NULL) { … … 2138 2136 twenty_seconds_til_yikes(); 2139 2137 g_fprep = fopen("/tmp/prep.sh", "w"); 2140 mr_asprintf(tmp1, "%s", call_program_and_get_last_line_of_output("cat "CMDLINE));2138 tmp1 = call_program_and_get_last_line_of_output("cat "CMDLINE); 2141 2139 if (strstr(tmp1, "nopart")) { 2142 2140 log_msg(2, "Not partitioning drives due to 'nopart' option."); … … 2204 2202 2205 2203 after_the_nuke: 2206 mr_asprintf(tmp1, "%s", call_program_and_get_last_line_of_output("cat "CMDLINE));2204 tmp1 =call_program_and_get_last_line_of_output("cat "CMDLINE); 2207 2205 if (retval) { 2208 2206 log_to_screen("Errors occurred during the nuke phase."); … … 2595 2593 2596 2594 /* Configure global variables */ 2597 #ifdef __FreeBSD__ 2598 if (strstr 2599 (call_program_and_get_last_line_of_output("cat /tmp/cmdline"), 2600 "textonly")) 2601 #else 2602 if (strstr 2603 (call_program_and_get_last_line_of_output("cat /proc/cmdline"), 2604 "textonly")) 2605 #endif 2606 { 2595 tmp = call_program_and_get_last_line_of_output("cat "CMDLINE); 2596 if (strstr(tmp, "textonly")) { 2607 2597 g_text_mode = TRUE; 2608 2598 log_msg(1, "TEXTONLY MODE"); … … 2610 2600 g_text_mode = FALSE; 2611 2601 } // newt :-) 2602 mr_free(tmp); 2603 2612 2604 if (!(mountlist = malloc(sizeof(struct mountlist_itself)))) { 2613 2605 fatal_error("Cannot malloc mountlist"); … … 2622 2614 malloc_libmondo_global_strings(); 2623 2615 2624 strcpy(g_mondo_home, 2625 call_program_and_get_last_line_of_output("which mondorestore")); 2616 tmp = call_program_and_get_last_line_of_output("which mondorestore"); 2617 strcpy(g_mondo_home, tmp); 2618 mr_free(tmp); 2619 2626 2620 g_current_media_number = 1; // precaution 2627 2628 2621 run_program_and_log_output("mkdir -p " MNT_CDROM, FALSE); 2629 2622
Note:
See TracChangeset
for help on using the changeset viewer.