Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@openwide.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] set simple network setup via the system configuration submenu
Date: Tue, 14 Oct 2014 18:14:40 +0200	[thread overview]
Message-ID: <543D4BF0.90709@openwide.fr> (raw)
In-Reply-To: <713198091.26528967.1413214443914.JavaMail.root@openwide.fr>

Hi J?r?my,
>>> With regards to systemd, as far as I could figure it still uses
>>> /etc/network/interfaces but with different names. AFAIU there is no
>>> sane
>>> default to replace the "eth0" name so I did not put a different
>>> default
>>> when systemd is used
>> I checked on my Fedora machine that use systemd and there is no
>> directory /etc/network.
>> Instead there is a /etc/networks file.
>> But I don't know systemd so much...
>
> * systemv init
>
> configuration is done by net-utils (or busybox) via /etc/network/*
>
> inittab calls /etc/rc.d/S40network which calls ifup -a
>
> (this file is part of skeleton/ so is always here)
>
> this is the well known configuration infrastructure we all know and
> love.
>
>
> * systemd without networkd
>
> buildroot will automatically add a network.service which will do
> the equivalent of S40network (i.e : call "ifup -a") The same
> infrastructue is used, so the script still works
>
> * systemd with networkd
>
> systemd-networkd is in charge of setting up the network using
> systemd rules it will find throughout the filesystem
> (/etc/systemd/network /usr/lib/systemd/network)
>
> I don't generate a networkd rule in this case. I don't know if
> this is a wanted feature. I'll have a look at how complicated
> this is...
ok
>>> ---
>>>    Makefile                               |  1 +
>>>    support/scripts/generate-interfaces.sh | 75
>>>    ++++++++++++++++++++++++++++++++
>>>    system/Config.in                       | 78
>>>    ++++++++++++++++++++++++++++++++++
>>>    3 files changed, 154 insertions(+)
>>>    create mode 100755 support/scripts/generate-interfaces.sh
>>>
>>> diff --git a/Makefile b/Makefile
>>> index e788f1b..71cad7d 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -477,6 +477,7 @@ $(BUILD_DIR)/.root:
>>>    	@ln -snf lib $(TARGET_DIR)/$(LIB_SYMLINK)
>>>    	@mkdir -p $(TARGET_DIR)/usr
>>>    	@ln -snf lib $(TARGET_DIR)/usr/$(LIB_SYMLINK)
>>> +	./support/scripts/generate-interfaces.sh $(TARGET_DIR)
>> generate-interfaces.sh is only called when the target directory is
>> created.
>> What happen if the Buildroot's configuration is modified ?
>> What's about calling this script from target-finalize ?
>>
>> If unlikely another interfaces file exist on the overlay directory
>> which
>> network configuration must be used ?
>>
> I have moved this to system/system.mk which is where most of
> the system submenu stuff is added. These are all added to
> TARGET_FINALIZE which works for me. If a user adds an
> overlay, the overlay is applied after TARGET_FINALIZE so
> the user's version of the file would be use, which seems to
> me like the correct behaviour
I'm agree with you.
>> Also, $(TOPDIR) must be used here instead of '.'
> fixed, will respin
[snip]
>>> +
>>> +config BR2_SIMPLE_NETWORK_1_IPV4_MANUAL
>>> +	bool "IPv4 with parameters manually specified"
>>> +	help
>>> +	   Configure IPv4 by specifying each parameter separately
>>> +endchoice
>>> +
>>> +if BR2_SIMPLE_NETWORK_1_IPV4_MANUAL
>>> +config BR2_SIMPLE_NETWORK_1_IPV4_ADDRESS
>>> +	string "IP Address of the first network interface"
>>> +
>>> +config BR2_SIMPLE_NETWORK_1_IPV4_NETMASK
>>> +	string "Netmask of the first network interface"
>>> +
>>> +config BR2_SIMPLE_NETWORK_1_IPV4_BROADCAST
>>> +	string "Broadcast Address of the first network interface"
>>> +
>>> +config BR2_SIMPLE_NETWORK_1_IPV4_GATEWAY
>>> +	string "Address of the gateway for the first network interface"
>>> +endif
>> These configs settings needs a default value (like for the interface
>> name)
>> otherwise the script generate-interface will fail if only
>> BR2_SIMPLE_NETWORK_1_IPV4_MANUAL has been selected.
> Yes, that's on purpose... There is no sane default afaik for IP
> address when nothing is known on about the intranet topology...
I understand but I'm thinking about autobuilders here.
The autobuilder will randomly enable BR2_SIMPLE_NETWORK_1_IPV4_MANUAL in the
configuration without set any value in other BR2_SIMPLE_NETWORK_1_IPV4_.

> I am opened to any suggestion on default values but I think it's
> safer to consider this an incorrect setup and refuse to build
An exception may be added in autobuilders to prevent to build with
BR2_SIMPLE_NETWORK_1_IPV4_MANUAL set ? Through ?

>
>
> At this point i'll wait a couple of days for extra comments and i'll
> look into networkd generation.
>
> After that I will respin the patch...
Ok, thanks.

Best regards,
Romain

  reply	other threads:[~2014-10-14 16:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 12:13 [Buildroot] [PATCH] set simple network setup via the system configuration submenu Jérémy Rosen
2014-10-07 12:56 ` Jeremy Rosen
2014-10-12  9:08 ` Romain Naour
2014-10-13 15:34   ` Jeremy Rosen
2014-10-14 16:14     ` Romain Naour [this message]
2014-10-15 16:41 ` Arnout Vandecappelle
2014-10-16 15:24   ` Jeremy Rosen

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=543D4BF0.90709@openwide.fr \
    --to=romain.naour@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