[U-Boot-Users] Can DHCP be used for TFTP booting?

Ben Warren biggerbadderben at gmail.com
Wed Jan 16 05:39:34 CET 2008


hce wrote:
> On Jan 16, 2008 9:30 AM, Ben Warren <biggerbadderben at gmail.com> wrote:
>   
>> hce wrote:
>>     
>>> Hi,
>>>
>>> I am currently using a fixed tftp server and client IP address for
>>> booting from tftp, it works fine. I am wondering if the DHCP can be
>>> used or not for tftp booting, either for both TFTP server and client
>>> IP address or just for client IP address? If so, could you please give
>>> an example of how to config DHCP parameters in CONFIG_BOOTARGS and
>>> CONFIG_BOOTCOMMAND?
>>>
>>>       
>> DHCP can be used for obtaining an IP address and also booting. My advice
>> is to play with it yourself. Make sure you include CONFIG_CMD_DHCP, and
>> then try "help dhcp". Sorry for the lack of hand holding, but it's the
>> best way for you to learn. If you're really stuck, ask again.
>>     
>
> I've tried to run "help dhcp", it printed out "dhcp". Nothing else I
> could see. I've searched Internet to try to find a format of
> CONFIG_CMD_DHCP. Yes, I am very much stuck at the moment. Could you
> please point me a reference manual for DHCP boot set up as well
> relavent to following issues?
>
> What I can think of there may be two issues need to be clarified:
>
> (1) How to set following parameters:
>
> #define CONFIG_BOOTARGS "..... ip=dhcp?? ..."
>   
This #define fills in the 'bootargs' environment variable if it is not 
set.  Read the following file found in Linux kernel source: 
Documentation/nfsroot.txt.  I think "ip=dhcp" is right, but don't quote 
me on that...  You can change the value of 'bootargs' at runtime using 
'setenv' and save using 'save'.
> #define CONFIG_BOOTCOMMAND "setenv ipaddr dhcp ???..."
>   
This #define fills in the 'bootcmd' environment variable if it is not 
set.  This is what is run when the countdown timer runs out.  You can of 
course change this using 'setenv' and save it using 'save'
> #define CONFIG_CMD_DHCP "dhcp ???"
>   
This is just a flag telling U-boot to include the 'dhcp' command.  The 
value is immaterial.
> (2) How to set DHCP for /tftpboot in /etc/exports?
>
>   
Huh?  That's not how you configure a TFTP server, only NFS exports.
> All above set up are specific IP addresses currently (CONFIG_CMD_DHCP
> is not set yet), I have no idea how the specific IP addresses can be
> replaced by DHCP?
>
>   
Please have a look in the U-boot source file net/bootp.c.  It may give 
you some insight into which environment variables are used and how.
> BTW, I am running uboot on ARM 9 processor, booting from flash.
>
> Thank you.
>
> Kind Regards,
>
> Jim
>   
>> regards,
>> Ben
>>
>>     

Hope this helps a little bit.

regards,
Ben




More information about the U-Boot mailing list