Changeset 1170 in MondoRescue for branches/stable/mondo
- Timestamp:
- Feb 15, 2007, 1:07:22 AM (18 years ago)
- Location:
- branches/stable/mondo/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/mondoarchive/Makefile.am
r1054 r1170 4 4 ## Process with Automake to generate Makefile.in 5 5 ## 6 AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/src/include 6 AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/src/include -I${top_builddir}/src/common 7 7 8 8 ## Headers -
branches/stable/mondo/src/mondorestore/Makefile.am
r1054 r1170 4 4 ## Process with Automake to generate Makefile.in 5 5 ## 6 AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/src/include 6 AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/src/include -I${top_builddir}/src/common 7 7 8 8 ## Headers -
branches/stable/mondo/src/mondorestore/mondo-prep.c
r1124 r1170 588 588 } 589 589 // create device list from normal disks followed by spare ones 590 asprintf(&devices, raidlist->el[i].data_disks.el[0].device);590 mr_asprintf(&devices, raidlist->el[i].data_disks.el[0].device); 591 591 for (j = 1; j < raidlist->el[i].data_disks.entries; j++) { 592 asprintf(&strtmp, "%s", devices);592 mr_asprintf(&strtmp, "%s", devices); 593 593 mr_free(devices); 594 asprintf(&devices, "%s %s", strtmp,594 mr_asprintf(&devices, "%s %s", strtmp, 595 595 raidlist->el[i].data_disks.el[j].device); 596 596 mr_free(strtmp); 597 597 } 598 598 for (j = 0; j < raidlist->el[i].spare_disks.entries; j++) { 599 asprintf(&strtmp, "%s", devices);599 mr_asprintf(&strtmp, "%s", devices); 600 600 mr_free(devices); 601 asprintf(&devices, "%s %s", strtmp,601 mr_asprintf(&devices, "%s %s", strtmp, 602 602 raidlist->el[i].spare_disks.el[j].device); 603 603 mr_free(strtmp); … … 605 605 // translate RAID level 606 606 if (raidlist->el[i].raid_level == -2) { 607 asprintf(&level, "multipath");607 mr_asprintf(&level, "multipath"); 608 608 } else if (raidlist->el[i].raid_level == -1) { 609 asprintf(&level, "linear");609 mr_asprintf(&level, "linear"); 610 610 } else { 611 asprintf(&level, "raid%d", raidlist->el[i].raid_level);611 mr_asprintf(&level, "raid%d", raidlist->el[i].raid_level); 612 612 } 613 613 // create RAID device: … … 616 616 // - faulty devices ignored 617 617 // - persistent superblock always used as this is recommended 618 asprintf(&program,618 mr_asprintf(&program, 619 619 "mdadm --create --force --run --auto=yes %s --level=%s --raid-devices=%d", 620 620 raidlist->el[i].raid_device, level, 621 621 raidlist->el[i].data_disks.entries); 622 622 if (raidlist->el[i].parity != -1) { 623 asprintf(&strtmp, "%s", program);623 mr_asprintf(&strtmp, "%s", program); 624 624 mr_free(program); 625 625 switch(raidlist->el[i].parity) { 626 626 case 0: 627 asprintf(&program, "%s --parity=%s", strtmp, "la");627 mr_asprintf(&program, "%s --parity=%s", strtmp, "la"); 628 628 break; 629 629 case 1: 630 asprintf(&program, "%s --parity=%s", strtmp, "ra");630 mr_asprintf(&program, "%s --parity=%s", strtmp, "ra"); 631 631 break; 632 632 case 2: 633 asprintf(&program, "%s --parity=%s", strtmp, "ls");633 mr_asprintf(&program, "%s --parity=%s", strtmp, "ls"); 634 634 break; 635 635 case 3: 636 asprintf(&program, "%s --parity=%s", strtmp, "rs");636 mr_asprintf(&program, "%s --parity=%s", strtmp, "rs"); 637 637 break; 638 638 default: … … 643 643 } 644 644 if (raidlist->el[i].chunk_size != -1) { 645 asprintf(&strtmp, "%s", program);645 mr_asprintf(&strtmp, "%s", program); 646 646 mr_free(program); 647 asprintf(&program, "%s --chunk=%d", strtmp, raidlist->el[i].chunk_size);647 mr_asprintf(&program, "%s --chunk=%d", strtmp, raidlist->el[i].chunk_size); 648 648 mr_free(strtmp); 649 649 } 650 650 if (raidlist->el[i].spare_disks.entries > 0) { 651 asprintf(&strtmp, "%s", program);651 mr_asprintf(&strtmp, "%s", program); 652 652 mr_free(program); 653 asprintf(&program, "%s --spare-devices=%d", strtmp,653 mr_asprintf(&program, "%s --spare-devices=%d", strtmp, 654 654 raidlist->el[i].spare_disks.entries); 655 655 mr_free(strtmp); 656 656 } 657 asprintf(&strtmp, "%s", program);657 mr_asprintf(&strtmp, "%s", program); 658 658 mr_free(program); 659 asprintf(&program, "%s %s", strtmp, devices);659 mr_asprintf(&program, "%s %s", strtmp, devices); 660 660 mr_free(strtmp); 661 661 res = run_program_and_log_output(program, 1); -
branches/stable/mondo/src/mondorestore/mondo-restore.c
r1168 r1170 1580 1580 restore_a_tarball_from_CD(char *tarball_fname, 1581 1581 long current_tarball_number, 1582 struct s_node *filelist, struct s_bkpinfo * )1582 struct s_node *filelist, struct s_bkpinfo *bkpinfo) 1583 1583 { 1584 1584 int retval = 0;
Note:
See TracChangeset
for help on using the changeset viewer.