* [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe
@ 2019-12-05 20:05 Niko Mauno
2019-12-05 20:05 ` [zeus][PATCH 2/3] iptables: Allow overriding rules file location Niko Mauno
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Niko Mauno @ 2019-12-05 20:05 UTC (permalink / raw)
To: openembedded-core
Introduce cosmetic changes to recipe content, most notably
- Change indentation style to four spaces in task statements
- Reorder several entries according to oe-stylize.py suggestions
(From OE-Core rev: c1d162b6165f11b7b5ae5c6066e7683d5e1379fc)
Signed-off-by: Niko Mauno <niko.mauno@iki.fi>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
.../iptables/iptables_1.8.3.bb | 60 +++++++++----------
1 file changed, 29 insertions(+), 31 deletions(-)
diff --git a/meta/recipes-extended/iptables/iptables_1.8.3.bb b/meta/recipes-extended/iptables/iptables_1.8.3.bb
index ff9fcb1b53..563c8ae354 100644
--- a/meta/recipes-extended/iptables/iptables_1.8.3.bb
+++ b/meta/recipes-extended/iptables/iptables_1.8.3.bb
@@ -4,8 +4,9 @@ filtering code in Linux."
HOMEPAGE = "http://www.netfilter.org/"
BUGTRACKER = "http://bugzilla.netfilter.org/"
LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\
- file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc \
+"
SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \
@@ -13,16 +14,16 @@ SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
file://iptables.service \
file://iptables.rules \
"
-
SRC_URI[md5sum] = "29de711d15c040c402cf3038c69ff513"
SRC_URI[sha256sum] = "a23cac034181206b4545f4e7e730e76e08b5f3dd78771ba9645a6756de9cdd80"
+SYSTEMD_SERVICE_${PN} = "iptables.service"
+
inherit autotools pkgconfig systemd
EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR}"
PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
-
PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
# libnfnetlink recipe is in meta-networking layer
@@ -32,9 +33,19 @@ PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--disable-libnfnetlink,libn
PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl"
do_configure_prepend() {
- # Remove some libtool m4 files
- # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
- rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
+ # Remove some libtool m4 files
+ # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
+ rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
+}
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/iptables
+ install -m 0644 ${WORKDIR}/iptables.rules ${D}${sysconfdir}/iptables
+
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/iptables.service ${D}${systemd_system_unitdir}
+
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/iptables.service
}
PACKAGES += "${PN}-modules"
@@ -47,30 +58,6 @@ python populate_packages_prepend() {
d.appendVar('RDEPENDS_' + metapkg, ' ' + ' '.join(modules))
}
-FILES_${PN} += "${datadir}/xtables"
-
-# Include the symlinks as well in respective packages
-FILES_${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so"
-FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so"
-
-INSANE_SKIP_${PN}-module-xt-conntrack = "dev-so"
-INSANE_SKIP_${PN}-module-xt-ct = "dev-so"
-
-ALLOW_EMPTY_${PN}-modules = "1"
-
-do_install_append() {
-
- install -d ${D}${sysconfdir}/iptables
- install -m 0644 ${WORKDIR}/iptables.rules ${D}${sysconfdir}/iptables
-
- install -d ${D}${systemd_system_unitdir}
- install -m 0644 ${WORKDIR}/iptables.service ${D}${systemd_system_unitdir}
-
- sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/iptables.service
-}
-
-SYSTEMD_SERVICE_${PN} = "iptables.service"
-
RDEPENDS_${PN} = "${PN}-module-xt-standard"
RRECOMMENDS_${PN} = " \
${PN}-modules \
@@ -84,3 +71,14 @@ RRECOMMENDS_${PN} = " \
kernel-module-nf-nat \
kernel-module-ipt-masquerade \
"
+
+FILES_${PN} += "${datadir}/xtables"
+
+# Include the symlinks as well in respective packages
+FILES_${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so"
+FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so"
+
+ALLOW_EMPTY_${PN}-modules = "1"
+
+INSANE_SKIP_${PN}-module-xt-conntrack = "dev-so"
+INSANE_SKIP_${PN}-module-xt-ct = "dev-so"
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [zeus][PATCH 2/3] iptables: Allow overriding rules file location
2019-12-05 20:05 [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe Niko Mauno
@ 2019-12-05 20:05 ` Niko Mauno
2019-12-05 20:05 ` [zeus][PATCH 3/3] iptables: Add systemd helper unit for IPv6 too Niko Mauno
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Niko Mauno @ 2019-12-05 20:05 UTC (permalink / raw)
To: openembedded-core
In some cases a distribution may want to install rules file into a
location other than /etc/iptables/ so introduce custom recipe-level
IPTABLES_RULES_DIR parameter which allows conveniently overriding
the rules directory location.
(From OE-Core rev: 64eeedcdc586c221e3684861ba85e8e4bc9c5dd1)
Signed-off-by: Niko Mauno <niko.mauno@iki.fi>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
.../iptables/iptables/iptables.service | 4 ++--
meta/recipes-extended/iptables/iptables_1.8.3.bb | 11 ++++++++---
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/meta/recipes-extended/iptables/iptables/iptables.service b/meta/recipes-extended/iptables/iptables/iptables.service
index 041316e457..5a8aa3f298 100644
--- a/meta/recipes-extended/iptables/iptables/iptables.service
+++ b/meta/recipes-extended/iptables/iptables/iptables.service
@@ -5,8 +5,8 @@ Wants=network-pre.target
[Service]
Type=oneshot
-ExecStart=@SBINDIR@/iptables-restore /etc/iptables/iptables.rules
-ExecReload=@SBINDIR@/iptables-restore /etc/iptables/iptables.rules
+ExecStart=@SBINDIR@/iptables-restore @RULESDIR@/iptables.rules
+ExecReload=@SBINDIR@/iptables-restore @RULESDIR@/iptables.rules
RemainAfterExit=yes
[Install]
diff --git a/meta/recipes-extended/iptables/iptables_1.8.3.bb b/meta/recipes-extended/iptables/iptables_1.8.3.bb
index 563c8ae354..73680207b4 100644
--- a/meta/recipes-extended/iptables/iptables_1.8.3.bb
+++ b/meta/recipes-extended/iptables/iptables_1.8.3.bb
@@ -38,14 +38,19 @@ do_configure_prepend() {
rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
}
+IPTABLES_RULES_DIR ?= "${sysconfdir}/${BPN}"
+
do_install_append() {
- install -d ${D}${sysconfdir}/iptables
- install -m 0644 ${WORKDIR}/iptables.rules ${D}${sysconfdir}/iptables
+ install -d ${D}${IPTABLES_RULES_DIR}
+ install -m 0644 ${WORKDIR}/iptables.rules ${D}${IPTABLES_RULES_DIR}
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/iptables.service ${D}${systemd_system_unitdir}
- sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/iptables.service
+ sed -i \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ -e 's,@RULESDIR@,${IPTABLES_RULES_DIR},g' \
+ ${D}${systemd_system_unitdir}/iptables.service
}
PACKAGES += "${PN}-modules"
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [zeus][PATCH 3/3] iptables: Add systemd helper unit for IPv6 too
2019-12-05 20:05 [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe Niko Mauno
2019-12-05 20:05 ` [zeus][PATCH 2/3] iptables: Allow overriding rules file location Niko Mauno
@ 2019-12-05 20:05 ` Niko Mauno
2019-12-05 22:45 ` [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe Peter Kjellerstedt
2019-12-05 23:32 ` akuster808
3 siblings, 0 replies; 7+ messages in thread
From: Niko Mauno @ 2019-12-05 20:05 UTC (permalink / raw)
To: openembedded-core
Commit bc66b2f45ade2c63cfd14d5388f6ca0905a23bb0 added systemd helper
unit for automatic IPv4 rule loading. Complement the effort by adding
systemd helper unit also for automatic IPv6 rule loading.
(From OE-Core rev: 3b8df6b6aba3632de7c3c01c8468fbcedb032493)
Signed-off-by: Niko Mauno <niko.mauno@iki.fi>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
.../iptables/iptables/ip6tables.rules | 0
.../iptables/iptables/ip6tables.service | 13 ++++++++++++
.../iptables/iptables/iptables.service | 6 +++---
.../iptables/iptables_1.8.3.bb | 21 ++++++++++++++++++-
4 files changed, 36 insertions(+), 4 deletions(-)
create mode 100644 meta/recipes-extended/iptables/iptables/ip6tables.rules
create mode 100644 meta/recipes-extended/iptables/iptables/ip6tables.service
diff --git a/meta/recipes-extended/iptables/iptables/ip6tables.rules b/meta/recipes-extended/iptables/iptables/ip6tables.rules
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/meta/recipes-extended/iptables/iptables/ip6tables.service b/meta/recipes-extended/iptables/iptables/ip6tables.service
new file mode 100644
index 0000000000..6c059fca49
--- /dev/null
+++ b/meta/recipes-extended/iptables/iptables/ip6tables.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=IPv6 Packet Filtering Framework
+Before=network-pre.target
+Wants=network-pre.target
+
+[Service]
+Type=oneshot
+ExecStart=@SBINDIR@/ip6tables-restore -w -- @RULESDIR@/ip6tables.rules
+ExecReload=@SBINDIR@/ip6tables-restore -w -- @RULESDIR@/ip6tables.rules
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-extended/iptables/iptables/iptables.service b/meta/recipes-extended/iptables/iptables/iptables.service
index 5a8aa3f298..0eb3c343de 100644
--- a/meta/recipes-extended/iptables/iptables/iptables.service
+++ b/meta/recipes-extended/iptables/iptables/iptables.service
@@ -1,12 +1,12 @@
[Unit]
-Description=Packet Filtering Framework
+Description=IPv4 Packet Filtering Framework
Before=network-pre.target
Wants=network-pre.target
[Service]
Type=oneshot
-ExecStart=@SBINDIR@/iptables-restore @RULESDIR@/iptables.rules
-ExecReload=@SBINDIR@/iptables-restore @RULESDIR@/iptables.rules
+ExecStart=@SBINDIR@/iptables-restore -w -- @RULESDIR@/iptables.rules
+ExecReload=@SBINDIR@/iptables-restore -w -- @RULESDIR@/iptables.rules
RemainAfterExit=yes
[Install]
diff --git a/meta/recipes-extended/iptables/iptables_1.8.3.bb b/meta/recipes-extended/iptables/iptables_1.8.3.bb
index 73680207b4..96d195d9d0 100644
--- a/meta/recipes-extended/iptables/iptables_1.8.3.bb
+++ b/meta/recipes-extended/iptables/iptables_1.8.3.bb
@@ -13,11 +13,16 @@ SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
file://0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch \
file://iptables.service \
file://iptables.rules \
+ file://ip6tables.service \
+ file://ip6tables.rules \
"
SRC_URI[md5sum] = "29de711d15c040c402cf3038c69ff513"
SRC_URI[sha256sum] = "a23cac034181206b4545f4e7e730e76e08b5f3dd78771ba9645a6756de9cdd80"
-SYSTEMD_SERVICE_${PN} = "iptables.service"
+SYSTEMD_SERVICE_${PN} = "\
+ iptables.service \
+ ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', 'ip6tables.service', '', d)} \
+"
inherit autotools pkgconfig systemd
@@ -51,6 +56,16 @@ do_install_append() {
-e 's,@SBINDIR@,${sbindir},g' \
-e 's,@RULESDIR@,${IPTABLES_RULES_DIR},g' \
${D}${systemd_system_unitdir}/iptables.service
+
+ if ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', 'true', 'false', d)} ; then
+ install -m 0644 ${WORKDIR}/ip6tables.rules ${D}${IPTABLES_RULES_DIR}
+ install -m 0644 ${WORKDIR}/ip6tables.service ${D}${systemd_system_unitdir}
+
+ sed -i \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ -e 's,@RULESDIR@,${IPTABLES_RULES_DIR},g' \
+ ${D}${systemd_system_unitdir}/ip6tables.service
+ fi
}
PACKAGES += "${PN}-modules"
@@ -75,6 +90,10 @@ RRECOMMENDS_${PN} = " \
kernel-module-nf-conntrack-ipv4 \
kernel-module-nf-nat \
kernel-module-ipt-masquerade \
+ ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', '\
+ kernel-module-ip6table-filter \
+ kernel-module-ip6-tables \
+ ', '', d)} \
"
FILES_${PN} += "${datadir}/xtables"
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe
2019-12-05 20:05 [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe Niko Mauno
2019-12-05 20:05 ` [zeus][PATCH 2/3] iptables: Allow overriding rules file location Niko Mauno
2019-12-05 20:05 ` [zeus][PATCH 3/3] iptables: Add systemd helper unit for IPv6 too Niko Mauno
@ 2019-12-05 22:45 ` Peter Kjellerstedt
2019-12-10 18:04 ` Niko Mauno
2019-12-05 23:32 ` akuster808
3 siblings, 1 reply; 7+ messages in thread
From: Peter Kjellerstedt @ 2019-12-05 22:45 UTC (permalink / raw)
To: Niko Mauno, openembedded-core
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-
> bounces@lists.openembedded.org> On Behalf Of Niko Mauno
> Sent: den 5 december 2019 21:05
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe
>
> Introduce cosmetic changes to recipe content, most notably
> - Change indentation style to four spaces in task statements
Unless I'm wrong, the standard for shell code in recipes in
OE-Core is still to indent using tabs. (OpenEmbedded on the
other hand uses four spaces for indentation also for shell
code.)
//Peter
> - Reorder several entries according to oe-stylize.py suggestions
>
> (From OE-Core rev: c1d162b6165f11b7b5ae5c6066e7683d5e1379fc)
>
> Signed-off-by: Niko Mauno <niko.mauno@iki.fi>
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> .../iptables/iptables_1.8.3.bb | 60 +++++++++----------
> 1 file changed, 29 insertions(+), 31 deletions(-)
>
> diff --git a/meta/recipes-extended/iptables/iptables_1.8.3.bb
> b/meta/recipes-extended/iptables/iptables_1.8.3.bb
> index ff9fcb1b53..563c8ae354 100644
> --- a/meta/recipes-extended/iptables/iptables_1.8.3.bb
> +++ b/meta/recipes-extended/iptables/iptables_1.8.3.bb
> @@ -4,8 +4,9 @@ filtering code in Linux."
> HOMEPAGE = "http://www.netfilter.org/"
> BUGTRACKER = "http://bugzilla.netfilter.org/"
> LICENSE = "GPLv2+"
> -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\
> -
> file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d
> 0f763df2a12dc"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
> +
> file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d
> 0f763df2a12dc \
> +"
>
> SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-
> ${PV}.tar.bz2 \
> file://0001-configure-Add-option-to-enable-disable-
> libnfnetlink.patch \
> @@ -13,16 +14,16 @@ SRC_URI =
> "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
> file://iptables.service \
> file://iptables.rules \
> "
> -
> SRC_URI[md5sum] = "29de711d15c040c402cf3038c69ff513"
> SRC_URI[sha256sum] =
> "a23cac034181206b4545f4e7e730e76e08b5f3dd78771ba9645a6756de9cdd80"
>
> +SYSTEMD_SERVICE_${PN} = "iptables.service"
> +
> inherit autotools pkgconfig systemd
>
> EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR}"
>
> PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
> -
> PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
>
> # libnfnetlink recipe is in meta-networking layer
> @@ -32,9 +33,19 @@ PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--
> disable-libnfnetlink,libn
> PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl"
>
> do_configure_prepend() {
> - # Remove some libtool m4 files
> - # Keep ax_check_linker_flags.m4 which belongs to autoconf-
> archive.
> - rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4
> ltversion.m4
> + # Remove some libtool m4 files
> + # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
> + rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
> +}
> +
> +do_install_append() {
> + install -d ${D}${sysconfdir}/iptables
> + install -m 0644 ${WORKDIR}/iptables.rules ${D}${sysconfdir}/iptables
> +
> + install -d ${D}${systemd_system_unitdir}
> + install -m 0644 ${WORKDIR}/iptables.service
> ${D}${systemd_system_unitdir}
> +
> + sed -i -e 's,@SBINDIR@,${sbindir},g'
> ${D}${systemd_system_unitdir}/iptables.service
> }
>
> PACKAGES += "${PN}-modules"
> @@ -47,30 +58,6 @@ python populate_packages_prepend() {
> d.appendVar('RDEPENDS_' + metapkg, ' ' + ' '.join(modules))
> }
>
> -FILES_${PN} += "${datadir}/xtables"
> -
> -# Include the symlinks as well in respective packages
> -FILES_${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so"
> -FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so"
> -
> -INSANE_SKIP_${PN}-module-xt-conntrack = "dev-so"
> -INSANE_SKIP_${PN}-module-xt-ct = "dev-so"
> -
> -ALLOW_EMPTY_${PN}-modules = "1"
> -
> -do_install_append() {
> -
> - install -d ${D}${sysconfdir}/iptables
> - install -m 0644 ${WORKDIR}/iptables.rules
> ${D}${sysconfdir}/iptables
> -
> - install -d ${D}${systemd_system_unitdir}
> - install -m 0644 ${WORKDIR}/iptables.service
> ${D}${systemd_system_unitdir}
> -
> - sed -i -e 's,@SBINDIR@,${sbindir},g'
> ${D}${systemd_system_unitdir}/iptables.service
> -}
> -
> -SYSTEMD_SERVICE_${PN} = "iptables.service"
> -
> RDEPENDS_${PN} = "${PN}-module-xt-standard"
> RRECOMMENDS_${PN} = " \
> ${PN}-modules \
> @@ -84,3 +71,14 @@ RRECOMMENDS_${PN} = " \
> kernel-module-nf-nat \
> kernel-module-ipt-masquerade \
> "
> +
> +FILES_${PN} += "${datadir}/xtables"
> +
> +# Include the symlinks as well in respective packages
> +FILES_${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so"
> +FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so"
> +
> +ALLOW_EMPTY_${PN}-modules = "1"
> +
> +INSANE_SKIP_${PN}-module-xt-conntrack = "dev-so"
> +INSANE_SKIP_${PN}-module-xt-ct = "dev-so"
> --
> 2.20.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe
2019-12-05 20:05 [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe Niko Mauno
` (2 preceding siblings ...)
2019-12-05 22:45 ` [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe Peter Kjellerstedt
@ 2019-12-05 23:32 ` akuster808
2019-12-10 19:58 ` Niko Mauno
3 siblings, 1 reply; 7+ messages in thread
From: akuster808 @ 2019-12-05 23:32 UTC (permalink / raw)
To: Niko Mauno, openembedded-core
On 12/5/19 12:05 PM, Niko Mauno wrote:
> Introduce cosmetic changes to recipe content, most notably
> - Change indentation style to four spaces in task statements
> - Reorder several entries according to oe-stylize.py suggestions
>
> (From OE-Core rev: c1d162b6165f11b7b5ae5c6066e7683d5e1379fc)
>
> Signed-off-by: Niko Mauno <niko.mauno@iki.fi>
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
These changes do not pass the 'stable' bar for backporting. Unless a
more compelling reason is give, this series is being "NACKed" at this time.
- armin
> ---
> .../iptables/iptables_1.8.3.bb | 60 +++++++++----------
> 1 file changed, 29 insertions(+), 31 deletions(-)
>
> diff --git a/meta/recipes-extended/iptables/iptables_1.8.3.bb b/meta/recipes-extended/iptables/iptables_1.8.3.bb
> index ff9fcb1b53..563c8ae354 100644
> --- a/meta/recipes-extended/iptables/iptables_1.8.3.bb
> +++ b/meta/recipes-extended/iptables/iptables_1.8.3.bb
> @@ -4,8 +4,9 @@ filtering code in Linux."
> HOMEPAGE = "http://www.netfilter.org/"
> BUGTRACKER = "http://bugzilla.netfilter.org/"
> LICENSE = "GPLv2+"
> -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\
> - file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
> + file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc \
> +"
>
> SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
> file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \
> @@ -13,16 +14,16 @@ SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
> file://iptables.service \
> file://iptables.rules \
> "
> -
> SRC_URI[md5sum] = "29de711d15c040c402cf3038c69ff513"
> SRC_URI[sha256sum] = "a23cac034181206b4545f4e7e730e76e08b5f3dd78771ba9645a6756de9cdd80"
>
> +SYSTEMD_SERVICE_${PN} = "iptables.service"
> +
> inherit autotools pkgconfig systemd
>
> EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR}"
>
> PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
> -
> PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
>
> # libnfnetlink recipe is in meta-networking layer
> @@ -32,9 +33,19 @@ PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--disable-libnfnetlink,libn
> PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl"
>
> do_configure_prepend() {
> - # Remove some libtool m4 files
> - # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
> - rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
> + # Remove some libtool m4 files
> + # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
> + rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
> +}
> +
> +do_install_append() {
> + install -d ${D}${sysconfdir}/iptables
> + install -m 0644 ${WORKDIR}/iptables.rules ${D}${sysconfdir}/iptables
> +
> + install -d ${D}${systemd_system_unitdir}
> + install -m 0644 ${WORKDIR}/iptables.service ${D}${systemd_system_unitdir}
> +
> + sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/iptables.service
> }
>
> PACKAGES += "${PN}-modules"
> @@ -47,30 +58,6 @@ python populate_packages_prepend() {
> d.appendVar('RDEPENDS_' + metapkg, ' ' + ' '.join(modules))
> }
>
> -FILES_${PN} += "${datadir}/xtables"
> -
> -# Include the symlinks as well in respective packages
> -FILES_${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so"
> -FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so"
> -
> -INSANE_SKIP_${PN}-module-xt-conntrack = "dev-so"
> -INSANE_SKIP_${PN}-module-xt-ct = "dev-so"
> -
> -ALLOW_EMPTY_${PN}-modules = "1"
> -
> -do_install_append() {
> -
> - install -d ${D}${sysconfdir}/iptables
> - install -m 0644 ${WORKDIR}/iptables.rules ${D}${sysconfdir}/iptables
> -
> - install -d ${D}${systemd_system_unitdir}
> - install -m 0644 ${WORKDIR}/iptables.service ${D}${systemd_system_unitdir}
> -
> - sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/iptables.service
> -}
> -
> -SYSTEMD_SERVICE_${PN} = "iptables.service"
> -
> RDEPENDS_${PN} = "${PN}-module-xt-standard"
> RRECOMMENDS_${PN} = " \
> ${PN}-modules \
> @@ -84,3 +71,14 @@ RRECOMMENDS_${PN} = " \
> kernel-module-nf-nat \
> kernel-module-ipt-masquerade \
> "
> +
> +FILES_${PN} += "${datadir}/xtables"
> +
> +# Include the symlinks as well in respective packages
> +FILES_${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so"
> +FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so"
> +
> +ALLOW_EMPTY_${PN}-modules = "1"
> +
> +INSANE_SKIP_${PN}-module-xt-conntrack = "dev-so"
> +INSANE_SKIP_${PN}-module-xt-ct = "dev-so"
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe
2019-12-05 22:45 ` [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe Peter Kjellerstedt
@ 2019-12-10 18:04 ` Niko Mauno
0 siblings, 0 replies; 7+ messages in thread
From: Niko Mauno @ 2019-12-10 18:04 UTC (permalink / raw)
To: Peter Kjellerstedt, openembedded-core
On 12/6/19 12:45 AM, Peter Kjellerstedt wrote:
>> -----Original Message-----
>> From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-
>> bounces@lists.openembedded.org> On Behalf Of Niko Mauno
>> Sent: den 5 december 2019 21:05
>> To: openembedded-core@lists.openembedded.org
>> Subject: [OE-core] [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe
>>
>> Introduce cosmetic changes to recipe content, most notably
>> - Change indentation style to four spaces in task statements
>
> Unless I'm wrong, the standard for shell code in recipes in
> OE-Core is still to indent using tabs. (OpenEmbedded on the
> other hand uses four spaces for indentation also for shell
> code.)
>
> //Peter
>
Thanks Peter,
indeed looking at https://www.openembedded.org/wiki/Styleguide#Format_Guidelines mentions that "Shell functions in OE-Core usually use tabs for indentation, but other layers usually use consistent indentation with 4 spaces (in shell functions, python functions and for indentation of multi-line variables)", thus this commits indentation changes in particular could be questioned. I'll try to keep this in mind.
Out of curiousity, I now also looked at current master branch's .bb/.inc files (under poky/meta/recipes-*), and it would seem there's about 150 files which resort to 4-space indentation in shell funcs (excluding here cases of 8-space and even 2-space indentation used in some files). Considering the excerpt, are you aware if there has been any discussion wrt. OE-Core also switching to 4-space indentation prevalent in other layers? Just feels it would make sense as currently e.g. a discontinuity in indentation style is implied when bbappending OE-core shell functions from other layers.
-Niko
>> - Reorder several entries according to oe-stylize.py suggestions
>>
>> (From OE-Core rev: c1d162b6165f11b7b5ae5c6066e7683d5e1379fc)
>>
>> Signed-off-by: Niko Mauno <niko.mauno@iki.fi>
>> Signed-off-by: Ross Burton <ross.burton@intel.com>
>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>> ---
>> .../iptables/iptables_1.8.3.bb | 60 +++++++++----------
>> 1 file changed, 29 insertions(+), 31 deletions(-)
>>
>> diff --git a/meta/recipes-extended/iptables/iptables_1.8.3.bb
>> b/meta/recipes-extended/iptables/iptables_1.8.3.bb
>> index ff9fcb1b53..563c8ae354 100644
>> --- a/meta/recipes-extended/iptables/iptables_1.8.3.bb
>> +++ b/meta/recipes-extended/iptables/iptables_1.8.3.bb
>> @@ -4,8 +4,9 @@ filtering code in Linux."
>> HOMEPAGE = "http://www.netfilter.org/"
>> BUGTRACKER = "http://bugzilla.netfilter.org/"
>> LICENSE = "GPLv2+"
>> -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\
>> -
>> file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d
>> 0f763df2a12dc"
>> +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
>> +
>> file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d
>> 0f763df2a12dc \
>> +"
>>
>> SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-
>> ${PV}.tar.bz2 \
>> file://0001-configure-Add-option-to-enable-disable-
>> libnfnetlink.patch \
>> @@ -13,16 +14,16 @@ SRC_URI =
>> "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
>> file://iptables.service \
>> file://iptables.rules \
>> "
>> -
>> SRC_URI[md5sum] = "29de711d15c040c402cf3038c69ff513"
>> SRC_URI[sha256sum] =
>> "a23cac034181206b4545f4e7e730e76e08b5f3dd78771ba9645a6756de9cdd80"
>>
>> +SYSTEMD_SERVICE_${PN} = "iptables.service"
>> +
>> inherit autotools pkgconfig systemd
>>
>> EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR}"
>>
>> PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
>> -
>> PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
>>
>> # libnfnetlink recipe is in meta-networking layer
>> @@ -32,9 +33,19 @@ PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--
>> disable-libnfnetlink,libn
>> PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl"
>>
>> do_configure_prepend() {
>> - # Remove some libtool m4 files
>> - # Keep ax_check_linker_flags.m4 which belongs to autoconf-
>> archive.
>> - rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4
>> ltversion.m4
>> + # Remove some libtool m4 files
>> + # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
>> + rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
>> +}
>> +
>> +do_install_append() {
>> + install -d ${D}${sysconfdir}/iptables
>> + install -m 0644 ${WORKDIR}/iptables.rules ${D}${sysconfdir}/iptables
>> +
>> + install -d ${D}${systemd_system_unitdir}
>> + install -m 0644 ${WORKDIR}/iptables.service
>> ${D}${systemd_system_unitdir}
>> +
>> + sed -i -e 's,@SBINDIR@,${sbindir},g'
>> ${D}${systemd_system_unitdir}/iptables.service
>> }
>>
>> PACKAGES += "${PN}-modules"
>> @@ -47,30 +58,6 @@ python populate_packages_prepend() {
>> d.appendVar('RDEPENDS_' + metapkg, ' ' + ' '.join(modules))
>> }
>>
>> -FILES_${PN} += "${datadir}/xtables"
>> -
>> -# Include the symlinks as well in respective packages
>> -FILES_${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so"
>> -FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so"
>> -
>> -INSANE_SKIP_${PN}-module-xt-conntrack = "dev-so"
>> -INSANE_SKIP_${PN}-module-xt-ct = "dev-so"
>> -
>> -ALLOW_EMPTY_${PN}-modules = "1"
>> -
>> -do_install_append() {
>> -
>> - install -d ${D}${sysconfdir}/iptables
>> - install -m 0644 ${WORKDIR}/iptables.rules
>> ${D}${sysconfdir}/iptables
>> -
>> - install -d ${D}${systemd_system_unitdir}
>> - install -m 0644 ${WORKDIR}/iptables.service
>> ${D}${systemd_system_unitdir}
>> -
>> - sed -i -e 's,@SBINDIR@,${sbindir},g'
>> ${D}${systemd_system_unitdir}/iptables.service
>> -}
>> -
>> -SYSTEMD_SERVICE_${PN} = "iptables.service"
>> -
>> RDEPENDS_${PN} = "${PN}-module-xt-standard"
>> RRECOMMENDS_${PN} = " \
>> ${PN}-modules \
>> @@ -84,3 +71,14 @@ RRECOMMENDS_${PN} = " \
>> kernel-module-nf-nat \
>> kernel-module-ipt-masquerade \
>> "
>> +
>> +FILES_${PN} += "${datadir}/xtables"
>> +
>> +# Include the symlinks as well in respective packages
>> +FILES_${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so"
>> +FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so"
>> +
>> +ALLOW_EMPTY_${PN}-modules = "1"
>> +
>> +INSANE_SKIP_${PN}-module-xt-conntrack = "dev-so"
>> +INSANE_SKIP_${PN}-module-xt-ct = "dev-so"
>> --
>> 2.20.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe
2019-12-05 23:32 ` akuster808
@ 2019-12-10 19:58 ` Niko Mauno
0 siblings, 0 replies; 7+ messages in thread
From: Niko Mauno @ 2019-12-10 19:58 UTC (permalink / raw)
To: akuster808, openembedded-core
On 12/6/19 1:32 AM, akuster808 wrote:
>
>
> On 12/5/19 12:05 PM, Niko Mauno wrote:
>> Introduce cosmetic changes to recipe content, most notably
>> - Change indentation style to four spaces in task statements
>> - Reorder several entries according to oe-stylize.py suggestions
>>
>> (From OE-Core rev: c1d162b6165f11b7b5ae5c6066e7683d5e1379fc)
>>
>> Signed-off-by: Niko Mauno <niko.mauno@iki.fi>
>> Signed-off-by: Ross Burton <ross.burton@intel.com>
>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>
> These changes do not pass the 'stable' bar for backporting. Unless a
> more compelling reason is give, this series is being "NACKed" at this time.
>
> - armin
Thanks for checking Armin. For the record, proposed mainly for complementing the existing systemd-specific automatic ipv4 rules loading functionality with ipv6, particularly since both 'ipv4' and 'ipv6' are enabled in DISTRO_FEATURES by default.
-Niko
>> ---
>> .../iptables/iptables_1.8.3.bb | 60 +++++++++----------
>> 1 file changed, 29 insertions(+), 31 deletions(-)
>>
>> diff --git a/meta/recipes-extended/iptables/iptables_1.8.3.bb b/meta/recipes-extended/iptables/iptables_1.8.3.bb
>> index ff9fcb1b53..563c8ae354 100644
>> --- a/meta/recipes-extended/iptables/iptables_1.8.3.bb
>> +++ b/meta/recipes-extended/iptables/iptables_1.8.3.bb
>> @@ -4,8 +4,9 @@ filtering code in Linux."
>> HOMEPAGE = "http://www.netfilter.org/"
>> BUGTRACKER = "http://bugzilla.netfilter.org/"
>> LICENSE = "GPLv2+"
>> -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\
>> - file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc"
>> +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
>> + file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc \
>> +"
>>
>> SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
>> file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \
>> @@ -13,16 +14,16 @@ SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
>> file://iptables.service \
>> file://iptables.rules \
>> "
>> -
>> SRC_URI[md5sum] = "29de711d15c040c402cf3038c69ff513"
>> SRC_URI[sha256sum] = "a23cac034181206b4545f4e7e730e76e08b5f3dd78771ba9645a6756de9cdd80"
>>
>> +SYSTEMD_SERVICE_${PN} = "iptables.service"
>> +
>> inherit autotools pkgconfig systemd
>>
>> EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR}"
>>
>> PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
>> -
>> PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
>>
>> # libnfnetlink recipe is in meta-networking layer
>> @@ -32,9 +33,19 @@ PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--disable-libnfnetlink,libn
>> PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl"
>>
>> do_configure_prepend() {
>> - # Remove some libtool m4 files
>> - # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
>> - rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
>> + # Remove some libtool m4 files
>> + # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
>> + rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
>> +}
>> +
>> +do_install_append() {
>> + install -d ${D}${sysconfdir}/iptables
>> + install -m 0644 ${WORKDIR}/iptables.rules ${D}${sysconfdir}/iptables
>> +
>> + install -d ${D}${systemd_system_unitdir}
>> + install -m 0644 ${WORKDIR}/iptables.service ${D}${systemd_system_unitdir}
>> +
>> + sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/iptables.service
>> }
>>
>> PACKAGES += "${PN}-modules"
>> @@ -47,30 +58,6 @@ python populate_packages_prepend() {
>> d.appendVar('RDEPENDS_' + metapkg, ' ' + ' '.join(modules))
>> }
>>
>> -FILES_${PN} += "${datadir}/xtables"
>> -
>> -# Include the symlinks as well in respective packages
>> -FILES_${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so"
>> -FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so"
>> -
>> -INSANE_SKIP_${PN}-module-xt-conntrack = "dev-so"
>> -INSANE_SKIP_${PN}-module-xt-ct = "dev-so"
>> -
>> -ALLOW_EMPTY_${PN}-modules = "1"
>> -
>> -do_install_append() {
>> -
>> - install -d ${D}${sysconfdir}/iptables
>> - install -m 0644 ${WORKDIR}/iptables.rules ${D}${sysconfdir}/iptables
>> -
>> - install -d ${D}${systemd_system_unitdir}
>> - install -m 0644 ${WORKDIR}/iptables.service ${D}${systemd_system_unitdir}
>> -
>> - sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/iptables.service
>> -}
>> -
>> -SYSTEMD_SERVICE_${PN} = "iptables.service"
>> -
>> RDEPENDS_${PN} = "${PN}-module-xt-standard"
>> RRECOMMENDS_${PN} = " \
>> ${PN}-modules \
>> @@ -84,3 +71,14 @@ RRECOMMENDS_${PN} = " \
>> kernel-module-nf-nat \
>> kernel-module-ipt-masquerade \
>> "
>> +
>> +FILES_${PN} += "${datadir}/xtables"
>> +
>> +# Include the symlinks as well in respective packages
>> +FILES_${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so"
>> +FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so"
>> +
>> +ALLOW_EMPTY_${PN}-modules = "1"
>> +
>> +INSANE_SKIP_${PN}-module-xt-conntrack = "dev-so"
>> +INSANE_SKIP_${PN}-module-xt-ct = "dev-so"
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-12-10 19:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 20:05 [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe Niko Mauno
2019-12-05 20:05 ` [zeus][PATCH 2/3] iptables: Allow overriding rules file location Niko Mauno
2019-12-05 20:05 ` [zeus][PATCH 3/3] iptables: Add systemd helper unit for IPv6 too Niko Mauno
2019-12-05 22:45 ` [zeus][PATCH 1/3] iptables: Cosmetic fixes to recipe Peter Kjellerstedt
2019-12-10 18:04 ` Niko Mauno
2019-12-05 23:32 ` akuster808
2019-12-10 19:58 ` Niko Mauno
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.