Changeset 234


Ignore:
Timestamp:
Dec 18, 2005, 12:36:51 AM (13 years ago)
Author:
bcornec
Message:

in PXE mode add 2 switches :
ping=[number of ping before mounting] (Sébastien Aperghis-Tramoni)
ipconf=ipaddr:netmask:broadcast:gw (Bruno Cornec)

Location:
branches/2.05
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.05/mindi/README.pxe

    r204 r234  
    99mondo
    1010        kernel vmlinuz-mondo
    11         initrd initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=36864 rw root=/dev/ram iso_mode acpi=off apm=off devfs=nomount exec-shield=0 pxe [prefix="machine"] ...
     11        initrd initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=36864 rw root=/dev/ram iso_mode acpi=off apm=off devfs=nomount exec-shield=0 pxe [prefix="machine"] [ipconf=(ipadr:netmask:broadcast:gateway|dhcp)] [ping=#] ...
    1212
    1313The initrd and kernel file come rom the first bootable media
     
    2525Without prefix keyword, the name of the images used during archiving with the -p option will be used (they may differ). If -p wasn't used then the name mondorescue-1.iso, ... will be used.
    2626
    27 During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media.
     27During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media. You may alter the IP configuration stored from the original machine by passing the ipconf option describing respectively the IP address, netmask, broadcast and default gateway you want to setup for the machine, separated by ':'. Or alternatively, you may specify the dhcp keyword so that a DhCP request is made to get those information. On some configurations, you may also want to increase the number of ping queries made before the NFS mount, which is of 3 by default, using the ping option and give the number you want.
    2828
    2929Please report any problem around that tool to bcornec@users.berlios.de
    3030
     312005-12-18 new ipconf and ping option
    31322005-12-14 detailed explanations on where to find initrd and kernel
  • branches/2.05/mondo/mondo/common/libmondo-files.c

    r222 r234  
    12431243        fatal_error("Cannot store NFS config");
    12441244    }
     1245    fprintf(fout, "#!/bin/sh\n");
     1246    fprintf(fout, "# number of ping\n");
     1247    fprintf(fout, "ipcount=3\n");
     1248    fprintf(fout, "for i in `cat /proc/cmdline` ; do\n");
     1249    fprintf(fout, "    echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2`\n");
     1250    fprintf(fout, "done\n");
    12451251    fprintf(fout, "ifconfig lo 127.0.0.1  # config loopback\n");
    1246     fprintf(fout, "ifconfig %s %s netmask %s broadcast %s   # config client\n", nfs_dev,
    1247             nfs_client_ipaddr, nfs_client_netmask, nfs_client_broadcast);
    1248     fprintf(fout, "route add default gw %s  # default route\n", nfs_client_defgw);
    1249     fprintf(fout, "ping -c 1 %s # ping server\n", nfs_server_ipaddr);
     1252    fprintf(fout, "ipaddress=%s\n", nfs_client_ipaddr);
     1253    fprintf(fout, "ipnetmask=%s\n", nfs_client_netmask);
     1254    fprintf(fout, "ipbroadcast=%s\n", nfs_client_broadcast);
     1255    fprintf(fout, "ipgateway=%s\n", nfs_client_defgw);
     1256    fprintf(fout, "ipconf=\n");
     1257    fprintf(fout, "for i in `cat /proc/cmdline` ; do\n");
     1258    fprintf(fout, "    echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2`\n");
     1259    fprintf(fout, "done\n");
     1260    fprintf(fout, "if [ \"$ipconf\" = \"dhcp\" ]; then\n");
     1261    fprintf(fout, "    udhcpc -i %s\n", nfs_dev);
     1262    fprintf(fout, "else\n");
     1263    fprintf(fout, "    if [ \"$ipconf\" != \"\" ]; then\n");
     1264    fprintf(fout, "        ipaddress=`echo $ipconf | cut -d: -f1`\n");
     1265    fprintf(fout, "        ipnetmask=`echo $ipconf | cut -d: -f2`\n");
     1266    fprintf(fout, "        ipbroadcast=`echo $ipconf | cut -d: -f3`\n");
     1267    fprintf(fout, "        ipgateway=`echo $ipconf | cut -d: -f4`\n");
     1268    fprintf(fout, "    fi\n");
     1269    fprintf(fout, "    ifconfig %s $ipaddress netmask $ipnetmask broadcast $ipbroadcast\n", nfs_dev);
     1270    fprintf(fout, "    route add default gw $ipgateway\n");
     1271    fprintf(fout, "fi\n");
     1272    fprintf(fout, "ping -c $ipcount %s  # ping server\n", nfs_server_ipaddr);
    12501273    fprintf(fout, "mount -t nfs -o nolock %s /tmp/isodir\n",
    12511274            bkpinfo->nfs_mount);
    1252     fprintf(fout, "exit 0\n");
    12531275    paranoid_fclose(fout);
    12541276    chmod(outfile, 0777);
Note: See TracChangeset for help on using the changeset viewer.