All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] netconsole doesn't work if $(serverip) is assigned to ncip instead of hardcoded value
@ 2007-03-27  8:24 Igor Marnat
  2007-03-27  8:40 ` Wolfgang Denk
  0 siblings, 1 reply; 5+ messages in thread
From: Igor Marnat @ 2007-03-27  8:24 UTC (permalink / raw)
  To: u-boot

Hello List!

When I assign 10.0.0.55 to ncip, netconsole functions ok. But when I
assign 10.0.0.55 to serverip variable and ncip is equal to
$(serverip), netconsole doesn't work. It still shows prompt to serial
console after command "run nc" is issued (nc=setenv stdout nc;setenv
stdin nc).

u-boot is of 1.1.6 version.

Am I doing something wrong or it functions as designed?

Best regards,
Igor Marnat
mailto:marny at rambler.ru

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] netconsole doesn't work if $(serverip) is assigned to ncip instead of hardcoded value
  2007-03-27  8:24 [U-Boot-Users] netconsole doesn't work if $(serverip) is assigned to ncip instead of hardcoded value Igor Marnat
@ 2007-03-27  8:40 ` Wolfgang Denk
  2007-03-27 11:15   ` Igor Marnat
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2007-03-27  8:40 UTC (permalink / raw)
  To: u-boot

In message <985507812.20070327122451@rambler.ru> you wrote:
> 
> When I assign 10.0.0.55 to ncip, netconsole functions ok. But when I
> assign 10.0.0.55 to serverip variable and ncip is equal to
> $(serverip), netconsole doesn't work. It still shows prompt to serial
> console after command "run nc" is issued (nc=setenv stdout nc;setenv
> stdin nc).

You must be doing something wrong. "ncip" and "serverip" are
completely unrelated.

Please provide a full log of your actions including your environment
settings.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"We don't have to protect the environment -- the Second Coming is  at
hand."                                                   - James Watt

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] netconsole doesn't work if $(serverip) is assigned to ncip instead of hardcoded value
  2007-03-27  8:40 ` Wolfgang Denk
@ 2007-03-27 11:15   ` Igor Marnat
  2007-03-27 14:58     ` Wolfgang Denk
  0 siblings, 1 reply; 5+ messages in thread
From: Igor Marnat @ 2007-03-27 11:15 UTC (permalink / raw)
  To: u-boot

Hello Wolfgang,

WD> You must be doing something wrong. "ncip" and "serverip" are
WD> completely unrelated.

Sure. I just thought that it's possible to use environment variables
to assign values to all other variables. That is to say, if assignment

addip=setenv bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):off panic=1

works ok (it uses $(serverip)), why can't I use

ncip=$(serverip)?

See below the full environment. The only difference between two scenarious
is that it works if ncip=10.0.0.55 and it doesn't if ncip=$(serverip).


=> printenv baudrate=115200
loads_echo=1
eth1addr=00:50:c2:1e:af:fd
netdev=eth0
ethaddr=00:50:c2:1e:af:f1
kernel_flash_addr=ffe04000
kernel_flash_end=fffbffff
kernel_flash_space=$(kernel_flash_addr) $(kernel_flash_end)
poff=protect off $(kernel_flash_addr) $(kernel_flash_end)
erase_kernel=era $(kernel_flash_addr) $(kernel_flash_end)
upd_kernel=tftpboot; run poff; run erase_kernel; cp.b $(fileaddr) $(kernel_flash_addr) $(filesize)
flash_nfs=run nfsargs addip addcons;bootm $(kernel_flash_addr)
nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) rootpath=$(rootpath)
addip=setenv bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):off panic=1
addcons=setenv bootargs $(bootargs) console=ttyS0,$(baudrate)
nfs26=/home/igor/tz-64/ppc/tz_64_nfs
rootpath=/home/igor/tz-64/ppc/tz_64_nfs
addmem=setenv bootargs $(bootargs) mem=16M
filesize=ebe75
fileaddr=200000
netmask=255.255.255.0
serverip=10.0.0.55
bootargs=root=/dev/nfs rw nfsroot=90.0.0.55:/home/igor/tz-64/ppc/tz_64_nfs rootpath=/home/igor/tz-64/ppc/tz_64_nfs
ip=90.0.0.137:90.0.0.55::255.255.255.0::eth0:off panic=1
net_nfs=tftp 200000 $(bootfile);run nfsargs addip addcons addmem;bootm
mtd_args=setenv bootargs root=/dev/mtdblock0 rw rootfstype=jffs2
net_mtd=tftp 200000 $(bootfile);run mtd_args addip addcons addmem;bootm
ipaddr=10.0.0.239
bootfilesaved=uImage26
bootcmdsaved=run net_mtd
bootfile=uImage26nandconsole
nc=setenv stdout nc;setenv stdin nc
ncip=10.0.0.55
ethact=ppc_4xx_eth0
com_eth_go=run echo_sleep; run nc; run echo_sleep; run net_nfs
bootcmd=run com_eth_go
echo_sleep=echo "I am sleeping, press CTRL-C to stop";sleep 4;
bootdelay=2
stdin=serial
stdout=serial
stderr=serial


