Changeset 2985 in MondoRescue
- Timestamp:
- Mar 30, 2012, 2:43:48 AM (13 years ago)
- Location:
- branches/3.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mindi/mindi
r2983 r2985 1004 1004 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.DEVICE bootloader.device $outfile 1005 1005 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.NAME bootloader.name $outfile 1006 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.VER bootloader.ver $outfile 1006 1007 AddFileToCfgIfExists $MINDI_TMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile 1007 1008 AddFileToCfgIfExists $MINDI_TMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile -
branches/3.0/mondo/src/common/libmondo-archive.c
r2971 r2985 517 517 char *use_star_sz = NULL; 518 518 char *bootldr_str = NULL; 519 char *bootldr_ver = NULL; 519 520 char *tape_device = NULL; 520 521 char *last_filelist_number = NULL; … … 705 706 ("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst, /boot/grub/grub.cfg, or /boot/grub2/grub.cfg but I cannot find it there. What is wrong with your Linux distribution?"); 706 707 } 708 mr_asprintf(&bootldr_ver, "%s", call_program_and_get_last_line_of_output("grub --version")); 707 709 } else if (bkpinfo->boot_loader == 'E') { 708 710 mr_asprintf(&bootldr_str, "ELILO"); … … 754 756 log_to_screen(tmp); 755 757 mr_free(tmp); 758 if (bootldr_ver != NULL) { 759 mr_asprintf(&tmp, "Boot loader version string: %s", bootldr_ver); 760 log_to_screen(tmp); 761 mr_free(tmp); 762 } 756 763 757 764 mr_asprintf(&tmp, "%s/BOOTLOADER.DEVICE", bkpinfo->tmpdir); … … 814 821 } 815 822 mr_free(bootldr_str); 823 mr_free(tmp); 824 825 mr_asprintf(&tmp, "%s/BOOTLOADER.VER", bkpinfo->tmpdir); 826 if (write_one_liner_data_file(tmp, bootldr_ver)) { 827 res++; 828 log_msg(1, "%ld: Unable to write one-liner bootloader.ver", 829 __LINE__); 830 } 831 mr_free(bootldr_ver); 816 832 mr_free(tmp); 817 833 -
branches/3.0/mondo/src/mondorestore/mondo-prep.c
r2984 r2985 568 568 char *bootdevice; 569 569 char *name; 570 char *ver; 570 571 571 572 malloc_string(bootdevice); 572 573 malloc_string(name); 574 malloc_string(ver); 573 575 574 576 // leave straight away if raidlist is initial or has no entries … … 592 594 593 595 // create device list from normal disks followed by spare ones 594 mr_asprintf(&devices, "%s", raidlist->el[i].data_disks.el[0].device); 596 if (raidlist->el[i].data_disks.el[0].device != NULL) { 597 mr_asprintf(&devices, "%s", raidlist->el[i].data_disks.el[0].device); 598 log_msg(4, "Adding device %s to list", raidlist->el[i].data_disks.el[0].device); 599 } else { 600 log_msg(1, "Strange, there are entries but no device"); 601 } 595 602 for (j = 1; j < raidlist->el[i].data_disks.entries; j++) { 596 603 mr_strcat(devices, " %s", raidlist->el[i].data_disks.el[j].device); 604 log_msg(4, "Adding device %s to list", raidlist->el[i].data_disks.el[j].device); 597 605 } 598 606 for (j = 0; j < raidlist->el[i].spare_disks.entries; j++) { 599 607 mr_strcat(devices, " %s", raidlist->el[i].spare_disks.el[j].device); 608 log_msg(4, "Adding spare device %s to list", raidlist->el[i].spare_disks.el[j].device); 600 609 } 610 log_msg(4, "RAID devices: %s", devices); 601 611 // translate RAID level 602 612 if (raidlist->el[i].raid_level == -2) { … … 623 633 strcpy(name,"NONE"); 624 634 } 635 if (read_cfg_var(g_mondo_cfg_file, "bootloader.ver", ver) != 0) { 636 log_msg(2, "No bootloader.ver param in %s conf file\n", g_mondo_cfg_file); 637 strcpy(ver,"NONE"); 638 } 625 639 if (strcmp(name,"GRUB") == 0) { 626 mr_asprintf(&tmp1, "chroot %s grub --version", MNT_RESTORING); 627 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output(tmp1)); 628 mr_free(tmp1); 629 if ((strstr(tmp, "GRUB 0.9") != NULL) && (strcmp(raidlist->el[i].raid_device,device) == 0)) { 640 if ((strstr(ver, "GRUB 0.9") != NULL) && (strcmp(raidlist->el[i].raid_device,device) == 0)) { 630 641 mr_asprintf(&oldmd, "-e 0.90"); 631 642 log_it("Forcing old metadata 0.90 for md on %s for old GRUB", device); … … 641 652 mr_free(device); 642 653 mr_free(name); 654 mr_free(ver); 655 log_msg(4, "RAID oldmd: %s", oldmd); 643 656 644 657 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); 645 658 mr_free(oldmd); 646 659 mr_free(level); 660 log_msg(4, "cmd built: %s", program); 647 661 // Restoring the UUID stored at backup time of present 648 662 for (v = 0; v++ ; v <= raidlist->el[i].additional_vars.entries) { … … 659 673 } 660 674 } 675 log_msg(4, "cmd built: %s", program); 661 676 if (raidlist->el[i].parity != -1) { 662 677 switch(raidlist->el[i].parity) { … … 678 693 } 679 694 } 695 log_msg(4, "cmd built: %s", program); 680 696 if (raidlist->el[i].chunk_size != -1) { 681 697 mr_strcat(program, " --chunk=%d", raidlist->el[i].chunk_size); … … 684 700 mr_strcat(program, " --spare-devices=%d", raidlist->el[i].spare_disks.entries); 685 701 } 702 log_msg(4, "cmd built: %s", program); 686 703 mr_strcat(program, " %s", devices); 687 704 log_msg(2, "RAID device re-created with the following command:\n%s\n", program);
Note:
See TracChangeset
for help on using the changeset viewer.