Changeset 2937 in MondoRescue for branches/3.1/mondo/src/common/libmondo-files.c
- Timestamp:
- Jan 28, 2012, 1:51:28 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mondo/src/common/libmondo-files.c
r2850 r2937 904 904 if (res) { 905 905 log_to_screen("Please install '%s'. I cannot find it on your system.", fname); 906 log_to_screen("There may be hyperlink at http://www.mondorescue. comwhich");906 log_to_screen("There may be hyperlink at http://www.mondorescue.org which"); 907 907 log_to_screen("will take you to the relevant (missing) package."); 908 908 return (1); … … 1063 1063 /*@ buffers ******** */ 1064 1064 char *netfs_dev = NULL; 1065 char * mac_addr = NULL;1065 char *netfs_client_hwaddr = NULL; 1066 1066 char *netfs_mount = NULL; 1067 1067 char *netfs_client_ipaddr = NULL; … … 1127 1127 if (!strncmp(netfs_dev, "bond", 4) || !strncmp(netfs_dev, "alb", 3) || !strncmp(netfs_dev, "aft", 3)) { 1128 1128 log_to_screen("Found bonding device %s; looking for corresponding ethN slave device\n", netfs_dev); 1129 mr_asprintf(command, "%s", "ifconfig %s | awk '{print $5}' | head -n1", netfs_dev); 1130 mac_addr = call_program_and_get_last_line_of_output(command,TRUE); 1129 1130 mr_asprintf(command, "ifconfig %s | awk '{print $5}' | head -n1", netfs_dev); 1131 netfs_client_hwaddr = call_program_and_get_last_line_of_output(command,TRUE); 1131 1132 mr_free(command); 1132 1133 1133 mr_asprintf(command, "ifconfig | grep -E '%s' | grep -v '%s' | head -n1 | cut -d' ' -f1", mac_addr,netfs_dev); 1134 mr_free(mac_addr); 1134 mr_asprintf(command, "ifconfig | grep -E '%s' | grep -v '%s' | head -n1 | cut -d' ' -f1", netfs_client_hwaddr, netfs_dev); 1135 1135 mr_free(netfs_dev); 1136 1136 … … 1151 1151 mr_free(netfs_mount); 1152 1152 1153 mr_asprintf(tmp, "%s/NETFS-SERVER-PATH", bkpinfo->tmpdir);1154 write_one_liner_data_file(tmp, bkpinfo->netfs_remote_dir);1155 mr_free(tmp);1156 1157 1153 mr_asprintf(tmp, "%s/NETFS-CLIENT-IPADDR", bkpinfo->tmpdir); 1158 1154 write_one_liner_data_file(tmp, netfs_client_ipaddr); 1155 mr_free(tmp); 1156 1157 mr_asprintf(tmp, "%s/NETFS-CLIENT-HWADDR", bkpinfo->tmpdir); 1158 write_one_liner_data_file(tmp, netfs_client_hwaddr); 1159 1159 mr_free(tmp); 1160 1160 … … 1306 1306 } 1307 1307 1308 1309 /**1310 * Create a small script that mounts /boot, calls @c grub-install, and syncs the disks.1311 * @param outfile Where to put the script.1312 * @return 0 for success, 1 for failure.1313 */1314 int make_grub_install_scriptlet(char *outfile)1315 {1316 FILE *fout;1317 char *tmp = NULL;1318 int retval = 0;1319 1320 if ((fout = fopen(outfile, "w"))) {1321 fprintf(fout,1322 "#!/bin/sh\n\nmount /boot > /dev/null 2> /dev/null\ngrub-install $@\nres=$?\nsync;sync;sync\nexit $res\n");1323 paranoid_fclose(fout);1324 log_msg(2, "Created %s", outfile);1325 mr_asprintf(tmp, "chmod +x %s", outfile);1326 paranoid_system(tmp);1327 mr_free(tmp);1328 retval = 0;1329 } else {1330 retval = 1;1331 }1332 return (retval);1333 }1334 1335 1308 /* @} - end fileGroup */
Note:
See TracChangeset
for help on using the changeset viewer.