-- 
Best regards,
Igor Marnat
mailto:marny at rambler.ru

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] netconsole doesn't work if $(serverip) is assigned to ncip instead of hardcoded value
  2007-03-27 11:15   ` Igor Marnat
@ 2007-03-27 14:58     ` Wolfgang Denk
  2007-03-28  5:03       ` Igor Marnat
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2007-03-27 14:58 UTC (permalink / raw)
  To: u-boot

In message <15015754812.20070327151529@rambler.ru> you wrote:
> 
> Sure. I just thought that it's possible to use environment variables
> to assign values to all other variables. That is to say, if assignment
> 
> addip=setenv bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):off panic=1

I'm not sure what this represents. Your input? Then  this  is  wrong.
The  output  of a printenv command? Then it looks ok, except that the
use of pares for variable reference  is  deprecated  and  may  become
illegal soon. Please use '${...}' instead.

> ncip=$(serverip)?

What is the supposed function of this?

> See below the full environment. The only difference between two scenarious
> is that it works if ncip=10.0.0.55 and it doesn't if ncip=$(serverip).

Of course this cannot work. The string "$(serverip)" is no valid IP
address.

U-Boot substitues variables when it parses an U-Boot command.

If you define something like

	=> setenv addip 'setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}: ...'

then you have to *run* this 'addip' definition (i. e.. you execute  a
command,  "run"); this in turn will execute the "setenv" command, and
when dong  this  the  command  arguments  are  parsed  and  variables
substituted.

If you define 

	=> setenv ncip ${serverip}

you will set the "ncip" variable to the current value of your serverip
variable. If you want to delay this substitution, you could for
example write:

	=> setenv set_ncip 'setenv ncip ${serverip}'

and later, at the appropriate place, execute it as "run set_ncip".

If you however write

	=> setenv ncip '${serverip}'

then you defined the variable  "ncip"  to  hold  the  literal  string
"${serverip}" which will probably not do what you want.


Hope this helps - I don't really understand why you expected it to
work differently.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Living on Earth may be expensive, but it includes an annual free trip
around the Sun.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] netconsole doesn't work if $(serverip) is assigned to ncip instead of hardcoded value
  2007-03-27 14:58     ` Wolfgang Denk
@ 2007-03-28  5:03       ` Igor Marnat
  0 siblings, 0 replies; 5+ messages in thread
From: Igor Marnat @ 2007-03-28  5:03 UTC (permalink / raw)
  To: u-boot

Hello Wolfgang,

WD> If you define
WD>         => setenv ncip ${serverip}
WD> you will set the "ncip" variable to the current value of your serverip
WD> variable. If you want to delay this substitution, you could for

You are definitely right. I should have use 'setenv ncip ${serverip}'.

Thank you for your reply,
Best regards,
Igor Marnat
mailto:marny at rambler.ru

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-28  5:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-27  8:24 [U-Boot-Users] netconsole doesn't work if $(serverip) is assigned to ncip instead of hardcoded value Igor Marnat
2007-03-27  8:40 ` Wolfgang Denk
2007-03-27 11:15   ` Igor Marnat
2007-03-27 14:58     ` Wolfgang Denk
2007-03-28  5:03       ` Igor Marnat

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.