diff options
3 files changed, 209 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/firewalld/files/0001-fix-building-in-a-separate-directory-outside-the-sou.patch b/meta-networking/recipes-connectivity/firewalld/files/0001-fix-building-in-a-separate-directory-outside-the-sou.patch new file mode 100644 index 0000000000..3f34ff2e4c --- /dev/null +++ b/meta-networking/recipes-connectivity/firewalld/files/0001-fix-building-in-a-separate-directory-outside-the-sou.patch | |||
@@ -0,0 +1,77 @@ | |||
1 | firewalld: fix building in a separate directory outside the source tree | ||
2 | |||
3 | Upstream-Status: Submitted [https://github.com/firewalld/firewalld/pull/456] | ||
4 | Signed-off-by: Dan Callaghan <dan.callaghan@opengear.com> | ||
5 | |||
6 | diff --git a/config/Makefile.am b/config/Makefile.am | ||
7 | index 7048d2ee..5270d408 100644 | ||
8 | --- a/config/Makefile.am | ||
9 | +++ b/config/Makefile.am | ||
10 | @@ -377,11 +377,11 @@ install-config: | ||
11 | $(MKDIR_P) $(DESTDIR)$(sconfdir)/zones | ||
12 | $(MKDIR_P) $(DESTDIR)$(sconfdir)/helpers | ||
13 | $(MKDIR_P) $(DESTDIR)$(prefixlibdir) | ||
14 | - cp -r icmptypes $(DESTDIR)$(prefixlibdir) | ||
15 | - cp -r ipsets $(DESTDIR)$(prefixlibdir) | ||
16 | - cp -r services $(DESTDIR)$(prefixlibdir) | ||
17 | - cp -r zones $(DESTDIR)$(prefixlibdir) | ||
18 | - cp -r helpers $(DESTDIR)$(prefixlibdir) | ||
19 | + cp -r $(srcdir)/icmptypes $(DESTDIR)$(prefixlibdir) | ||
20 | + cp -r $(srcdir)/ipsets $(DESTDIR)$(prefixlibdir) | ||
21 | + cp -r $(srcdir)/services $(DESTDIR)$(prefixlibdir) | ||
22 | + cp -r $(srcdir)/zones $(DESTDIR)$(prefixlibdir) | ||
23 | + cp -r $(srcdir)/helpers $(DESTDIR)$(prefixlibdir) | ||
24 | |||
25 | uninstall-config: | ||
26 | rmdir $(DESTDIR)$(sconfdir)/icmptypes | ||
27 | diff --git a/doc/xml/Makefile.am b/doc/xml/Makefile.am | ||
28 | index 8c93ab9c..d0313e3e 100644 | ||
29 | --- a/doc/xml/Makefile.am | ||
30 | +++ b/doc/xml/Makefile.am | ||
31 | @@ -69,7 +69,8 @@ edit = sed \ | ||
32 | -e 's|\@PREFIX\@|$(prefix)|' \ | ||
33 | -e 's|\@SYSCONFDIR\@|$(sysconfdir)|' \ | ||
34 | -e 's|\@PACKAGE_STRING\@|$(PACKAGE_STRING)|' \ | ||
35 | - -e 's|\@IFCFGDIR\@|$(IFCFGDIR)|' | ||
36 | + -e 's|\@IFCFGDIR\@|$(IFCFGDIR)|' \ | ||
37 | + -e 's|@SRCDIR@|$(srcdir)|' | ||
38 | |||
39 | transform-man.xsl: transform-man.xsl.in | ||
40 | $(edit) $< >$@ | ||
41 | diff --git a/doc/xml/firewall-cmd.xml.in b/doc/xml/firewall-cmd.xml.in | ||
42 | index c2606553..24d77858 100644 | ||
43 | --- a/doc/xml/firewall-cmd.xml.in | ||
44 | +++ b/doc/xml/firewall-cmd.xml.in | ||
45 | @@ -1,9 +1,9 @@ | ||
46 | <?xml version="1.0" encoding="utf-8"?> | ||
47 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" | ||
48 | [ | ||
49 | -<!ENTITY authors SYSTEM "authors.xml"> | ||
50 | -<!ENTITY seealso SYSTEM "seealso.xml"> | ||
51 | -<!ENTITY notes SYSTEM "notes.xml"> | ||
52 | +<!ENTITY authors SYSTEM "@SRCDIR@/authors.xml"> | ||
53 | +<!ENTITY seealso SYSTEM "@SRCDIR@/seealso.xml"> | ||
54 | +<!ENTITY notes SYSTEM "@SRCDIR@/notes.xml"> | ||
55 | <!ENTITY errorcodes SYSTEM "errorcodes.xml"> | ||
56 | ]> | ||
57 | |||
58 | diff --git a/doc/xml/firewalld.xml.in b/doc/xml/firewalld.xml.in | ||
59 | index de802059..3d319b04 100644 | ||
60 | --- a/doc/xml/firewalld.xml.in | ||
61 | +++ b/doc/xml/firewalld.xml.in | ||
62 | @@ -1,9 +1,9 @@ | ||
63 | <?xml version="1.0" encoding="utf-8"?> | ||
64 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" | ||
65 | [ | ||
66 | -<!ENTITY authors SYSTEM "authors.xml"> | ||
67 | -<!ENTITY seealso SYSTEM "seealso.xml"> | ||
68 | -<!ENTITY notes SYSTEM "notes.xml"> | ||
69 | +<!ENTITY authors SYSTEM "@SRCDIR@/authors.xml"> | ||
70 | +<!ENTITY seealso SYSTEM "@SRCDIR@/seealso.xml"> | ||
71 | +<!ENTITY notes SYSTEM "@SRCDIR@/notes.xml"> | ||
72 | ]> | ||
73 | |||
74 | <!-- | ||
75 | -- | ||
76 | 2.20.1 | ||
77 | |||
diff --git a/meta-networking/recipes-connectivity/firewalld/files/firewalld.init b/meta-networking/recipes-connectivity/firewalld/files/firewalld.init new file mode 100644 index 0000000000..08e8930b97 --- /dev/null +++ b/meta-networking/recipes-connectivity/firewalld/files/firewalld.init | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: firewalld | ||
5 | # Required-Start: $syslog $local_fs messagebus | ||
6 | # Required-Stop: | ||
7 | # Default-Start: 2 3 4 5 | ||
8 | # Default-Stop: 0 1 6 | ||
9 | # Short-Description: | ||
10 | # Description: | ||
11 | ### END INIT INFO | ||
12 | |||
13 | . /etc/init.d/functions | ||
14 | |||
15 | firewalld=/usr/sbin/firewalld | ||
16 | pidfile=/var/run/firewalld.pid | ||
17 | |||
18 | case "$1" in | ||
19 | start) | ||
20 | echo -n "Starting firewalld: " | ||
21 | start-stop-daemon --start --quiet --exec $firewalld | ||
22 | echo "." | ||
23 | ;; | ||
24 | stop) | ||
25 | echo -n "Stopping firewalld: " | ||
26 | start-stop-daemon --stop --quiet --pidfile $pidfile | ||
27 | echo "." | ||
28 | ;; | ||
29 | restart) | ||
30 | echo -n "Stopping firewalld: " | ||
31 | start-stop-daemon --stop --quiet --pidfile $pidfile | ||
32 | echo "." | ||
33 | echo -n "Starting firewalld: " | ||
34 | start-stop-daemon --start --quiet --exec $firewalld | ||
35 | echo "." | ||
36 | ;; | ||
37 | reload) | ||
38 | echo -n "Reloading firewalld: " | ||
39 | firewall-cmd --reload | ||
40 | echo "." | ||
41 | ;; | ||
42 | status) | ||
43 | firewall-cmd --state | ||
44 | ;; | ||
45 | *) | ||
46 | echo "Usage: /etc/init.d/firewalld {start|stop|restart|reload|status}" >&2 | ||
47 | exit 1 | ||
48 | esac | ||
diff --git a/meta-networking/recipes-connectivity/firewalld/firewalld_0.6.3.bb b/meta-networking/recipes-connectivity/firewalld/firewalld_0.6.3.bb new file mode 100644 index 0000000000..e999fa7a5d --- /dev/null +++ b/meta-networking/recipes-connectivity/firewalld/firewalld_0.6.3.bb | |||
@@ -0,0 +1,84 @@ | |||
1 | SUMMARY = "Dynamic firewall daemon with a D-Bus interface" | ||
2 | HOMEPAGE = "https://firewalld.org/" | ||
3 | BUGTRACKER = "https://github.com/firewalld/firewalld/issues" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
6 | |||
7 | SRC_URI = "https://github.com/firewalld/firewalld/archive/v${PV}.tar.gz \ | ||
8 | file://firewalld.init \ | ||
9 | file://0001-fix-building-in-a-separate-directory-outside-the-sou.patch \ | ||
10 | " | ||
11 | SRC_URI[md5sum] = "5ef954d9b6b244ffeabcd226be1867a0" | ||
12 | SRC_URI[sha256sum] = "039ad56ea6d6553aadf33243ea5b39802d73519e46a89c80c648b2bd1ec78aeb" | ||
13 | |||
14 | # glib-2.0-native is needed for GSETTINGS_RULES autoconf macro from gsettings.m4 | ||
15 | # xmlto-native is needed to populate /etc/xml/catalog.xml in the sysroot so that xsltproc finds the docbook xslt | ||
16 | DEPENDS = "intltool-native glib-2.0-native libxslt-native docbook-xsl-stylesheets-native xmlto-native" | ||
17 | |||
18 | inherit gettext autotools bash-completion python3native gsettings systemd update-rc.d | ||
19 | |||
20 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" | ||
21 | PACKAGECONFIG[systemd] = "--with-systemd-unitdir=${systemd_unitdir}/system/,--disable-systemd" | ||
22 | |||
23 | # iptables, ip6tables, ebtables, and ipset *should* be unnecessary | ||
24 | # when the nftables backend is available, because nftables supersedes all of them. | ||
25 | # However we still need iptables and ip6tables to be available otherwise any | ||
26 | # application relying on "direct passthrough" rules (such as docker) will break. | ||
27 | # /etc/sysconfig/firewalld is a Red Hat-ism, only referenced by | ||
28 | # the Red Hat-specific init script which we aren't using, so we disable that. | ||
29 | EXTRA_OECONF = "\ | ||
30 | --with-nft=${sbindir}/nft \ | ||
31 | --without-ipset \ | ||
32 | --with-iptables=${sbindir}/iptables \ | ||
33 | --with-iptables-restore=${sbindir}/iptables-restore \ | ||
34 | --with-ip6tables=${sbindir}/ip6tables \ | ||
35 | --with-ip6tables-restore=${sbindir}/ip6tables-restore \ | ||
36 | --without-ebtables \ | ||
37 | --without-ebtables-restore \ | ||
38 | --disable-sysconfig \ | ||
39 | " | ||
40 | |||
41 | INITSCRIPT_NAME = "firewalld" | ||
42 | SYSTEMD_SERVICE = "firewalld.service" | ||
43 | |||
44 | do_install_append() { | ||
45 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
46 | : | ||
47 | else | ||
48 | # firewalld ships an init script but it contains Red Hat-isms, replace it with our own | ||
49 | rm -rf ${D}${sysconfdir}/rc.d/ | ||
50 | install -d ${D}${sysconfdir}/init.d | ||
51 | install -m0755 ${WORKDIR}/firewalld.init ${D}${sysconfdir}/init.d/firewalld | ||
52 | fi | ||
53 | |||
54 | # We ran ./configure with PYTHON pointed at the binary inside $STAGING_BINDIR_NATIVE | ||
55 | # so now we need to fix up any references to point at the proper path in the image. | ||
56 | # This hack is also in distutils.bbclass, but firewalld doesn't use distutils/setuptools. | ||
57 | if [ ${PN} != "${BPN}-native" ]; then | ||
58 | sed -i -e s:${STAGING_BINDIR_NATIVE}/python3-native/python3:${bindir}/python3:g \ | ||
59 | ${D}${bindir}/* ${D}${sbindir}/* ${D}${sysconfdir}/firewalld/*.xml | ||
60 | fi | ||
61 | sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g \ | ||
62 | ${D}${bindir}/* ${D}${sbindir}/* ${D}${sysconfdir}/firewalld/*.xml | ||
63 | } | ||
64 | |||
65 | FILES_${PN} += "\ | ||
66 | ${PYTHON_SITEPACKAGES_DIR}/firewall \ | ||
67 | ${datadir}/polkit-1 \ | ||
68 | ${datadir}/metainfo \ | ||
69 | " | ||
70 | |||
71 | RDEPENDS_${PN} = "\ | ||
72 | nftables \ | ||
73 | iptables \ | ||
74 | python3-core \ | ||
75 | python3-io \ | ||
76 | python3-fcntl \ | ||
77 | python3-shell \ | ||
78 | python3-syslog \ | ||
79 | python3-xml \ | ||
80 | python3-dbus \ | ||
81 | python3-slip-dbus \ | ||
82 | python3-decorator \ | ||
83 | python3-pygobject \ | ||
84 | " | ||