From a8d26915e8776eb94adeb87de1d23a148cdb2265 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 30 Mar 2017 12:39:45 -0700 Subject: arptables: Upgrade to 0.0.4 Switch the SRC_URI to git based fetcher Signed-off-by: Khem Raj Signed-off-by: Joe MacDonald --- .../arptables-arpt-get-target-fix.patch | 30 -------- .../arptables-compile-install.patch | 61 ----------------- .../arptables-0.0.3-4/arptables-init-busybox.patch | 77 --------------------- .../arptables-remove-bashism.patch | 37 ---------- .../arptables/arptables-0.0.3-4/arptables.service | 16 ----- ...FLAGS-for-package-specific-compiler-flags.patch | 79 ++++++++++++++++++++++ .../arptables/arptables-arpt-get-target-fix.patch | 30 ++++++++ .../arptables/arptables-init-busybox.patch | 77 +++++++++++++++++++++ .../arptables/arptables-remove-bashism.patch | 37 ++++++++++ .../arptables/arptables/arptables.service | 16 +++++ .../recipes-support/arptables/arptables_0.0.3-4.bb | 43 ------------ .../recipes-support/arptables/arptables_git.bb | 38 +++++++++++ 12 files changed, 277 insertions(+), 264 deletions(-) delete mode 100644 meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch delete mode 100644 meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch delete mode 100644 meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch delete mode 100644 meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch delete mode 100644 meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service create mode 100644 meta-networking/recipes-support/arptables/arptables/0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch create mode 100644 meta-networking/recipes-support/arptables/arptables/arptables-arpt-get-target-fix.patch create mode 100644 meta-networking/recipes-support/arptables/arptables/arptables-init-busybox.patch create mode 100644 meta-networking/recipes-support/arptables/arptables/arptables-remove-bashism.patch create mode 100644 meta-networking/recipes-support/arptables/arptables/arptables.service delete mode 100644 meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb create mode 100644 meta-networking/recipes-support/arptables/arptables_git.bb (limited to 'meta-networking') diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch deleted file mode 100644 index 0875344feb..0000000000 --- a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch +++ /dev/null @@ -1,30 +0,0 @@ -arptables: fix the redefinition of 'arpt_get_target' - -Upstream-Status: Pending - -This function is already defined as a static inline function in -include/linux/netfilter_arp/arp_tables.h, once GCC uses -O0, the -inline will not work, and the redefinition error will happen - -Signed-off-by: Aws Ismail -Signed-off-by: Roy.Li - -diff --git a/libarptc/libarptc_incl.c b/libarptc/libarptc_incl.c -index 35736db..addd3f9 100644 ---- a/libarptc/libarptc_incl.c -+++ b/libarptc/libarptc_incl.c -@@ -11,14 +11,6 @@ - /* (C)1999 Paul ``Rusty'' Russell - Placed under the GNU GPL (See - COPYING for details). */ - --#ifndef __OPTIMIZE__ --STRUCT_ENTRY_TARGET * --GET_TARGET(STRUCT_ENTRY *e) --{ -- return (void *)e + e->target_offset; --} --#endif -- - static int sockfd = -1; - static void *arptc_fn = NULL; - diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch deleted file mode 100644 index 80e9804724..0000000000 --- a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch +++ /dev/null @@ -1,61 +0,0 @@ -Index: arptables-v0.0.3-4/Makefile -=================================================================== ---- arptables-v0.0.3-4.orig/Makefile 2010-03-08 18:49:28.000000000 +0300 -+++ arptables-v0.0.3-4/Makefile 2010-03-22 15:52:56.000000000 +0300 -@@ -6,12 +6,11 @@ - LIBDIR:=$(PREFIX)/lib - BINDIR:=$(PREFIX)/sbin - MANDIR:=$(PREFIX)/man --INITDIR:=/etc/rc.d/init.d -+INITDIR:=/etc/init.d - SYSCONFIGDIR:=/etc/sysconfig - DESTDIR:= - --COPT_FLAGS:=-O2 --CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG -+ARPCFLAGS:=-Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" - - ifndef ARPT_LIBDIR - ARPT_LIBDIR:=$(LIBDIR)/arptables -@@ -22,16 +21,16 @@ - all: arptables - - arptables.o: arptables.c -- $(CC) $(CFLAGS) -c -o $@ $< -+ $(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $< - - arptables-standalone.o: arptables-standalone.c -- $(CC) $(CFLAGS) -c -o $@ $< -+ $(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $< - - libarptc/libarptc.o: libarptc/libarptc.c libarptc/libarptc_incl.c -- $(CC) $(CFLAGS) -c -o $@ $< -+ $(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $< - - arptables: arptables-standalone.o arptables.o libarptc/libarptc.o $(EXT_OBJS) -- $(CC) $(CFLAGS) -o $@ $^ -+ $(CC) $(LDFLAGS) $(CFLAGS) $(ARPCFLAGS) -o $@ $^ - - $(DESTDIR)$(MANDIR)/man8/arptables.8: arptables.8 - mkdir -p $(@D) -@@ -50,6 +49,7 @@ - cat arptables-restore | sed 's/__EXEC_PATH__/$(tmp1)/g' > arptables-restore_ - install -m 0755 -o root -g root arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-restore - cat arptables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > arptables.sysv_ -+ install -d $(DESTDIR)$(INITDIR) - if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi - rm -f arptables-save_ arptables-restore_ arptables.sysv_ - -Index: arptables-v0.0.3-4/extensions/Makefile -=================================================================== ---- arptables-v0.0.3-4.orig/extensions/Makefile 2010-03-08 18:49:28.000000000 +0300 -+++ arptables-v0.0.3-4/extensions/Makefile 2010-03-22 15:52:38.000000000 +0300 -@@ -4,4 +4,7 @@ - EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o) - - extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h -- $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< -+ $(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $< -+ -+extensions/arpt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h -+ $(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $< diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch deleted file mode 100644 index 24956c4ca9..0000000000 --- a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch +++ /dev/null @@ -1,77 +0,0 @@ -Index: arptables-v0.0.3-4/arptables.sysv -=================================================================== ---- arptables-v0.0.3-4.orig/arptables.sysv 2010-03-22 16:28:03.000000000 +0300 -+++ arptables-v0.0.3-4/arptables.sysv 2010-03-22 16:27:51.000000000 +0300 -@@ -12,10 +12,10 @@ - # config: __SYSCONFIG__/arptables - - source /etc/init.d/functions --source /etc/sysconfig/network -+# source /etc/sysconfig/network - - # Check that networking is up. --[ ${NETWORKING} = "no" ] && exit 0 -+# [ ${NETWORKING} = "no" ] && exit 0 - - [ -x __EXEC_PATH__/arptables ] || exit 1 - [ -x __EXEC_PATH__/arptables-save ] || exit 1 -@@ -28,32 +28,30 @@ - desc="Arp filtering" - - start() { -- echo -n $"Starting $desc ($prog): " -+ echo -n "Starting $desc ($prog): " - __EXEC_PATH__/arptables-restore < __SYSCONFIG__/arptables || RETVAL=1 - - if [ $RETVAL -eq 0 ]; then -- success "$prog startup" -- rm -f /var/lock/subsys/$prog -+ echo "$prog ok" -+ touch /var/lock/subsys/$prog - else -- failure "$prog startup" -+ echo "$prog failed" - fi - -- echo - return $RETVAL - } - - stop() { -- echo -n $"Stopping $desc ($prog): " -+ echo -n "Stopping $desc ($prog): " - __EXEC_PATH__/arptables-restore < /dev/null || RETVAL=1 - - if [ $RETVAL -eq 0 ]; then -- success "$prog shutdown" -- rm -f %{_localstatedir}/lock/subsys/$prog -+ echo "$prog stopped" -+ rm -f /var/lock/subsys/$prog - else -- failure "$prog shutdown" -+ echo "$prog failed to stop" - fi - -- echo - return $RETVAL - } - -@@ -63,15 +61,14 @@ - } - - save() { -- echo -n $"Saving $desc ($prog): " -+ echo -n "Saving $desc ($prog): " - __EXEC_PATH__/arptables-save > __SYSCONFIG__/arptables || RETVAL=1 - - if [ $RETVAL -eq 0 ]; then -- success "$prog saved" -+ echo "$prog saved" - else -- failure "$prog saved" -+ echo "$prog is not saved" - fi -- echo - } - - case "$1" in diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch deleted file mode 100644 index f332658bcd..0000000000 --- a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch +++ /dev/null @@ -1,37 +0,0 @@ -From cd312bc0e3686404428878d23b8888cba09a20e1 Mon Sep 17 00:00:00 2001 -From: Robert Yang -Date: Thu, 18 Sep 2014 19:46:58 -0700 -Subject: [PATCH] arptables.sysv: remove bashism - -Use "." to replace of "source", and change /bin/bash to /bin/sh, the -echo $"foo" works well in busybox. - -Upstream-Status: Pending - -Signed-off-by: Robert Yang ---- - arptables.sysv | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/arptables.sysv b/arptables.sysv -index 7a90bd2..7710376 100644 ---- a/arptables.sysv -+++ b/arptables.sysv -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/bin/sh - # - # init script for arptables - # -@@ -11,7 +11,7 @@ - # - # config: __SYSCONFIG__/arptables - --source /etc/init.d/functions -+. /etc/init.d/functions - # source /etc/sysconfig/network - - # Check that networking is up. --- -1.7.9.5 - 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 deleted file mode 100644 index f9fd56df01..0000000000 --- a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=Arp filtering arptables -After=network.target -Requires=network.target - -[Service] -Type=oneshot -ExecStartPre=/bin/sh -c "mkdir -p /etc/sysconfig; if [ ! -f /etc/sysconfig/arptables ]; then /usr/sbin/arptables-save > /etc/sysconfig/arptables; fi" -ExecStart=/bin/sh -c "/usr/sbin/arptables-restore < /etc/sysconfig/arptables" -ExecStartPost=/bin/sh -c "touch /var/lock/subsys/arptables" -RemainAfterExit=yes -ExecStop=/bin/sh -c "/usr/sbin/arptables-restore < /dev/null" -ExecStopPost=/bin/sh -c "rm -f /var/lock/subsys/arptables" - -[Install] -WantedBy=multi-user.target diff --git a/meta-networking/recipes-support/arptables/arptables/0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch b/meta-networking/recipes-support/arptables/arptables/0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch new file mode 100644 index 0000000000..e8be45e6b6 --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables/0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch @@ -0,0 +1,79 @@ +From a2021f0bc0f029dfa05dcca5db3d2ec77904d41a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 30 Mar 2017 12:33:51 -0700 +Subject: [PATCH] Use ARPCFLAGS for package specific compiler flags + +This leaves room for setting CFLAGS in environment +which OE uses to pass tweaks + +Signed-off-by: Khem Raj +--- + Makefile | 15 +++++++-------- + extensions/Makefile | 5 ++++- + 2 files changed, 11 insertions(+), 9 deletions(-) + +diff --git a/Makefile b/Makefile +index 7bead0d..336db6b 100644 +--- a/Makefile ++++ b/Makefile +@@ -7,15 +7,13 @@ LIBDIR:=$(PREFIX)/lib + BINDIR:=$(PREFIX)/sbin + MANDIR:=$(PREFIX)/man + man8dir=$(MANDIR)/man8 +-INITDIR:=/etc/rc.d/init.d ++INITDIR:=/etc/init.d + SYSCONFIGDIR:=/etc/sysconfig + DESTDIR:= + + MANS = arptables.8 arptables-save.8 arptables-restore.8 + +-COPT_FLAGS:=-O2 +-CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG +- ++ARPCFLAGS:=-Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" + ifndef ARPT_LIBDIR + ARPT_LIBDIR:=$(LIBDIR)/arptables + endif +@@ -25,13 +23,13 @@ include extensions/Makefile + all: arptables libarptc/libarptc.a + + arptables.o: arptables.c +- $(CC) $(CFLAGS) -c -o $@ $< ++ $(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $< + + arptables-standalone.o: arptables-standalone.c +- $(CC) $(CFLAGS) -c -o $@ $< ++ $(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $< + + libarptc/libarptc.o: libarptc/libarptc.c libarptc/libarptc_incl.c +- $(CC) $(CFLAGS) -c -o $@ $< ++ $(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $< + + libarptc/libarptc.a: libarptc/libarptc.o + $(AR) rcs $@ $< +@@ -53,7 +51,8 @@ scripts: arptables-save arptables-restore arptables.sysv + install -m 0755 arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-restore + cat arptables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > arptables.sysv_ + if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi +- if test -d $(DESTDIR)$(INITDIR); then install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi ++ install -d $(DESTDIR)$(INITDIR) ++ install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables + rm -f arptables-save_ arptables-restore_ arptables.sysv_ + + .PHONY: install-man +diff --git a/extensions/Makefile b/extensions/Makefile +index 0189cc9..b046425 100644 +--- a/extensions/Makefile ++++ b/extensions/Makefile +@@ -4,4 +4,7 @@ EXT_FUNC+=standard mangle CLASSIFY MARK + EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o) + + extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h +- $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< ++ $(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $< ++ ++extensions/arpt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h ++ $(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $< +-- +2.12.1 + diff --git a/meta-networking/recipes-support/arptables/arptables/arptables-arpt-get-target-fix.patch b/meta-networking/recipes-support/arptables/arptables/arptables-arpt-get-target-fix.patch new file mode 100644 index 0000000000..0875344feb --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables/arptables-arpt-get-target-fix.patch @@ -0,0 +1,30 @@ +arptables: fix the redefinition of 'arpt_get_target' + +Upstream-Status: Pending + +This function is already defined as a static inline function in +include/linux/netfilter_arp/arp_tables.h, once GCC uses -O0, the +inline will not work, and the redefinition error will happen + +Signed-off-by: Aws Ismail +Signed-off-by: Roy.Li + +diff --git a/libarptc/libarptc_incl.c b/libarptc/libarptc_incl.c +index 35736db..addd3f9 100644 +--- a/libarptc/libarptc_incl.c ++++ b/libarptc/libarptc_incl.c +@@ -11,14 +11,6 @@ + /* (C)1999 Paul ``Rusty'' Russell - Placed under the GNU GPL (See + COPYING for details). */ + +-#ifndef __OPTIMIZE__ +-STRUCT_ENTRY_TARGET * +-GET_TARGET(STRUCT_ENTRY *e) +-{ +- return (void *)e + e->target_offset; +-} +-#endif +- + static int sockfd = -1; + static void *arptc_fn = NULL; + diff --git a/meta-networking/recipes-support/arptables/arptables/arptables-init-busybox.patch b/meta-networking/recipes-support/arptables/arptables/arptables-init-busybox.patch new file mode 100644 index 0000000000..24956c4ca9 --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables/arptables-init-busybox.patch @@ -0,0 +1,77 @@ +Index: arptables-v0.0.3-4/arptables.sysv +=================================================================== +--- arptables-v0.0.3-4.orig/arptables.sysv 2010-03-22 16:28:03.000000000 +0300 ++++ arptables-v0.0.3-4/arptables.sysv 2010-03-22 16:27:51.000000000 +0300 +@@ -12,10 +12,10 @@ + # config: __SYSCONFIG__/arptables + + source /etc/init.d/functions +-source /etc/sysconfig/network ++# source /etc/sysconfig/network + + # Check that networking is up. +-[ ${NETWORKING} = "no" ] && exit 0 ++# [ ${NETWORKING} = "no" ] && exit 0 + + [ -x __EXEC_PATH__/arptables ] || exit 1 + [ -x __EXEC_PATH__/arptables-save ] || exit 1 +@@ -28,32 +28,30 @@ + desc="Arp filtering" + + start() { +- echo -n $"Starting $desc ($prog): " ++ echo -n "Starting $desc ($prog): " + __EXEC_PATH__/arptables-restore < __SYSCONFIG__/arptables || RETVAL=1 + + if [ $RETVAL -eq 0 ]; then +- success "$prog startup" +- rm -f /var/lock/subsys/$prog ++ echo "$prog ok" ++ touch /var/lock/subsys/$prog + else +- failure "$prog startup" ++ echo "$prog failed" + fi + +- echo + return $RETVAL + } + + stop() { +- echo -n $"Stopping $desc ($prog): " ++ echo -n "Stopping $desc ($prog): " + __EXEC_PATH__/arptables-restore < /dev/null || RETVAL=1 + + if [ $RETVAL -eq 0 ]; then +- success "$prog shutdown" +- rm -f %{_localstatedir}/lock/subsys/$prog ++ echo "$prog stopped" ++ rm -f /var/lock/subsys/$prog + else +- failure "$prog shutdown" ++ echo "$prog failed to stop" + fi + +- echo + return $RETVAL + } + +@@ -63,15 +61,14 @@ + } + + save() { +- echo -n $"Saving $desc ($prog): " ++ echo -n "Saving $desc ($prog): " + __EXEC_PATH__/arptables-save > __SYSCONFIG__/arptables || RETVAL=1 + + if [ $RETVAL -eq 0 ]; then +- success "$prog saved" ++ echo "$prog saved" + else +- failure "$prog saved" ++ echo "$prog is not saved" + fi +- echo + } + + case "$1" in diff --git a/meta-networking/recipes-support/arptables/arptables/arptables-remove-bashism.patch b/meta-networking/recipes-support/arptables/arptables/arptables-remove-bashism.patch new file mode 100644 index 0000000000..f332658bcd --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables/arptables-remove-bashism.patch @@ -0,0 +1,37 @@ +From cd312bc0e3686404428878d23b8888cba09a20e1 Mon Sep 17 00:00:00 2001 +From: Robert Yang +Date: Thu, 18 Sep 2014 19:46:58 -0700 +Subject: [PATCH] arptables.sysv: remove bashism + +Use "." to replace of "source", and change /bin/bash to /bin/sh, the +echo $"foo" works well in busybox. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang +--- + arptables.sysv | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arptables.sysv b/arptables.sysv +index 7a90bd2..7710376 100644 +--- a/arptables.sysv ++++ b/arptables.sysv +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # + # init script for arptables + # +@@ -11,7 +11,7 @@ + # + # config: __SYSCONFIG__/arptables + +-source /etc/init.d/functions ++. /etc/init.d/functions + # source /etc/sysconfig/network + + # Check that networking is up. +-- +1.7.9.5 + diff --git a/meta-networking/recipes-support/arptables/arptables/arptables.service b/meta-networking/recipes-support/arptables/arptables/arptables.service new file mode 100644 index 0000000000..f9fd56df01 --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables/arptables.service @@ -0,0 +1,16 @@ +[Unit] +Description=Arp filtering arptables +After=network.target +Requires=network.target + +[Service] +Type=oneshot +ExecStartPre=/bin/sh -c "mkdir -p /etc/sysconfig; if [ ! -f /etc/sysconfig/arptables ]; then /usr/sbin/arptables-save > /etc/sysconfig/arptables; fi" +ExecStart=/bin/sh -c "/usr/sbin/arptables-restore < /etc/sysconfig/arptables" +ExecStartPost=/bin/sh -c "touch /var/lock/subsys/arptables" +RemainAfterExit=yes +ExecStop=/bin/sh -c "/usr/sbin/arptables-restore < /dev/null" +ExecStopPost=/bin/sh -c "rm -f /var/lock/subsys/arptables" + +[Install] +WantedBy=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 deleted file mode 100644 index f53640847a..0000000000 --- a/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb +++ /dev/null @@ -1,43 +0,0 @@ -SUMMARY = "Administration tool for arp packet filtering" -LICENSE = "GPL-2.0" -SECTION = "net" - -PR = "r2" - -RDEPENDS_${PN} += "perl" - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" -SRC_URI = " \ - ${SOURCEFORGE_MIRROR}/ebtables/arptables-v${PV}.tar.gz;name=arptables \ - file://arptables-compile-install.patch \ - file://arptables-init-busybox.patch \ - file://arptables-arpt-get-target-fix.patch \ - file://arptables-remove-bashism.patch \ - file://arptables.service \ -" -SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5" -SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928" - -S = "${WORKDIR}/arptables-v${PV}" - -do_compile () { - oe_runmake -} - -# the install target is not multi-job safe, but it doesn't do much -# so we just install serially -# -PARALLEL_MAKEINST = "-j1" - -fakeroot do_install () { - oe_runmake 'BINDIR=${sbindir}' 'MANDIR=${mandir}/' 'DESTDIR=${D}' install -} - -do_install_append() { - install -d ${D}${systemd_unitdir}/system - install -m 644 ${WORKDIR}/arptables.service ${D}${systemd_unitdir}/system -} - -inherit systemd - -SYSTEMD_SERVICE_${PN} = "arptables.service" diff --git a/meta-networking/recipes-support/arptables/arptables_git.bb b/meta-networking/recipes-support/arptables/arptables_git.bb new file mode 100644 index 0000000000..274a55d91d --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables_git.bb @@ -0,0 +1,38 @@ +SUMMARY = "Administration tool for arp packet filtering" +SECTION = "net" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" +SRCREV = "f4ab8f63f11a72f14687a6646d04ae1bae3fa45f" +PV = "0.0.4+git${SRCPV}" + +SRC_URI = " \ + git://git.netfilter.org/arptables \ + file://0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch \ + file://arptables-init-busybox.patch \ + file://arptables-arpt-get-target-fix.patch \ + file://arptables-remove-bashism.patch \ + file://arptables.service \ +" +SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5" +SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928" + +S = "${WORKDIR}/git" +SYSTEMD_SERVICE_${PN} = "arptables.service" + +inherit systemd + +EXTRA_OEMAKE = "'BINDIR=${sbindir}' 'MANDIR=${mandir}'" + +do_install_append() { + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${systemd_unitdir}/system + install -m 644 ${WORKDIR}/arptables.service ${D}${systemd_unitdir}/system + fi +} + +RDEPENDS_${PN} += "perl" + +# the install target is not multi-job safe, but it doesn't do much +# so we just install serially +# +PARALLEL_MAKEINST = "-j1" -- cgit 1.2.3-korg