Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Rosen <jeremy.rosen@openwide.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4] set simple network setup via the system configuration submenu
Date: Tue, 2 Dec 2014 09:35:51 +0100 (CET)	[thread overview]
Message-ID: <239612746.28667857.1417509351611.JavaMail.root@openwide.fr> (raw)
In-Reply-To: <CAGrucu1GahM=AS2rOm8_YX+spuZGRrvSVL0n+VVh1ywR4Mkbog@mail.gmail.com>



> Hi,
> 
> 2014-10-30 9:36 GMT+01:00 J?r?my Rosen <jeremy.rosen@openwide.fr>:
> > This patch allows the setup of simple /etc/network/interfaces (or
> > /etc/systemd/network/80-buildroot.network if networkd is enabled)
> > via the
> > configuration menus instead of using an overlay
> >
> > * supports disabling the interface
> > * supports manual ipv4 configuration
> > * supports dhcp configuration
> >
> >
> > Signed-off-by: J?r?my Rosen <jeremy.rosen@openwide.fr>
> > ---
> >
> > This patch is here to avoid having to do an overlay for the most
> > common
> > cases (ipv4 with fixed IP or DHCP)
> >
> > This is reduced to the bare minimum to cover the most common case.
> > Anything
> > more complex can be done by using overlays instead.
> >
> 
> I've tested none/manual/dhcp with systemd-networkd and it works as
> expected.
> 
> There's one shell compatibility issue in the cidr calculation code:
> 
> > +do_generate_network_service ()
> > +{
> > [...]
> > +       elif [ $BR2_SIMPLE_NETWORK_IPV4_MANUAL ] && \
> > +               [ "$BR2_SIMPLE_NETWORK_IPV4_ADDRESS" != "0.0.0.0" ]
> > ; then
> > +               nbits=0
> > +               OLDIFS="$IFS"; IFS=.
> > +               for dec in $BR2_SIMPLE_NETWORK_IPV4_NETMASK ; do
> > +                       case $dec in
> > +                               255) let nbits+=8;;
> > +                               254) let nbits+=7;;
> > +                               252) let nbits+=6;;
> > +                               248) let nbits+=5;;
> > +                               240) let nbits+=4;;
> > +                               224) let nbits+=3;;
> > +                               192) let nbits+=2;;
> > +                               128) let nbits+=1;;
> > +                               0);;
> > +                       esac
> > +               done
> > +               IFS="$OLDIFS"
> 
> "let" is not available in dash (default shell for Debian). Can be
> fixed with "$(( ))" constructs:
> 

Ok, I will fix that

> 255) nbits=$(( nbits + 8 )) ;;
> 
> (a.s.o.)
> The "0) ;;" statement can be dropped.
> 

that's... a mater of taste, but ok, i'll remove.

As usual, i'll wait a couple of days then repost a v5

thx for the review

> --
> Andr?
> 

      reply	other threads:[~2014-12-02  8:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30  8:36 [Buildroot] [PATCH v4] set simple network setup via the system configuration submenu Jérémy Rosen
2014-11-10 10:00 ` Jeremy Rosen
2014-11-28 15:23 ` Jeremy Rosen
2014-12-01 20:27 ` André Erdmann
2014-12-02  8:35   ` Jeremy Rosen [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=239612746.28667857.1417509351611.JavaMail.root@openwide.fr \
    --to=jeremy.rosen@openwide.fr \
    --cc=buildroot@busybox.net \
    /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