Changeset 3161 in MondoRescue for branches/3.1/mondo/src/mondorestore/mondo-prep.c
- Timestamp:
- Jun 25, 2013, 10:53:14 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mondo/src/mondorestore/mondo-prep.c
r3148 r3161 188 188 char *p; 189 189 char *q; 190 char *r;191 190 192 191 /** int ***************************************************/ … … 391 390 } 392 391 mr_asprintf(tmp1, "echo \"%s\" >> /tmp/out.sh", command); 393 system(tmp1); 392 if (system(tmp1)) { 393 //FIXME 394 } 394 395 mr_free(tmp1); 395 396 sleep(1); … … 443 444 /** pointers *********************************************************/ 444 445 char *p; 445 char *q;446 446 447 447 /** init *************************************************************/ … … 533 533 int i = 0; 534 534 int j = 0; 535 int v = 0;536 535 int res = 0; 537 536 … … 540 539 char *level = NULL; 541 540 char *program = NULL; 542 543 malloc_string(bootdevice); 544 malloc_string(name); 545 541 char *strtmp = NULL; 542 char *oldmd = NULL; 543 546 544 // leave straight away if raidlist is initial or has no entries 547 545 if (!raidlist || raidlist->entries == 0) { … … 587 585 // - faulty devices ignored 588 586 // - persistent superblock always used as this is recommended 589 // As per bug #473, the parameter "-e 0.90" is used only when:590 // 1) It detects that system boots from Raid-1591 // 2) grub bootloader < v1 is used.592 // Otherwise it won't boot which is bad.593 read_cfg_var(g_mondo_cfg_file, "bootloader.device", bootdevice);594 read_cfg_var(g_mondo_cfg_file, "bootloader.name", name);595 if (strcmp(name,"GRUB") == 0) {596 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("grub --version"));597 if ((strstr(tmp, "GRUB 0.9") != NULL) && (strcmp(raidlist->el[i].raid_device,device) == 0)) {598 mr_free(oldmd);599 mr_asprintf(oldmd, "-e 0.90");600 log_it("Forcing old metadata 0.90 for md on %s for old GRUB", device);601 }602 } else if ((strcmp(name,"LILO") == 0) && (strcmp(raidlist->el[i].raid_device,device) == 0)) {603 mr_free(oldmd);604 mr_asprintf(oldmd, "-e 0.90");605 log_it("Forcing old metadata 0.90 for md on %s for LILO", device);606 } else {607 mr_asprintf(oldmd, "");608 }609 mr_free(device);610 mr_free(name);611 587 612 588 mr_asprintf(program, "mdadm --create --force --run --auto=yes %s --level=%s --raid-devices=%d %s", raidlist->el[i].raid_device, level, raidlist->el[i].data_disks.entries, oldmd); … … 632 608 break; 633 609 } 634 paranoid_free(strtmp);610 mr_free(strtmp); 635 611 } 636 612 if (raidlist->el[i].chunk_size != -1) { … … 1039 1015 sync(); 1040 1016 sync(); 1041 system("reboot"); 1017 if (system("reboot")) { 1018 // FIXME 1019 } 1042 1020 } 1043 1021 } else { … … 1420 1398 char *tmp = NULL; 1421 1399 char *tmp1 = NULL; 1422 char *tmp1 = NULL;1423 char *tmp1 = NULL;1424 1400 1425 1401 /** end *************************************************************/ … … 1594 1570 sync(); 1595 1571 paranoid_pclose(pout_to_fdisk); 1596 paranoid_system("sync");1572 sync(); 1597 1573 log_msg(0,"------------------- fdisk.log looks like this ------------------"); 1598 1574 mr_asprintf(tmp, "cat %s >> %s", FDISK_LOG, MONDO_LOGFILE); 1599 system(tmp); 1575 if (system(tmp)) { 1576 // FIXME 1577 } 1600 1578 mr_free(tmp); 1601 1579 … … 1645 1623 1646 1624 /** pointers **********************************************************/ 1647 char *p;1648 1625 char *part_table_fmt = NULL; 1649 1626 FILE *fout; … … 1676 1653 return (1); 1677 1654 } 1678 1679 1680 p = (char *) strrchr(partition_name, '/');1681 1655 1682 1656 /* BERLIOS: should not be called each time */ … … 1916 1890 1917 1891 /** pointers *********************************************************/ 1918 char *p;1919 1892 FILE *fout; 1920 1893 … … 1928 1901 1929 1902 partition = build_partition_name(drive, partno); 1930 p = (char *) strrchr(partition, '/');1931 1903 if (strcmp(format, "swap") == 0) { 1932 1904 mr_asprintf(partcode, "82"); … … 2169 2141 char *dev; 2170 2142 char *p; 2171 int res;2172 2143 #endif 2173 2144 2174 2145 /** pointers ********************************************************/ 2175 2146 FILE *fin; 2176 char *q;2177 2147 int i; 2178 2148 … … 2233 2203 char *which_format_command_do_i_need(char *format) 2234 2204 { 2235 /** int *************************************************************/2236 int res = 0;2237 2238 2205 /** buffers *********************************************************/ 2239 2206 char *program = NULL; … … 2292 2259 #endif 2293 2260 log_it("Unknown format (%s) - assuming '%s' will do", format, program); 2294 res = 0;2295 2261 } 2296 2262 return (program); … … 2320 2286 float factor; 2321 2287 long long new_size; 2288 char *tmp = NULL; 2322 2289 2323 2290 /** long *************************************************************/
Note:
See TracChangeset
for help on using the changeset viewer.