init-ifupdown: add systemd support
To avoid bringing up interfaces before they're created by udev scripts (specifically wlan1), wait until udev settles before starting the service. https://jira.digi.com/browse/DEL-6504 Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
parent
b957f0ef75
commit
ae2abd926a
|
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=Interface initialization via ifupdown
|
||||
After=systemd-udev-settle.service
|
||||
Requires=systemd-udev-settle.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=@SBINDIR@/ifup -a
|
||||
ExecStop=@SBINDIR@/ifdown -a
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
@ -5,10 +5,13 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:"
|
|||
INITSCRIPT_NAME = "networking"
|
||||
INITSCRIPT_PARAMS = "start 03 2 3 4 5 . stop 80 0 6 1 ."
|
||||
|
||||
inherit systemd
|
||||
|
||||
SRC_URI_append = " \
|
||||
file://interfaces.br0.example \
|
||||
file://interfaces.p2p \
|
||||
file://resolv \
|
||||
file://ifupdown.service \
|
||||
"
|
||||
|
||||
SRC_URI_append_ccimx6qpsbc = "\
|
||||
|
|
@ -29,11 +32,17 @@ SRC_URI_append_ccimx8x = "\
|
|||
file://virtwlans.sh \
|
||||
"
|
||||
|
||||
SYSTEMD_SERVICE_${PN} = "ifupdown.service"
|
||||
|
||||
WPA_DRIVER ?= "nl80211"
|
||||
|
||||
do_install_append() {
|
||||
# Install DNS servers handler
|
||||
install -m 0755 ${WORKDIR}/resolv ${D}${sysconfdir}/network/if-up.d/resolv
|
||||
# Install systemd service
|
||||
install -d ${D}${systemd_unitdir}/system/
|
||||
install -m 0644 ${WORKDIR}/ifupdown.service ${D}${systemd_unitdir}/system/
|
||||
sed -i -e 's,@SBINDIR@,${base_sbindir},g' ${D}${systemd_unitdir}/system/ifupdown.service
|
||||
|
||||
if [ -n "${HAVE_WIFI}" ]; then
|
||||
if [ -n "${WLAN_P2P_INTERFACE}" ]; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue