summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support
diff options
context:
space:
mode:
authorLi Zhou <li.zhou@windriver.com>2016-09-26 10:24:28 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2016-10-20 11:17:01 -0400
commita0e2240e0a7300dfc20b11e7057156158c42aca9 (patch)
tree97b9d92119861d9ddbc9ee4287ad48e323ae019a /meta-networking/recipes-support
parent93b0d657931c9ea7a6fc0df8ca9925a0fa7a80cc (diff)
downloadmeta-openembedded-a0e2240e0a7300dfc20b11e7057156158c42aca9.tar.gz
arptables: add arptables systemd service file
Add arptables systemd service file. If there isn't any configuration file (/etc/sysconfig/arptables), add a default configuration file. Signed-off-by: Li Zhou <li.zhou@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-support')
-rw-r--r--meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service16
-rw-r--r--meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb10
2 files changed, 26 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service
new file mode 100644
index 000000000..fa6434265
--- /dev/null
+++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service
@@ -0,0 +1,16 @@
1[Unit]
2Description=Arp filtering arptables
3After=network.target
4Requires=network.target
5
6[Service]
7Type=oneshot
8ExecStartPre=/bin/sh -c "if [ ! -f /etc/sysconfig/arptables ]; then /usr/sbin/arptables-save > /etc/sysconfig/arptables; fi"
9ExecStart=/bin/sh -c "/usr/sbin/arptables-restore < /etc/sysconfig/arptables"
10ExecStartPost=/bin/sh -c "touch /var/lock/subsys/arptables"
11RemainAfterExit=yes
12ExecStop=/bin/sh -c "/usr/sbin/arptables-restore < /dev/null"
13ExecStopPost=/bin/sh -c "rm -f /var/lock/subsys/arptables"
14
15[Install]
16WantedBy=multi-user.target
diff --git a/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb b/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb
index be2ac6659..f53640847 100644
--- a/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb
+++ b/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb
@@ -13,6 +13,7 @@ SRC_URI = " \
13 file://arptables-init-busybox.patch \ 13 file://arptables-init-busybox.patch \
14 file://arptables-arpt-get-target-fix.patch \ 14 file://arptables-arpt-get-target-fix.patch \
15 file://arptables-remove-bashism.patch \ 15 file://arptables-remove-bashism.patch \
16 file://arptables.service \
16" 17"
17SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5" 18SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5"
18SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928" 19SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928"
@@ -31,3 +32,12 @@ PARALLEL_MAKEINST = "-j1"
31fakeroot do_install () { 32fakeroot do_install () {
32 oe_runmake 'BINDIR=${sbindir}' 'MANDIR=${mandir}/' 'DESTDIR=${D}' install 33 oe_runmake 'BINDIR=${sbindir}' 'MANDIR=${mandir}/' 'DESTDIR=${D}' install
33} 34}
35
36do_install_append() {
37 install -d ${D}${systemd_unitdir}/system
38 install -m 644 ${WORKDIR}/arptables.service ${D}${systemd_unitdir}/system
39}
40
41inherit systemd
42
43SYSTEMD_SERVICE_${PN} = "arptables.service"