2009-09-19 01:42:09     hostname is always 'blackfin' in ucLinux instead of u-boot env variable.

Document created by Aaronwu Employee on Sep 24, 2013
Version 1Show Document
  • View in full screen mode

2009-09-19 01:42:09     hostname is always 'blackfin' in ucLinux instead of u-boot env variable.

Dave Henning (UNITED STATES)

Message: 80145   

 

Hello,

 

I am having trouble carrying my hostname from u-boot into uClinux.  I have a pretty standard u-boot setup (shown below).  I set the hostname variable to 'sru101'.  Then I use 'run addip' to pass that hostname variable into uClinux when I do a 'run ramboot'.  However, once my uClinux image is running, hostname returns 'blackfin' in all cases.

 

I suspect I am missing something obvious to everyone but myself.

 

Thanks,

 

Dave ...

 

bfin> printenv

bootdelay=5

baudrate=115200

loads_echo=1

autoload=no

rootpath=/romfs

loadaddr=0x1000000

ubootfile=u-boot.ldr

update=tftp $(loadaddr) $(ubootfile);protect off 0x20000000 0x2003FFFF;erase 0x2

0000000 0x2003FFFF;cp.b $(loadaddr) 0x20000000 $(filesize)

addip=set bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):

$(hostname):eth0:off

ramargs=set bootargs root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial

,uart0,115200 console=ttyBF0,115200

nfsargs=set bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath),tcp,nfsver

s=3

nfsboot=tftp $(loadaddr) vmImage;run nfsargs;run addip;bootm

ethact=Blackfin EMAC

ethaddr=42:54:40:1B:7A:60

server=10.10.34.130

flashboot=flread 0x20200000 $(loadaddr) $(maxlen); run ramargs; run addip; bootm

$(loadaddr)

dnsip=192.168.0.1

ramboot=tftp $(loadaddr) $(bootfile);run ramargs;run addip;bootm

bootargs=root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial,uart0,11520

0 console=ttyBF0,115200 ip=192.168.21.13:10.10.34.97:192.168.21.1:255.255.252.0:

cm-bf527:eth0:off

filesize=3E66C6

fileaddr=1000000

gatewayip=192.168.21.1

netmask=255.255.252.0

ipaddr=192.168.21.13

serverip=10.10.34.97

maxlen=0x3fffff

bootcmd=run ramboot

hostname=sru101

bootfile=djh/uImage

stdin=serial

stdout=serial

stderr=serial

QuoteReplyEditDelete

 

 

2009-09-19 01:47:17     Re: hostname is always 'blackfin' in ucLinux instead of u-boot env variable.

Dave Henning (UNITED STATES)

Message: 80146   

 

To be clear, I want to use the u-boot environmental variable for the hostname.   What do I need to change in order to use the u-boot hostname variable inside uClinux.

 

Dave ...

QuoteReplyEditDelete

 

 

2009-09-19 08:39:37     Re: hostname is always 'blackfin' in ucLinux instead of u-boot env variable.

Mike Frysinger (UNITED STATES)

Message: 80158   

 

so edit your /etc/rc to do whatever you want

QuoteReplyEditDelete

 

 

2009-09-21 11:11:32     Re: hostname is always 'blackfin' in ucLinux instead of u-boot env variable.

Robin Getz (UNITED STATES)

Message: 80197   

 

Dave:

 

Look in Documentation/filesystems/nfsroot.txt

 

ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>

 

Something like the default "addip" should work:

 

addip=set bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):eth0:off

 

just "run addip" before you boot your system. The options are optional ip=::::$(hostname):eth0:dhcp should work too.

 

-Robin

Attachments

    Outcomes