Changeset 1771 in MondoRescue for branches/2.2.5
- Timestamp:
- Nov 6, 2007, 9:13:46 PM (16 years ago)
- Location:
- branches/2.2.5
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.5/mindi/isolinux-H.cfg
r30 r1771 5 5 label RESTORE 6 6 kernel vmlinuz 7 append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=24000 rw root=/dev/ram nuke restore7 append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=24000 rw root=/dev/ram nuke RESTORE 8 8 label expert 9 9 kernel vmlinuz -
branches/2.2.5/mindi/mindi-bkphw
r1764 r1771 53 53 if ($tool =~ /\/conrep$/) { 54 54 $ret = system("(cd $tooldir ; $tool -s -f$bkpdir/conrep.dat)"); 55 print SCRIPT "(cd $tooldir ; $tool - s-f$bkpdir/conrep.dat)");55 print SCRIPT "(cd $tooldir ; $tool -l -f$bkpdir/conrep.dat)"); 56 56 print TOOLS "$tool.xml\n"; 57 57 } 58 58 if ($tool =~ /\/cpqacuxe$/) { 59 59 $ret = system("$tool -c $bkpdir/cpqacuxe.dat"); 60 print SCRIPT "$tool - r $bkpdir/cpqacuxe.dat");60 print SCRIPT "$tool -i $bkpdir/cpqacuxe.dat)"); 61 61 print TOOLS "$tooldir/bld\n"; 62 62 } -
branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools.c
r1746 r1771 525 525 /************************************************************************** 526 526 *END_KILL_PETRIS * 527 **************************************************************************/ 528 529 530 /** 531 * Mount @p device at @p mpt as @p format. 532 * @param device The device (/dev entry) to mount. 533 * @param mpt The directory to mount it on. 534 * @param format The filesystem type of @p device. 535 * @param writeable If TRUE, mount read-write; if FALSE, mount read-only. 536 * @return 0 for success, nonzero for failure. 537 */ 538 int mount_device(char *device, char *mpt, char *format, bool writeable) 539 { 540 int res = 0; 541 542 /** malloc **/ 543 char *tmp, *command, *mountdir, *mountpoint, *additional_parameters; 544 545 assert_string_is_neither_NULL_nor_zerolength(device); 546 assert_string_is_neither_NULL_nor_zerolength(mpt); 547 assert(format != NULL); 548 malloc_string(tmp); 549 malloc_string(command); 550 malloc_string(mountdir); 551 malloc_string(mountpoint); 552 malloc_string(additional_parameters); 553 554 if (!strcmp(mpt, "/1")) { 555 strcpy(mountpoint, "/"); 556 log_msg(3, "Mommm! SME is being a dildo!"); 557 } else { 558 strcpy(mountpoint, mpt); 559 } 560 561 if (!strcmp(mountpoint, "lvm")) { 562 return (0); 563 } 564 if (!strcmp(mountpoint, "image")) { 565 return (0); 566 } 567 sprintf(tmp, "Mounting device %s ", device); 568 log_msg(1, tmp); 569 if (writeable) { 570 strcpy(additional_parameters, "-o rw"); 571 } else { 572 strcpy(additional_parameters, "-o ro"); 573 } 574 if (find_home_of_exe("setfattr")) { 575 strcat(additional_parameters, ",user_xattr"); 576 } 577 if (find_home_of_exe("setfacl")) { 578 strcat(additional_parameters, ",acl"); 579 } 580 581 if (!strcmp(mountpoint, "swap")) { 582 sprintf(command, "swapon %s", device); 583 } else { 584 if (!strcmp(mountpoint, "/")) { 585 strcpy(mountdir, MNT_RESTORING); 586 } else { 587 sprintf(mountdir, "%s%s", MNT_RESTORING, mountpoint); 588 } 589 sprintf(command, "mkdir -p %s", mountdir); 590 run_program_and_log_output(command, FALSE); 591 sprintf(command, "mount -t %s %s %s %s 2>> %s", format, device, 592 additional_parameters, mountdir, MONDO_LOGFILE); 593 log_msg(2, "command='%s'", command); 594 } 595 res = run_program_and_log_output(command, TRUE); 596 if (res && (strstr(command, "xattr") || strstr(command, "acl"))) { 597 log_msg(1, "Re-trying without the fancy extra parameters"); 598 sprintf(command, "mount -t %s %s %s 2>> %s", format, device, 599 mountdir, MONDO_LOGFILE); 600 res = run_program_and_log_output(command, TRUE); 601 } 602 if (res) { 603 log_msg(1, "Unable to mount device %s (type %s) at %s", device, 604 format, mountdir); 605 log_msg(1, "command was '%s'", command); 606 if (!strcmp(mountpoint, "swap")) { 607 log_to_screen(tmp); 608 } else { 609 log_msg(2, "Retrying w/o the '-t' switch"); 610 sprintf(command, "mount %s %s 2>> %s", device, mountdir, 611 MONDO_LOGFILE); 612 log_msg(2, "2nd command = '%s'", command); 613 res = run_program_and_log_output(command, TRUE); 614 if (res == 0) { 615 log_msg(1, 616 "That's OK. I called mount w/o a filesystem type and it worked fine in the end."); 617 } else { 618 log_to_screen(tmp); 619 } 620 } 621 } 622 if (res && !strcmp(mountpoint, "swap")) { 623 log_msg(2, "That's ok. It's just a swap partition."); 624 log_msg(2, "Non-fatal error. Returning 0."); 625 res = 0; 626 } 627 628 paranoid_free(tmp); 629 paranoid_free(command); 630 paranoid_free(mountdir); 631 paranoid_free(mountpoint); 632 paranoid_free(additional_parameters); 633 634 return (res); 635 } 636 637 /************************************************************************** 638 *END_MOUNT_DEVICE * 527 639 **************************************************************************/ 528 640 … … 747 859 /************************************************************************** 748 860 *END_MOUNT_CDROM * 749 **************************************************************************/750 751 752 /**753 * Mount @p device at @p mpt as @p format.754 * @param device The device (/dev entry) to mount.755 * @param mpt The directory to mount it on.756 * @param format The filesystem type of @p device.757 * @param writeable If TRUE, mount read-write; if FALSE, mount read-only.758 * @return 0 for success, nonzero for failure.759 */760 int mount_device(char *device, char *mpt, char *format, bool writeable)761 {762 int res = 0;763 764 /** malloc **/765 char *tmp, *command, *mountdir, *mountpoint, *additional_parameters;766 767 assert_string_is_neither_NULL_nor_zerolength(device);768 assert_string_is_neither_NULL_nor_zerolength(mpt);769 assert(format != NULL);770 malloc_string(tmp);771 malloc_string(command);772 malloc_string(mountdir);773 malloc_string(mountpoint);774 malloc_string(additional_parameters);775 776 if (!strcmp(mpt, "/1")) {777 strcpy(mountpoint, "/");778 log_msg(3, "Mommm! SME is being a dildo!");779 } else {780 strcpy(mountpoint, mpt);781 }782 783 if (!strcmp(mountpoint, "lvm")) {784 return (0);785 }786 if (!strcmp(mountpoint, "image")) {787 return (0);788 }789 sprintf(tmp, "Mounting device %s ", device);790 log_msg(1, tmp);791 if (writeable) {792 strcpy(additional_parameters, "-o rw");793 } else {794 strcpy(additional_parameters, "-o ro");795 }796 if (find_home_of_exe("setfattr")) {797 strcat(additional_parameters, ",user_xattr");798 }799 if (find_home_of_exe("setfacl")) {800 strcat(additional_parameters, ",acl");801 }802 803 if (!strcmp(mountpoint, "swap")) {804 sprintf(command, "swapon %s", device);805 } else {806 if (!strcmp(mountpoint, "/")) {807 strcpy(mountdir, MNT_RESTORING);808 } else {809 sprintf(mountdir, "%s%s", MNT_RESTORING, mountpoint);810 }811 sprintf(command, "mkdir -p %s", mountdir);812 run_program_and_log_output(command, FALSE);813 sprintf(command, "mount -t %s %s %s %s 2>> %s", format, device,814 additional_parameters, mountdir, MONDO_LOGFILE);815 log_msg(2, "command='%s'", command);816 }817 res = run_program_and_log_output(command, TRUE);818 if (res && (strstr(command, "xattr") || strstr(command, "acl"))) {819 log_msg(1, "Re-trying without the fancy extra parameters");820 sprintf(command, "mount -t %s %s %s 2>> %s", format, device,821 mountdir, MONDO_LOGFILE);822 res = run_program_and_log_output(command, TRUE);823 }824 if (res) {825 log_msg(1, "Unable to mount device %s (type %s) at %s", device,826 format, mountdir);827 log_msg(1, "command was '%s'", command);828 if (!strcmp(mountpoint, "swap")) {829 log_to_screen(tmp);830 } else {831 log_msg(2, "Retrying w/o the '-t' switch");832 sprintf(command, "mount %s %s 2>> %s", device, mountdir,833 MONDO_LOGFILE);834 log_msg(2, "2nd command = '%s'", command);835 res = run_program_and_log_output(command, TRUE);836 if (res == 0) {837 log_msg(1,838 "That's OK. I called mount w/o a filesystem type and it worked fine in the end.");839 } else {840 log_to_screen(tmp);841 }842 }843 }844 if (res && !strcmp(mountpoint, "swap")) {845 log_msg(2, "That's ok. It's just a swap partition.");846 log_msg(2, "Non-fatal error. Returning 0.");847 res = 0;848 }849 850 paranoid_free(tmp);851 paranoid_free(command);852 paranoid_free(mountdir);853 paranoid_free(mountpoint);854 paranoid_free(additional_parameters);855 856 return (res);857 }858 859 /**************************************************************************860 *END_MOUNT_DEVICE *861 861 **************************************************************************/ 862 862
Note:
See TracChangeset
for help on using the changeset viewer.