Changeset 2296 in MondoRescue for branches/2.2.10/mondo/src/mondorestore/mondo-prep.c
- Timestamp:
- Jul 23, 2009, 2:53:30 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/mondorestore/mondo-prep.c
r2291 r2296 79 79 make_list_of_drives_in_mountlist(mountlist, drivelist); 80 80 for (lino = 0; lino < drivelist->entries; lino++) { 81 mr_asprintf(&command, 82 "dd if=%s bs=512 count=1 2> /dev/null | grep \"%s\"", 83 drivelist->el[lino].device, MONDO_WAS_HERE); 81 mr_asprintf(&command, "dd if=%s bs=512 count=1 2> /dev/null | grep \"%s\"", drivelist->el[lino].device, MONDO_WAS_HERE); 84 82 res = run_program_and_log_output(command, 1); 85 83 mr_free(command); … … 260 258 strcpy(vgremove_sz, "vgremove"); 261 259 } 262 mr_asprintf(&tmp1, 263 "for i in `%s | cut -d\"'\" -f2 | sort -r` ; do echo \"Shutting down lv $i\" >> %s ; %s -f $i; done", lvscan_sz, MONDO_LOGFILE, lvremove_sz); 260 mr_asprintf(&tmp1, "for i in `%s | cut -d\"'\" -f2 | sort -r` ; do echo \"Shutting down lv $i\" >> %s ; %s -f $i; done", lvscan_sz, MONDO_LOGFILE, lvremove_sz); 264 261 run_program_and_log_output(tmp1, 5); 265 262 mr_free(tmp1); … … 521 518 new_mountlist->entries++; 522 519 } else { 523 mr_asprintf(&tmp, 524 "Not adding %s to mountlist: it's already there", 525 p); 520 mr_asprintf(&tmp, "Not adding %s to mountlist: it's already there", p); 526 521 log_it(tmp); 527 522 mr_free(tmp); … … 647 642 mr_asprintf(&strtmp, "%s", program); 648 643 paranoid_free(program); 649 mr_asprintf(&program, "%s --spare-devices=%d", strtmp, 650 raidlist->el[i].spare_disks.entries); 644 mr_asprintf(&program, "%s --spare-devices=%d", strtmp, raidlist->el[i].spare_disks.entries); 651 645 paranoid_free(strtmp); 652 646 } … … 747 741 748 742 /* format raid partition */ 749 mr_asprintf(&program, 750 "for plex in `vinum lv -r %s | grep '^P' | tr '\t' ' ' | tr -s ' ' | cut -d' ' -f2`; do echo $plex; done > /tmp/plexes", basename(device)); 743 mr_asprintf(&program, "for plex in `vinum lv -r %s | grep '^P' | tr '\t' ' ' | tr -s ' ' | cut -d' ' -f2`; do echo $plex; done > /tmp/plexes", basename(device)); 751 744 system(program); 752 745 if (g_fprep) { … … 914 907 915 908 assert(mountlist != NULL); 916 mr_asprintf(&tmp, "format_everything (mountlist, interactively = %s", 917 (interactively) ? "true" : "false"); 909 mr_asprintf(&tmp, "format_everything (mountlist, interactively = %s", (interactively) ? "true" : "false"); 918 910 log_it(tmp); 919 911 mr_free(tmp); … … 943 935 if (interactively) { 944 936 // ask user if we should format the current device 945 mr_asprintf(&tmp, "Shall I format %s (%s) ?", me->device, 946 me->mountpoint); 937 mr_asprintf(&tmp, "Shall I format %s (%s) ?", me->device, me->mountpoint); 947 938 do_it = ask_me_yes_or_no(tmp); 948 939 mr_free(tmp); … … 1425 1416 mr_free(command); 1426 1417 1427 mr_asprintf(&command, "disklabel -R %s /tmp/disklabel", 1428 canonical_name(drivename)); 1418 mr_asprintf(&command, "disklabel -R %s /tmp/disklabel", canonical_name(drivename)); 1429 1419 retval += run_program_and_log_output(command, TRUE); 1430 1420 mr_free(command); … … 1571 1561 file = open(drivename, O_WRONLY); 1572 1562 if (file != -1) { 1573 mr_asprintf(&tmp, 1574 "Warning - unable to open %s for wiping it's partition table", 1575 drivename); 1563 mr_asprintf(&tmp, "Warning - unable to open %s for wiping it's partition table", drivename); 1576 1564 log_to_screen(tmp); 1577 1565 mr_free(tmp); … … 1580 1568 for (i = 0; i < 512; i++) { 1581 1569 if (!write(file, "\0", 1)) { 1582 mr_asprintf(&tmp, "Warning - unable to write to %s", 1583 drivename); 1570 mr_asprintf(&tmp, "Warning - unable to write to %s", drivename); 1584 1571 log_to_screen(tmp); 1585 1572 mr_free(tmp); … … 1642 1629 if (pout_to_fdisk) { 1643 1630 // mark relevant partition as bootable 1644 mr_asprintf(&tmp, "a\n%s\n", 1645 call_program_and_get_last_line_of_output 1646 ("make-me-bootable /tmp/mountlist.txt dummy")); 1631 mr_asprintf(&tmp, "a\n%s\n", call_program_and_get_last_line_of_output("make-me-bootable /tmp/mountlist.txt dummy")); 1647 1632 fput_string_one_char_at_a_time(pout_to_fdisk, tmp); 1648 1633 mr_free(tmp); … … 1739 1724 1740 1725 if (is_this_device_mounted(partition_name)) { 1741 mr_asprintf(&tmp, "%s is mounted, and should not be partitioned", 1742 partition_name); 1726 mr_asprintf(&tmp, "%s is mounted, and should not be partitioned", partition_name); 1743 1727 log_to_screen(tmp); 1744 1728 mr_free(tmp); … … 2050 2034 } else { 2051 2035 /* probably an image */ 2052 mr_asprintf(&tmp, 2053 "Unknown format ('%s') - using supplied string anyway", 2054 format); 2036 mr_asprintf(&tmp, "Unknown format ('%s') - using supplied string anyway", format); 2055 2037 mvaddstr_and_log_it(g_currentY++, 0, tmp); 2056 2038 mr_free(tmp);
Note:
See TracChangeset
for help on using the changeset viewer.