Commit graph

13 commits

Author SHA1 Message Date
Carlos Santos 57f3685bc1 package/ifupdown-scripts: add openrc support
The "network" script allows configuring an interface by means of two
/etc/ifup.<if_name> and /etc/ifdown.<if_name> files with the commands
required to bring it up and down, respectively. So we can support the
BR2_SYSTEM_DHCP config if netifrc is not selected.

- Replace the dependency on !BR2_PACKAGE_OPENRC in Config.in by a
  dependency on !BR2_PACKAGE_NETIFRC.

- Add an IFUPDOWN_SCRIPTS_DHCP_OPENRC macro to create the ifup.<if_name>
  and ifdown.<if_name> files.

- Add an IFUPDOWN_SCRIPTS_INSTALL_INIT_OPENRC hook that includes the
  IFUPDOWN_SCRIPTS_{PREAMBLE,DHCP,DHCP_OPENRC} macros. LOCALHOST is not
  required, since "lo" is configured by the "loopback" script.

Signed-off-by: Carlos Santos <unixmania@gmail.com>
[yann.morin.1998@free.fr:
  - adapt after the preamble was spit to itw own patch
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-11 22:12:17 +01:00
Yann E. MORIN 48c73e0c5f package/ifupdown-scripts: do not expect localhost to precede DHCP
Currently, we always suppose that localhost settings will always come
before the (optional) DHCP ones. This is always true when using
sysvinit/busybox or systemd.

However, with openrc, this will no longer be the case: only the DHCP
settings will be present (OpenRC handles lo on his own).

So, prepare the macros to be independent one from the other, and for
symetry, in both:
  - use append-redirection >> to populate the interfaces file,
  - prepend a leading empty line at the beginning of each section.

The origianl singe '>' redirection would ensure the file would not grow
on a reinstall, but that's no longer the case, so reset the file prior
to filling it, using the canned preamble.

Signed-off-by: Carlos Santos <unixmania@gmail.com>
[yann.morin.1998@free.fr: split off to its own patch]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-11 22:12:17 +01:00
Carlos Santos 9de7ca152e package/ifupdown-scripts: relocate the generation the interfaces file
Generate it in the IFUPDOWN_SCRIPTS_INSTALL_INIT_<FOO> hook. This will
allow creating a file to configure an interface via DHCP for the openrc
network service, in a forthcoming change.

Signed-off-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-11 22:12:17 +01:00
Carlos Santos 560f5f09b5 package/ifupdown-scripts: always install /etc/network/nfs_check
The script is minuscle and can be useful to configure an interface via
DHCP at run-time.

Signed-off-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-11 21:29:22 +01:00
Jérémy Rosen 3e092163e5 package: rely on systemctl preset-all for buildroot-provided services
All the packages in this list have the following properties
* units are provided by buildroot in the package directory
* the SYSTEMD_INSTALL_INIT_HOOK is exactly equivalent to what the
  [Install] section of the unit does

The fix removes the soflinking in the .mk file

Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2019-12-18 18:27:41 +01:00
Michał Łyszczek eb77734d11 system/Config.in: add new init - openrc
This is very basic settings for openrc init.

* system/Config.in
  Allows to select openrc as init system (which auto selects
  openrc-skeleton and openrc package).

* package/ifupdown-scripts/Config.in
  openrc has its own service to bring up/down interfaces, so
  ifupdown-scripts should not be enabled when openrc is enabled to
  prevent service clash.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
[Thomas: take into account the !BR2_STATIC_LIBS dependency]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-05-18 23:16:04 +02:00
Matt Weber 590e9e05b6 packages: update sysv S* scripts to 644
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-02-08 11:35:22 +01:00
Peter Korsgaard 7a3f85ddff ifupdown-script: send current hostname in DHCP request
For the default (BR2_SYSTEM_DHCP) /etc/network/interfaces handling.

Both the "big" and busybox ifupdown variants pass the hostname argument to
the DHCP client through the shell, so we can use $() to expand to the
current hostname value.

Notice that this may not be handled by all DHCP clients.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Reviewed-by: Matt Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-11-05 23:20:55 +01:00
Thomas Petazzoni 1610200e78 package/*/Config.in: fix property order warning of check-package
This commit fixes the ordering of the Config.in option properties, as
reported by check-package.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-12-18 09:24:38 +01:00
Cam Hutchison 58b74e0dbf ifupdown-scripts: do not install .empty files
ifupdown-scripts has some .empty files to maintain empty directories
in git. Previously this package used to be part of the skeleton which
used SYSTEM_RSYNC to copy the directories to the target. When it was
split into a separate package, cp -a was used to do the copy instead,
which copies the .empty files.

Change to SYSTEM_RSYNC which excludes .empty files.

Signed-off-by: Cam Hutchison <camh@xdna.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-10-15 15:47:43 +02:00
Adam Duskett d0b45144c3 package/i*: fix wrapping of Config.in help text
The check-package script when ran gives warnings on text wrapping
on all of these Config files.  This patch cleans up all warnings
related to the text wrapping for the Config files starting with
the letter i in the package directory.

The appropriate indentation is: <tab><2 spaces><62 chars>
See http://nightly.buildroot.org/#writing-rules-config-in for more
information.

Signed-off-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-31 19:09:34 +02:00
Yann E. MORIN ac41572e66 package/ifupdown-scripts: allow use with a custom skeleton
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-04 23:38:18 +02:00
Yann E. MORIN 5fb1b86782 package/ifupdown-scripts: new package
The ifupdown scripts can be used independently of the init system, be it
sysv, busybox or systemd; they could even be used when there is no init
system (i.e. the user is providing his own).

Currently, those ifupdown scripts are bundled in the skeleton.

But we soon will have a skeleton specific to systemd, so we would be
missing those scripts (when systemd-networkd is not enabled).

So, move those scripts to their own package.

To keep the current behaviour (before it is changed in future commits),
we make that package default to y, but depend on the default skeleton.

Instead of being a target-finalize hook, the scripts are installed as
any other package are, with a package install-target command.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
[Thomas: drop empty IFUPDOWN_SCRIPTS_SOURCE]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-04 23:38:18 +02:00