Changeset 1451 in MondoRescue for branches/2.2.4/mondo/src/mondorestore/mondo-rstr-tools.c
- Timestamp:
- May 20, 2007, 10:53:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.4/mondo/src/mondorestore/mondo-rstr-tools.c
r1406 r1451 846 846 847 847 if (!strcmp(mpt, "/1")) { 848 strcpy(mountpoint, "/");849 log_msg(3, "Mommm! SME is being a dildo!");848 strcpy(mountpoint, "/"); 849 log_msg(3, "Mommm! SME is being a dildo!"); 850 850 } else { 851 strcpy(mountpoint, mpt);851 strcpy(mountpoint, mpt); 852 852 } 853 853 854 854 if (!strcmp(mountpoint, "lvm")) { 855 return (0);855 return (0); 856 856 } 857 857 if (!strcmp(mountpoint, "image")) { 858 return (0);858 return (0); 859 859 } 860 860 sprintf(tmp, "Mounting device %s ", device); 861 861 log_msg(1, tmp); 862 862 if (writeable) { 863 strcpy(additional_parameters, "-o rw");863 strcpy(additional_parameters, "-o rw"); 864 864 } else { 865 strcpy(additional_parameters, "-o ro");865 strcpy(additional_parameters, "-o ro"); 866 866 } 867 867 if (find_home_of_exe("setfattr")) { 868 strcat(additional_parameters, ",user_xattr");868 strcat(additional_parameters, ",user_xattr"); 869 869 } 870 870 if (find_home_of_exe("setfacl")) { 871 strcat(additional_parameters, ",acl");871 strcat(additional_parameters, ",acl"); 872 872 } 873 873 874 874 if (!strcmp(mountpoint, "swap")) { 875 sprintf(command, "swapon %s", device);875 sprintf(command, "swapon %s", device); 876 876 } else { 877 877 if (!strcmp(mountpoint, "/")) { … … 888 888 res = run_program_and_log_output(command, TRUE); 889 889 if (res && (strstr(command, "xattr") || strstr(command, "acl"))) { 890 log_msg(1, "Re-trying without the fancy extra parameters");891 sprintf(command, "mount -t %s %s %s 2>> %s", format, device,890 log_msg(1, "Re-trying without the fancy extra parameters"); 891 sprintf(command, "mount -t %s %s %s 2>> %s", format, device, 892 892 mountdir, MONDO_LOGFILE); 893 res = run_program_and_log_output(command, TRUE);893 res = run_program_and_log_output(command, TRUE); 894 894 } 895 895 if (res) { 896 log_msg(1, "Unable to mount device %s (type %s) at %s", device,896 log_msg(1, "Unable to mount device %s (type %s) at %s", device, 897 897 format, mountdir); 898 log_msg(1, "command was '%s'", command);899 if (!strcmp(mountpoint, "swap")) {900 log_to_screen(tmp);901 } else {902 log_msg(2, "Retrying w/o the '-t' switch");903 sprintf(command, "mount %s %s 2>> %s", device, mountdir,898 log_msg(1, "command was '%s'", command); 899 if (!strcmp(mountpoint, "swap")) { 900 log_to_screen(tmp); 901 } else { 902 log_msg(2, "Retrying w/o the '-t' switch"); 903 sprintf(command, "mount %s %s 2>> %s", device, mountdir, 904 904 MONDO_LOGFILE); 905 log_msg(2, "2nd command = '%s'", command);906 res = run_program_and_log_output(command, TRUE);907 if (res == 0) {908 log_msg(1,905 log_msg(2, "2nd command = '%s'", command); 906 res = run_program_and_log_output(command, TRUE); 907 if (res == 0) { 908 log_msg(1, 909 909 "That's OK. I called mount w/o a filesystem type and it worked fine in the end."); 910 } else {911 log_to_screen(tmp);912 }913 }910 } else { 911 log_to_screen(tmp); 912 } 913 } 914 914 } 915 915 if (res && !strcmp(mountpoint, "swap")) { 916 log_msg(2, "That's ok. It's just a swap partition.");917 log_msg(2, "Non-fatal error. Returning 0.");918 res = 0;916 log_msg(2, "That's ok. It's just a swap partition."); 917 log_msg(2, "Non-fatal error. Returning 0."); 918 res = 0; 919 919 } 920 920
Note:
See TracChangeset
for help on using the changeset viewer.