[U-Boot] Bootoloader remote automation

Wolfgang Denk wd at denx.de
Thu May 27 19:55:47 CEST 2010


Dear Pet Harp,

In message <AANLkTikGRQXjJ_6QIGXAuEu-EXdyqLsq5PMVaLL1w0WI at mail.gmail.com> you wrote:
>
> I would like to automate the kernel and filesystem loading using the u-boot
> instructions.

No problem. This  has been done many, many times before, including
completely automatic production systems.

> Basically, I would start the loading process from a remote system such as a
> pc computer for example, and then take some actions depending of the log
> this pc would receive from the target.
> Is there a way to make the u-boot to send some logs to the remote system
> telling if the image was succesfully loaded or not so, with this
> information, the remote system could create a log that would telll the
> operator about the procedure situation for example?

The standard tool to do things like these is "expect"; in the trivial
case (without the usually needed error checking) this results in
expect scripts like this:

	send -s "setenv serial# $serial\r"
	expect "=>"
	send -s "setenv ethaddr $ethaddr\r"
	expect "=>"
	send -s "saveenv\r"
	expect "=>"
	send -s "setenv preboot 'echo;echo Type \\\\\"run flash_nfs\\\\\" to mount root filesystem over NFS;echo'\r"
	expect "=>"
	send -s "setenv nfsargs 'setenv bootargs root=/dev/nfs rw nfsroot=\${serverip}:\${rootpath}'\r"
	expect "=>"
	send -s "setenv ramargs setenv bootargs root=/dev/ram rw\r"
	expect "=>"
	...
	send -s "setenv ipaddr   $TARGET_IP\r"
	expect "=>"
	send -s "setenv netmask  $NETMASK\r"
	expect "=>"
	send -s "setenv netdev   eth0\r"
	expect "=>"
	send -s "setenv hostname $HOSTNAME\r"
	expect "=>"
	send -s "setenv serverip $SERVER_IP\r"
	expect "=>"


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The pathology is to want control, not that you ever get it,  because
of course you never do."                            - Gregory Bateson


More information about the U-Boot mailing list