Changeset 764 in MondoRescue for trunk/mondo/mondo
- Timestamp:
- Aug 8, 2006, 12:34:37 AM (18 years ago)
- Location:
- trunk/mondo/mondo
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/Makefile.am
r729 r764 4 4 pkgdata_DATA = do-not-compress-these 5 5 scriptdir = $(pkgdatadir) 6 script_DATA = autorun 7 8 install-data-hook: 9 @for prog in $(script_DATA); do \ 10 chmod +x $(scriptdir)/$$prog; \ 11 done 6 script_SCRIPTS = autorun -
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); -
trunk/mondo/mondo/mondorestore/mondo-prep.c
r729 r764 2190 2190 #else 2191 2191 asprintf(&program, "raidstart %s", raid_device); 2192 // sprintf (program, "raidstart " RAID_DEVICE_STUB "*");2193 2192 #endif 2194 2193 log_msg(1, "program = %s", program); -
trunk/mondo/mondo/mondorestore/mondo-rstr-newt.c
r729 r764 883 883 static int lines_in_flist_window = 0; 884 884 static int depth = 0; 885 int i = 0; 885 886 /** long **************************************************************/ 887 long i = 0; 886 888 887 889 /** structures *******************************************************/ … … 1363 1365 paranoid_free(size_str); 1364 1366 1365 newtListboxSetEntry(listbox, ( int) keylist[currline],1367 newtListboxSetEntry(listbox, (long) keylist[currline], 1366 1368 mountlist_entry_to_string(mountlist, currline)); 1367 1369 /* if new /dev/md RAID device then do funky stuff */ … … 2489 2491 { 2490 2492 2491 /** int*************************************************************/2492 inti = 0;2493 /** long **************************************************************/ 2494 long i = 0; 2493 2495 2494 2496 assert(disklist != NULL); … … 2521 2523 { 2522 2524 2523 /** int**************************************************************/2524 inti = 0;2525 /** long **************************************************************/ 2526 long i = 0; 2525 2527 2526 2528 assert(mountlist != NULL); … … 2554 2556 { 2555 2557 2556 /** int **************************************************************/2557 inti = 0;2558 /** long *************************************************************/ 2559 long i = 0; 2558 2560 2559 2561 /** buffers **********************************************************/ … … 2590 2592 void *keylist[], newtComponent listbox) 2591 2593 { 2592 /** int *************************************************************/2593 inti = 0;2594 /** long ************************************************************/ 2595 long i = 0; 2594 2596 2595 2597 /** buffers *********************************************************/ -
trunk/mondo/mondo/mondorestore/mondo-rstr-tools.c
r729 r764 2155 2155 asprintf(&command, "mount /dev/fd0u1722 %s", mountpt); 2156 2156 asprintf(&tmp, 2157 "(sleep 15; kill `ps ax| grep \"%s\" | cut -d' ' -f1` 2> /dev/null) &",2157 "(sleep 15; kill `ps | grep \"%s\" | cut -d' ' -f1` 2> /dev/null) &", 2158 2158 command); 2159 2159 log_msg(1, "tmp = '%s'", tmp);
Note:
See TracChangeset
for help on using the changeset viewer.