Changeset 2928 in MondoRescue
- Timestamp:
- Dec 23, 2011, 1:09:06 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mondo/src/mondorestore/mondo-prep.c
r2770 r2928 10 10 #include "mondoprep.h" 11 11 #include "../common/libmondo.h" 12 #include "../common/libmondo-tools-EXT.h" 12 13 #include "mondo-rstr-tools-EXT.h" 13 14 #include <sys/ioctl.h> … … 44 45 45 46 FILE *g_fprep = NULL; 46 47 47 extern char *g_mondo_cfg_file; // where m*ndo-restore.cfg (the config file) is stored 48 48 49 49 int g_partition_table_locked_up = 0; 50 51 52 53 54 55 56 57 50 58 51 … … 569 562 char *level = NULL; 570 563 char *program = NULL; 564 char *tmp = NULL; 565 char *oldmd = NULL; 566 char *bootdevice; 567 char *name; 568 569 malloc_string(bootdevice); 570 malloc_string(name); 571 571 572 572 // leave straight away if raidlist is initial or has no entries … … 615 615 // - faulty devices ignored 616 616 // - persistent superblock always used as this is recommended 617 mr_asprintf(&program, "mdadm --create --force --run --auto=yes %s --level=%s --raid-devices=%d", raidlist->el[i].raid_device, level, raidlist->el[i].data_disks.entries); 617 // As per bug #473, the parameter "-e 0.90" is used only when: 618 // 1) It detects that system boots from Raid-1 619 // 2) grub bootloader < v1 is used. 620 // Otherwise it won't boot which is bad. 621 read_cfg_var(g_mondo_cfg_file, "bootloader.device", bootdevice); 622 read_cfg_var(g_mondo_cfg_file, "bootloader.name", name); 623 if (strcmp(name,"GRUB") == 0) { 624 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output("grub --version")); 625 if ((strstr(tmp, "GRUB 0.9") != NULL) && (strcmp(raidlist->el[i].raid_device,device) == 0)) { 626 mr_free(oldmd); 627 mr_asprintf(&oldmd, "-e 0.90"); 628 log_it("Forcing old metadata 0.90 for md on %s for old GRUB", device); 629 } 630 } else if ((strcmp(name,"LILO") == 0) && (strcmp(raidlist->el[i].raid_device,device) == 0)) { 631 mr_free(oldmd); 632 mr_asprintf(&oldmd, "-e 0.90"); 633 log_it("Forcing old metadata 0.90 for md on %s for LILO", device); 634 } else { 635 mr_asprintf(&oldmd, ""); 636 } 637 mr_free(device); 638 mr_free(name); 639 640 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); 641 mr_free(oldmd); 618 642 if (raidlist->el[i].parity != -1) { 619 643 mr_asprintf(&strtmp, "%s", program);
Note:
See TracChangeset
for help on using the changeset viewer.