Re: Static ip patch problems

Marty Connor <[email protected]> Wed, 8 Mar 2006 22:15:16 -0500
Newsgroups gmane.network.etherboot.devel
Message-ID <[email protected]>
On Mar 8, 2006, at 8:17 AM, Ricardo Carrillo Cruz wrote:
> Hello to all
> I've been able to run with success several diskless computers with
> thinstation 2.1.3.The dhcp and tftp servers are different
> machines.Theclients get their
> thinstation.nbi image from the tftp server via the
> DEFAULT_BOOTFILE=tftp://mytftpserver/thinstation.nbi, so i didn't  
> need to
> configure the dhcp server any tftp related stuff.
>
> Now,i need to set my clients with static ips.After searching a  
> lot,i found a
> useful patch that David Aubin posted some years ago (thank you very  
> much
> David :P ),so i decided to modify it a little.

Hi there.  Thanks for the information and the patch.

Could you try sending the patches again as an attachment?  They got  
mangled by your mail program (or somewhere along the line), and are a  
little hard to read.

Can you also post a pointer to the original patch from David Aubin?   
I'd enjoy seeing where and when it came to be.

What version of Etherboot are you using, and how was the kernel  
prepared?  Before making suggestions, it would help to know more  
about your environment.  It could be something like not enough memory  
in your workstation, or your kernel being tagged improperly.

I take it that without your patch everything loads fine and all is well?

A few more details please.

Thanks,

Marty

> This is the Config patch:
>
> --- Config.orig 2006-03-07 10:32:43.000000000 +0100
>
> +++ Config 2006-03-07 13:37:42.000000000 +0100
>
> @@ -60,6 +60,8 @@
>
> # Use BOOTP instead of DHCP.
>
> # -DRARP_NOT_BOOTP
>
> # Use RARP instead of BOOTP/DHCP.
>
> +# -DSTATIC_ADDRESS Use static ip insted of dynamic protocol
>
> +# -DSTATIC_CLIENT_IP=\Â"1.2.3.4\"
>
> # -DREQUIRE_VCI_ETHERBOOT
>
> # Require an encapsulated Vendor Class Identifier
>
> # of "Etherboot" in the DHCP reply
>
> @@ -379,10 +381,16 @@
>
> # Disable DHCP support
>
> # CFLAGS+= -DNO_DHCP_SUPPORT
>
> +# Enable static ip
>
> +CFLAGS+= -DSTATIC_ADDRESS
>
> +
>
> +#Specify the client IP
>
> +CFLAGS+= -DSTATIC_CLIENT_IP=\"10.205.99.74\"
>
> +
>
> # Specify a default bootfile to be used if the DHCP server does not
>
> # provide the information. If you do not specify this option, then
>
> # DHCP offers that do not contain bootfiles will be ignored.
>
> -# CFLAGS+= -DDEFAULT_BOOTFILE=\"tftp:///tftpboot/kernel\"
>
> +CFLAGS+= -DDEFAULT_BOOTFILE=\"tftp://10.205.99.73/thinstation.nbi\"
>
> # Limit the delay on packet loss/congestion to a more bearable  
> value. See
>
> # description above. If unset, do not limit the delay between resend.
>
> @@ -439,12 +447,12 @@
>
> # CFLAGS+= -DNORELOCATE
>
> # you should normally not need to change these
>
> -HOST_CC= gcc
>
> +HOST_CC= gcc-3.4
>
> CPP= gcc -E -Wp,-Wall
>
> RM= rm -f
>
> TOUCH= touch
>
> PERL= /usr/bin/perl
>
> -CC= gcc
>
> +CC= gcc-3.4
>
> AS= as
>
> LD= ld
>
> SIZE= size
> And this is the nic.c diff:
>
>
> --- nic_orig.c 2006-03-07 10:38:52.000000000 +0100
>
> +++ nic.c 2006-03-07 13:35:47.000000000 +0100
>
> @@ -270,8 +270,12 @@
>
> #ifdef RARP_NOT_BOOTP
>
> static int rarp(void);
>
> #else
>
> +#ifdef STATIC_ADDRESS
>
> +static void static_client_ip(void);
>
> +#else
>
> static int bootp(void);
>
> #endif
>
> +#endif
>
> static unsigned short tcpudpchksum(struct iphdr *ip);
>
>  @@ -314,6 +318,9 @@
>
> {
>
> int server_found;
>
> /* Find a server to get BOOTP reply from */
>
> +#ifdef STATIC_ADDRESS
>
> + printf("Booting with static ip address...");
>
> +#else
>
> #ifdef RARP_NOT_BOOTP
>
> printf("Searching for server (RARP)...");
>
> #else
>
> @@ -323,12 +330,17 @@
>
> printf("Searching for server (BOOTP)...");
>
> #endif
>
> #endif
>
> -
>
> +#endif
>
> +
>
> +#ifdef STATIC_ADDRESS
>
> + static_client_ip();
>
> +#else
>
> #ifdef RARP_NOT_BOOTP
>
> server_found = rarp();
>
> #else
>
> server_found = bootp();
>
> #endif
>
> +#endif
>
> if (!server_found) {
>
> printf("No Server found\n");
>
> longjmp(restart_etherboot, -1);
>
> @@ -788,7 +800,17 @@
>
> }
>
> #endif /* DOWNLOAD_PROTO_TFTP */
>
> +#ifdef STATIC_ADDRESS
>
> +void static_client_ip(void)
>
> +{
>
> + in_addr client_addr;
>
> + inet_aton(STATIC_CLIENT_IP,&client_addr);
>
> + memcpy(&arptable[ARP_CLIENT].ipaddr,&client_addr.s_addr,sizeof 
> (in_addr));
>
> +}
>
> +
>
> +#else
>
> #ifdef RARP_NOT_BOOTP
>
> +
>
> / 
> ********************************************************************** 
> ****
>
> RARP - Get my IP address and load information
>
> ********************************************************************** 
> ****/
>
> @@ -851,7 +873,6 @@
>
> }
>
> #else
>
> -
>
> / 
> ********************************************************************** 
> ****
>
> BOOTP - Get my IP address and load information
>
> ********************************************************************** 
> ****/
>
> @@ -1049,6 +1070,8 @@
>
> }
>
> #endif /* RARP_NOT_BOOTP */
>
> +#endif
>
> +
>
> static uint16_t tcpudpchksum(struct iphdr *ip)
>
> {
>
> struct udp_pseudo_hdr pseudo;
> Everything work well,it boots ok,it begins to download the  
> image,but after
> finishing the nbi image transfer,it gives me this error:
>
> Issuing RESET:
> mknbi-1.4.4/first32.c (ELF) (GPL)
> Bad argument
> Secondary program returned -1
> <abort>
>
> Can anybody help me?
>
> Thx in advance



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642