skeleton: move ifupdown script to their own package
v3 cover skeleton: move ifupdown script to their own package
Hello All!
The ifupdown scripts are currently provided by the skeleton, and they are used by varioue network 'managers', like the standalone ifupdown, the one in Busybox, or by systemd (without networkd).
But when we have a skeleton specific to systemd, we'd still need to have those scripts.
Rather than duplicate or play special tricks, we first move them to their own package.
Then we make sure we do not install them with systemd-networkd, as they are useless in that case.
Finally, those scripts can now even be used by a custom skeleton.
Changes v2 -> v3:
- don't select the new package at all, but default it to 'y' for the default skeleton, so as to really keep the current behaviour (Arnout)
- split the patch in three (Arnout)
Regards,
Yann E. MORIN.
The following changes since commit 824f3d9bebee5008ed4f21ab9857778b7d200802
support/scripts: check-host-rpath now handles $ORIGIN as well (2017-07-02 15:49:25 +0200)
are available in the git repository at:
git://git.buildroot.org/~ymorin/git/buildroot.git
for you to fetch changes up to 7af4e1b5c5c358fd2a41e609ea250138a5565c18
package/ifupdown-scripts: allow use with a custom skeleton (2017-07-02 16:14:08 +0200)
----------------------------------------------------------------
Yann E. MORIN (3):
package/ifupdown-scripts: new package package/ifupdown-scripts: not needed for systemd-networkd package/ifupdown-scripts: allow use with a custom skeleton
package/Config.in | 1 +
package/ifupdown-scripts/Config.in | 7 +++
.../init.d => ifupdown-scripts}/S40network | 0
package/ifupdown-scripts/ifupdown-scripts.mk | 57 ++++++++++++++++++++++
.../{systemd => ifupdown-scripts}/network.service | 0
.../ifupdown-scripts}/network/if-down.d/.empty | 0
.../network/if-post-down.d/.empty | 0
.../network/if-pre-up.d/wait_iface | 0
.../ifupdown-scripts}/network/if-up.d/.empty | 0
package/{skeleton => ifupdown-scripts}/nfs_check | 0
package/skeleton/skeleton.mk | 33 -------------
package/systemd/systemd.mk | 8 ---
12 files changed, 65 insertions(+), 41 deletions(-)
create mode 100644 package/ifupdown-scripts/Config.in
rename package/{initscripts/init.d => ifupdown-scripts}/S40network (100%)
create mode 100644 package/ifupdown-scripts/ifupdown-scripts.mk
rename package/{systemd => ifupdown-scripts}/network.service (100%)
rename {system/skeleton/etc => package/ifupdown-scripts}/network/if-down.d/.empty (100%)
rename {system/skeleton/etc => package/ifupdown-scripts}/network/if-post-down.d/.empty (100%)
rename {system/skeleton/etc => package/ifupdown-scripts}/network/if-pre-up.d/wait_iface (100%)
rename {system/skeleton/etc => package/ifupdown-scripts}/network/if-up.d/.empty (100%)
rename package/{skeleton => ifupdown-scripts}/nfs_check (100%)Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v3 1/3 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-networks 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.
---
Changes v2 -> v3:
- don't select it from any other package, make it default y (Arnout)
Changes v1 -> v2:
- add a real prompt (Thomas, Arnout)
- drop ifupdown-scripts dummy-prompt hack (Thomas)
- simplify selecting ifupdown-scripts from systemd (Thomas)
- reword the commit log to remove reference to init systems (Arnout)
- select it from the package Busybox, rather than the init system Busybox (Arnout)
---
package/Config.in | 1 +
package/ifupdown-scripts/Config.in | 7 +++
.../init.d => ifupdown-scripts}/S40network | 0
package/ifupdown-scripts/ifupdown-scripts.mk | 57 ++++++++++++++++++++++
.../{systemd => ifupdown-scripts}/network.service | 0
.../ifupdown-scripts}/network/if-down.d/.empty | 0
.../network/if-post-down.d/.empty | 0
.../network/if-pre-up.d/wait_iface | 0
.../ifupdown-scripts}/network/if-up.d/.empty | 0
package/{skeleton => ifupdown-scripts}/nfs_check | 0
package/skeleton/skeleton.mk | 33 -------------
package/systemd/systemd.mk | 8 ---
12 files changed, 65 insertions(+), 41 deletions(-)
create mode 100644 package/ifupdown-scripts/Config.in
rename package/{initscripts/init.d => ifupdown-scripts}/S40network (100%)
create mode 100644 package/ifupdown-scripts/ifupdown-scripts.mk
rename package/{systemd => ifupdown-scripts}/network.service (100%)
rename {system/skeleton/etc => package/ifupdown-scripts}/network/if-down.d/.empty (100%)
rename {system/skeleton/etc => package/ifupdown-scripts}/network/if-post-down.d/.empty (100%)
rename {system/skeleton/etc => package/ifupdown-scripts}/network/if-pre-up.d/wait_iface (100%)
rename {system/skeleton/etc => package/ifupdown-scripts}/network/if-up.d/.empty (100%)
rename package/{skeleton => ifupdown-scripts}/nfs_check (100%)package/Config.in +1 -0
@@ -1599,6 +1599,7 @@ menu "Networking applications" source "package/ifplugd/Config.in" source "package/iftop/Config.in" source "package/ifupdown/Config.in" + source "package/ifupdown-scripts/Config.in" source "package/igd2-for-linux/Config.in" source "package/igh-ethercat/Config.in" source "package/igmpproxy/Config.in"
package/ifupdown-scripts/Config.in new file +7 -0
@@ -0,0 +1,7 @@ +config BR2_PACKAGE_IFUPDOWN_SCRIPTS + bool + depends on BR2_ROOTFS_SKELETON_DEFAULT + default y + help + Set of scripts used by ifupdown (either the standalone one, or the + busybox one) to bring network up, or tear it down.
package/ifupdown-scripts/S40network renamed from package/initscripts/init.d/S40network +0 -0
package/ifupdown-scripts/ifupdown-scripts.mk new file +57 -0
57 lines not on this page · raw message
package/ifupdown-scripts/network.service renamed from package/systemd/network.service +0 -0
package/ifupdown-scripts/network/if-down.d/.empty renamed from system/skeleton/etc/network/if-down.d/.empty +0 -0
package/ifupdown-scripts/network/if-post-down.d/.empty renamed from system/skeleton/etc/network/if-post-down.d/.empty +0 -0
package/ifupdown-scripts/network/if-pre-up.d/wait_iface renamed from system/skeleton/etc/network/if-pre-up.d/wait_iface +0 -0
package/ifupdown-scripts/network/if-up.d/.empty renamed from system/skeleton/etc/network/if-up.d/.empty +0 -0
package/ifupdown-scripts/nfs_check renamed from package/skeleton/nfs_check +0 -0
package/skeleton/skeleton.mk +0 -33
@@ -145,39 +145,6 @@ endef TARGET_FINALIZE_HOOKS += SKELETON_SET_ISSUE endif -define SKELETON_SET_NETWORK_LOCALHOST - ( \ - echo "# interface file auto-generated by buildroot"; \ - echo ; \ - echo "auto lo"; \ - echo "iface lo inet loopback"; \ - ) > $(TARGET_DIR)/etc/network/interfaces -endef - -SKELETON_NETWORK_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP)) - -ifneq ($(SKELETON_NETWORK_DHCP_IFACE),) -define SKELETON_SET_NETWORK_DHCP - ( \ - echo ; \ - echo "auto $(SKELETON_NETWORK_DHCP_IFACE)"; \ - echo "iface $(SKELETON_NETWORK_DHCP_IFACE) inet dhcp"; \ - echo " pre-up /etc/network/nfs_check"; \ - echo " wait-delay 15"; \ - ) >> $(TARGET_DIR)/etc/network/interfaces - $(INSTALL) -m 0755 -D $(SKELETON_PKGDIR)/nfs_check \ - $(TARGET_DIR)/etc/network/nfs_check -endef -endif - -define SKELETON_SET_NETWORK - mkdir -p $(TARGET_DIR)/etc/network/ - $(SKELETON_SET_NETWORK_LOCALHOST) - $(SKELETON_SET_NETWORK_DHCP) -endef - -TARGET_FINALIZE_HOOKS += SKELETON_SET_NETWORK - ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y) ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),) SKELETON_ROOT_PASSWORD =
package/systemd/systemd.mk +0 -8
@@ -308,13 +308,6 @@ endef endif else SYSTEMD_CONF_OPTS += --disable-networkd -define SYSTEMD_INSTALL_SERVICE_NETWORK - $(INSTALL) -D -m 644 package/systemd/network.service \ - $(TARGET_DIR)/etc/systemd/system/network.service - mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants - ln -fs ../network.service \ - $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/network.service -endef endif ifeq ($(BR2_PACKAGE_SYSTEMD_RESOLVED),y)
@@ -406,7 +399,6 @@ endif define SYSTEMD_INSTALL_INIT_SYSTEMD $(SYSTEMD_DISABLE_SERVICE_TTY1) $(SYSTEMD_INSTALL_SERVICE_TTY) - $(SYSTEMD_INSTALL_SERVICE_NETWORK) $(SYSTEMD_INSTALL_SERVICE_TIMESYNC) $(SYSTEMD_INSTALL_NETWORK_CONFS) endef
Signature · 1 line
2.11.0
PATCH v3 1/3 package/ifupdown-scripts: new package
On 02-07-17 16:35, Yann E. MORIN wrote:
[snip]
package/ifupdown-scripts/ifupdown-scripts.mk line 48
Quoted 3 lines
package/ifupdown-scripts/ifupdown-scripts.mk new file +3
-0+# ifupdown-scripts can not be selected when systemd-networkd is +# enabled, so if we are enabled with systemd, we must install our +# own service file.
Leftover from a previous iteration? Now it actually can (and will be) selected
for SYSTEMD_NETWORKD. So you need the condition here (and drop the comment).
Regards,
Arnout
Quoted 8 lines
package/ifupdown-scripts/ifupdown-scripts.mk new file +8
-0+define IFUPDOWN_SCRIPTS_INSTALL_INIT_SYSTEMD + $(INSTALL) -D -m 644 $(IFUPDOWN_SCRIPTS_PKGDIR)/network.service \ + $(TARGET_DIR)/etc/systemd/system/network.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants + ln -fs ../network.service \ + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/network.service +endef +
[snip]
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v3 1/3 package/ifupdown-scripts: new package
Quoted 10 lines · Arnout Vandecappelle
On 02-07-17 16:35, Yann E. MORIN wrote:
[snip]package/ifupdown-scripts/ifupdown-scripts.mk line 48
Quoted 3 lines
package/ifupdown-scripts/ifupdown-scripts.mk new file +3
-0+# ifupdown-scripts can not be selected when systemd-networkd is +# enabled, so if we are enabled with systemd, we must install our +# own service file.Leftover from a previous iteration? Now it actually can (and will be) selected
forSYSTEMD_NETWORKD. So you need the condition here (and drop the comment).
OTOH respinning just for this is silly.
Regards,
Arnout
Quoted 14 lines
Regards,
ArnoutQuoted 8 lines
package/ifupdown-scripts/ifupdown-scripts.mk new file +8
-0+define IFUPDOWN_SCRIPTS_INSTALL_INIT_SYSTEMD + $(INSTALL) -D -m 644 $(IFUPDOWN_SCRIPTS_PKGDIR)/network.service \ + $(TARGET_DIR)/etc/systemd/system/network.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants + ln -fs ../network.service \ + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/network.service +endef +[snip]
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v3 1/3 package/ifupdown-scripts: new package
In reply to Yann E. MORINArnout, Thomas, All,
On 2017-07-02 16:35 +0200, Yann E. MORIN spake thusly:
Quoted 14 lines
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-networks 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.
Quoted 7 lines
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" <[email protected]>Cc Arnout Vandecappelle <[email protected]>Cc Thomas Petazzoni <[email protected]>Cc Maxime Hadjinlian <[email protected]>
[--SNIP--]
package/ifupdown-scripts/ifupdown-scripts.mk line 7
Quoted 13 lines
package/ifupdown-scripts/ifupdown-scripts.mk new file +7
-0@@ -0,0 +1,57 @@ +################################################################################ +# +# ifupdown-scripts +# +################################################################################ + +IFUPDOWN_SCRIPTS_SOURCE =
As seen IRL, this line is not needed.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v3 2/3 package/ifupdown-scripts: not needed for systemd-networkd
In reply to Yann E. MORIN--- package/ifupdown-scripts/Config.in | 1 + 1 file changed, 1 insertion(+)
package/ifupdown-scripts/Config.in +1 -0
@@ -1,6 +1,7 @@ config BR2_PACKAGE_IFUPDOWN_SCRIPTS bool depends on BR2_ROOTFS_SKELETON_DEFAULT + depends on !BR2_PACKAGE_SYSTEMD_NETWORKD default y help Set of scripts used by ifupdown (either the standalone one, or the
Signature · 1 line
2.11.0
PATCH v3 2/3 package/ifupdown-scripts: not needed for systemd-networkd
Quoted 1 line · Yann E. MORIN
Signed-off-by "Yann E. MORIN" <[email protected]>
Regards,
Arnout
Quoted 17 lines
--- package/ifupdown-scripts/Config.in | 1 + 1 file changed, 1 insertion(+)package/ifupdown-scripts/Config.in +1
-0@@ -1,6 +1,7 @@ config BR2_PACKAGE_IFUPDOWN_SCRIPTS bool depends on BR2_ROOTFS_SKELETON_DEFAULT + depends on !BR2_PACKAGE_SYSTEMD_NETWORKD default y help Set of scripts used by ifupdown (either the standalone one, or the
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v3 3/3 package/ifupdown-scripts: allow use with a custom skeleton
In reply to Yann E. MORIN--- package/ifupdown-scripts/Config.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
package/ifupdown-scripts/Config.in +2 -3
@@ -1,8 +1,7 @@ config BR2_PACKAGE_IFUPDOWN_SCRIPTS - bool - depends on BR2_ROOTFS_SKELETON_DEFAULT + bool "ifupdown scripts" depends on !BR2_PACKAGE_SYSTEMD_NETWORKD - default y + default y if BR2_ROOTFS_SKELETON_DEFAULT help Set of scripts used by ifupdown (either the standalone one, or the busybox one) to bring network up, or tear it down.
Signature · 1 line
2.11.0
PATCH v3 3/3 package/ifupdown-scripts: allow use with a custom skeleton
Quoted 4 lines · Yann E. MORIN
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Arnout Vandecappelle <[email protected]>Cc Thomas Petazzoni <[email protected]>Cc Maxime Hadjinlian <[email protected]>
You'll also send a patch adding a select to package/ifupdown/Config.in?
Regards,
Arnout
Quoted 20 lines
--- package/ifupdown-scripts/Config.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)package/ifupdown-scripts/Config.in +2
-3@@ -1,8 +1,7 @@ config BR2_PACKAGE_IFUPDOWN_SCRIPTS - bool - depends on BR2_ROOTFS_SKELETON_DEFAULT + bool "ifupdown scripts" depends on !BR2_PACKAGE_SYSTEMD_NETWORKD - default y + default y if BR2_ROOTFS_SKELETON_DEFAULT help Set of scripts used by ifupdown (either the standalone one, or the busybox one) to bring network up, or tear it down.
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v3 3/3 package/ifupdown-scripts: allow use with a custom skeleton
Arnout, All,
On 2017-07-02 18:08 +0200, Arnout Vandecappelle spake thusly:
Quoted 9 lines · Yann E. MORIN
Quoted 4 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Arnout Vandecappelle <[email protected]>Cc Thomas Petazzoni <[email protected]>Cc Maxime Hadjinlian <[email protected]>You'll also send a patch adding a select to package/ifupdown/Config.in?
As discussed IRL, it is also a legit use-case to have ifupdown without out scripts.
Thanks for the review! :-)
Regards,
Yann E. MORIN.
Quoted 31 lines
Regards,
ArnoutQuoted 20 lines
--- package/ifupdown-scripts/Config.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)package/ifupdown-scripts/Config.in +2
-3@@ -1,8 +1,7 @@ config BR2_PACKAGE_IFUPDOWN_SCRIPTS - bool - depends on BR2_ROOTFS_SKELETON_DEFAULT + bool "ifupdown scripts" depends on !BR2_PACKAGE_SYSTEMD_NETWORKD - default y + default y if BR2_ROOTFS_SKELETON_DEFAULT help Set of scripts used by ifupdown (either the standalone one, or the busybox one) to bring network up, or tear it down.Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
v3 cover skeleton: move ifupdown script to their own package
In reply to Yann E. MORINHello,
Quoted 4 lines · Yann E. MORIN
Yann E. MORIN (3):
package/ifupdown-scripts: new package package/ifupdown-scripts: not needed for systemd-networkd package/ifupdown-scripts: allow use with a custom skeleton
I've applied those patches. As discussed with Arnout and you, I've squashed PATCH 1 and PATCH 2. And in PATCH 1, I've removed the empty IFUPDOWN_SCRIPTS_SOURCE variable.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
v3 cover skeleton: move ifupdown script to their own package
Thomas, Arnout, All,
On 2017-07-04 23:49 +0200, Thomas Petazzoni spake thusly:
Quoted 9 lines · Yann E. MORIN
Quoted 4 lines
Yann E. MORIN (3):
package/ifupdown-scripts: new package package/ifupdown-scripts: not needed for systemd-networkd package/ifupdown-scripts: allow use with a custom skeletonI've applied those patches. As discussed with Arnout and you, I've squashed PATCH 1 and PATCH 2. And in PATCH 1, I've removed the empty
IFUPDOWN_SCRIPTS_SOURCEvariable.
Thanks! :-)
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'