Changeset 764 in MondoRescue for trunk/mondo/mondo/common
- Timestamp:
- Aug 8, 2006, 12:34:37 AM (18 years ago)
- Location:
- trunk/mondo/mondo/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/common/libmondo-files.c
r689 r764 1058 1058 1059 1059 /*@ buffers ******** */ 1060 char *outfile = NULL;1061 1060 char *nfs_dev = NULL; 1062 1061 char *nfs_mount = NULL; … … 1071 1070 /*@ pointers ***** */ 1072 1071 char *p; 1073 FILE *fout;1074 1075 1076 1072 1077 1073 log_it("Storing NFS configuration"); … … 1123 1119 ("Unable to find ethN (eth0, eth1, ...) adapter via NFS mount you specified."); 1124 1120 } 1125 asprintf(&outfile, "%s/start-nfs", bkpinfo->tmpdir);1126 asprintf(&tmp, "outfile = %s", outfile);1127 log_it(tmp);1128 paranoid_free(tmp);1129 1130 if (!(fout = fopen(outfile, "w"))) {1131 fatal_error("Cannot store NFS config");1132 }1133 fprintf(fout, "#!/bin/sh\n");1134 fprintf(fout, "# number of ping\n");1135 fprintf(fout, "ipcount=3\n");1136 fprintf(fout, "for i in `cat /proc/cmdline` ; do\n");1137 fprintf(fout, " echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2`\n");1138 fprintf(fout, "done\n");1139 fprintf(fout, "ifconfig lo 127.0.0.1 # config loopback\n");1140 fprintf(fout, "ipdev=%s\n", nfs_dev);1141 fprintf(fout, "ipaddress=%s\n", nfs_client_ipaddr);1142 fprintf(fout, "ipnetmask=%s\n", nfs_client_netmask);1143 fprintf(fout, "ipbroadcast=%s\n", nfs_client_broadcast);1144 fprintf(fout, "ipgateway=%s\n", nfs_client_defgw);1145 fprintf(fout, "ipconf=\n");1146 fprintf(fout, "nfsmount=%s\n", bkpinfo->nfs_mount);1147 fprintf(fout, "for i in `cat /proc/cmdline` ; do\n");1148 fprintf(fout, " echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2`\n");1149 fprintf(fout, " echo $i | grep -qi nfsmount= && nfsmount=`echo $i | cut -d= -f2`\n");1150 fprintf(fout, "done\n");1151 fprintf(fout, "nfs_server_ipaddr=`echo $nfsmount | cut -d: -f1`\n");1152 fprintf(fout, "echo \"$ipconf\" | grep -q \"dhcp\"\n");1153 fprintf(fout, "if [ $? -eq 0 ]; then\n");1154 fprintf(fout, " ipdev=`echo $ipconf | cut -d: -f1`\n");1155 fprintf(fout, " echo \"Making DHCP request on $ipdev\"\n");1156 fprintf(fout, " udhcpc -i $ipdev\n");1157 fprintf(fout, "else\n");1158 fprintf(fout, " if [ \"$ipconf\" != \"\" ]; then\n");1159 fprintf(fout, " ipdev=`echo $ipconf | cut -d: -f1`\n");1160 fprintf(fout, " ipaddress=`echo $ipconf | cut -d: -f2`\n");1161 fprintf(fout, " ipnetmask=`echo $ipconf | cut -d: -f3`\n");1162 fprintf(fout, " ipbroadcast=`echo $ipconf | cut -d: -f4`\n");1163 fprintf(fout, " ipgateway=`echo $ipconf | cut -d: -f5`\n");1164 fprintf(fout, " fi\n");1165 fprintf(fout, " ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast $ipbroadcast\n");1166 fprintf(fout, " route add default gw $ipgateway\n");1167 fprintf(fout, "fi\n");1168 fprintf(fout, "ping -c $ipcount $nfs_server_ipaddr # ping server\n");1169 fprintf(fout, "mount -t nfs -o nolock $nfsmount /tmp/isodir\n");1170 paranoid_fclose(fout);1171 chmod(outfile, 0777);1172 1121 make_hole_for_dir("/var/cache/mondo-archive"); 1173 1174 // paranoid_system ("mkdir -p /var/cache/mondo-archive 2> /dev/null");1175 1176 asprintf(&tmp, "cp -f %s /var/cache/mondo-archive", outfile);1177 paranoid_free(outfile);1178 1179 run_program_and_log_output(tmp, FALSE);1180 paranoid_free(tmp);1181 1122 1182 1123 asprintf(&tmp, "%s/NFS-DEV", bkpinfo->tmpdir); -
trunk/mondo/mondo/common/newt-specific.c
r688 r764 1457 1457 1458 1458 /*@ int ************************************************************* */ 1459 int i = 0;1460 1459 int currline = 0; 1461 1460 int finished = FALSE; 1461 1462 /*@ long ************************************************************ */ 1463 long i = 0; 1462 1464 long lng = 0; 1463 1465 … … 1504 1506 } 1505 1507 asprintf(&differ_sz, 1506 _(" % d files differ. Hit 'Select' to pick a file. Hit 'Close' to quit the list."),1508 _(" %ld files differ. Hit 'Select' to pick a file. Hit 'Close' to quit the list."), 1507 1509 i); 1508 1510 newtPushHelpLine(differ_sz);
Note:
See TracChangeset
for help on using the changeset viewer.