variables with random values

Trent Piepho tpiepho at
Thu May 12 12:41:45 PDT 2016

Have you considered using DHCP?  It would work a lot better, as you
won't have to worry about duplicate IPs or invalid IPs.

I think you'll have to write a new globalvar for barebox to get a random
value, since the shell doesn't support backtick substitution.

On Thu, 2016-05-12 at 21:34 +0200, Giorgio wrote:
> Hi,
> I'm writing a shell script within barebox to assist an embedded board
> initialization process. Some commands in the script do firmware
> download with tftp; to allow initializing more than one board at
> a time I need to assign every board a random ip address; I would
> like to have a shell variable that every time it is dereferenced
> it results in a new random (8 bits) value so I could write:
> eth0.ipaddr=10.$RND.$RND.$RND
> Is there a way to do something similar in barebox ?
> giorgio
> _______________________________________________
> barebox mailing list
> barebox at

More information about the barebox mailing list