mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@kymetacorp.com>
To: Giorgio <giorgio.nicole@arcor.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: variables with random values
Date: Thu, 12 May 2016 19:41:45 +0000	[thread overview]
Message-ID: <1463082107.9103.271.camel@rtred1test09.kymeta.local> (raw)
In-Reply-To: <5c4dfe40-5338-cdbe-f96d-a5275f75872b@arcor.de>

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@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2016-05-12 19:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-12 19:34 Giorgio
2016-05-12 19:41 ` Trent Piepho [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463082107.9103.271.camel@rtred1test09.kymeta.local \
    --to=tpiepho@kymetacorp.com \
    --cc=barebox@lists.infradead.org \
    --cc=giorgio.nicole@arcor.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox