[Buildroot] [PATCH] systemd: add network unit file

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Sat Jun 14 16:42:06 UTC 2014


Dear Eric Le Bihan,

On Fri, 13 Jun 2014 17:35:35 +0200, Eric Le Bihan wrote:
> From: Ivan Sergeev <vsergeev at kumunetworks.com>
> 
> Add and enable a systemd unit file to bring up or down network with ifup /
> ifdown, analogous to the skeleton/etc/init.d/S40network init script.
> 
> Signed-off-by: Ivan Sergeev <vsergeev at kumunetworks.com>
> [eric.le.bihan.dev at free.fr:
>   - rebase
>   - install service only if systemd-networkd is not selected]
> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev at free.fr>
> ---
>  package/systemd/network.service |   21 +++++++++++++++++++++
>  package/systemd/systemd.mk      |   12 ++++++++++++
>  2 files changed, 33 insertions(+)
>  create mode 100644 package/systemd/network.service

Applied, thanks. However, I have a comment/question, below.


> +define SYSTEMD_INSTALL_NETWORK_HOOK
> +	$(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
> +
>  SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
>  	SYSTEMD_INSTALL_INIT_HOOK \
>  	SYSTEMD_INSTALL_TTY_HOOK \
>  	SYSTEMD_INSTALL_MACHINEID_HOOK \
>  	SYSTEMD_SANITIZE_PATH_IN_UNITS
>  
> +ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),)
> +SYSTEMD_POST_INSTALL_TARGET_HOOKS += SYSTEMD_INSTALL_NETWORK_HOOK
> +endif

I'm wondering why we're not using the <pkg>_INIT_SYSTEMD mechanism here.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


More information about the buildroot mailing list