diff options
Diffstat (limited to 'poky/meta/recipes-extended/iputils')
-rw-r--r-- | poky/meta/recipes-extended/iputils/iputils/0001-meson-Make-tests-optional.patch | 220 | ||||
-rw-r--r-- | poky/meta/recipes-extended/iputils/iputils/0001-rarpd-rdisc-Drop-PrivateUsers.patch | 31 | ||||
-rw-r--r-- | poky/meta/recipes-extended/iputils/iputils_20210722.bb (renamed from poky/meta/recipes-extended/iputils/iputils_20210202.bb) | 35 |
3 files changed, 244 insertions, 42 deletions
diff --git a/poky/meta/recipes-extended/iputils/iputils/0001-meson-Make-tests-optional.patch b/poky/meta/recipes-extended/iputils/iputils/0001-meson-Make-tests-optional.patch new file mode 100644 index 000000000..9f17cbdb8 --- /dev/null +++ b/poky/meta/recipes-extended/iputils/iputils/0001-meson-Make-tests-optional.patch @@ -0,0 +1,220 @@ +From d8048d60d30a2efe7883b36626123630ce69b9fc Mon Sep 17 00:00:00 2001 +From: Heiko Becker <heirecka@exherbo.org> +Date: Fri, 23 Jul 2021 16:32:46 +0200 +Subject: [PATCH] meson: Make tests optional + +Now can be disabled with -DSKIP_TESTS=true. + +It allows to avoid meson error during build when ip isn't installed. + +Closes: #359 + +Reviewed-by: Petr Vorel <petr.vorel@gmail.com> +Signed-off-by: Heiko Becker <heirecka@exherbo.org> +[ pvorel: Rename variable TEST => SKIP_TESTS, default false, adjust +the description ] +Signed-off-by: Petr Vorel <petr.vorel@gmail.com> + +Upstream-Status: Backport [3163c49f9f4ad473a00d8a345ee334a028376011] +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +--- + meson_options.txt | 3 ++ + ping/meson.build | 84 ++----------------------------------------- + ping/test/meson.build | 81 +++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 86 insertions(+), 82 deletions(-) + create mode 100644 ping/test/meson.build + +diff --git a/meson_options.txt b/meson_options.txt +index ac5f5d9..517667f 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -72,3 +72,6 @@ option('INSTALL_SYSTEMD_UNITS', type: 'boolean', value: false, + + option('USE_GETTEXT', type: 'boolean', value: true, + description: 'Enable I18N') ++ ++option('SKIP_TESTS', type: 'boolean', value: false, ++ description: 'Skip tests during build') +diff --git a/ping/meson.build b/ping/meson.build +index 1e678ec..83ea353 100644 +--- a/ping/meson.build ++++ b/ping/meson.build +@@ -27,86 +27,6 @@ if (setcap_ping) + ) + endif + +-##### TESTS ##### +- +-# TODO: ::1 generates DEPRECATION: ":" is not allowed in test name "ping -c1 ::1", it has been replaced with "_" +- +-# GitHub CI does not have working IPv6 +-# https://github.com/actions/virtual-environments/issues/668 +-ipv6_dst = [] +-ipv6_switch = [] +-r = run_command('ip', '-6', 'a') +-if r.stdout().strip().contains('::1') +- message('IPv6 enabled') +- ipv6_dst = [ '::1' ] +- ipv6_switch = [ '-6' ] +-else +- message('WARNING: IPv6 disabled') ++if not get_option('SKIP_TESTS') ++ subdir('test') + endif +- +-run_as_root = false +-r = run_command('id', '-u') +-if r.stdout().strip().to_int() == 0 +- message('running as root') +- run_as_root = true +-else +- message('running as normal user') +-endif +- +-foreach dst : [ 'localhost', '127.0.0.1' ] + ipv6_dst +- foreach switch : [ '', '-4' ] + ipv6_switch +- args = [ '-c1', dst ] +- should_fail = false +- +- if switch != '' +- args = [switch] + args +- if (switch == '-4' and dst == '::1') or (switch == '-6' and dst == '127.0.0.1') +- should_fail = true +- endif +- endif +- +- name = 'ping ' + ' '.join(args) +- test(name, ping, args : args, should_fail : should_fail) +- endforeach +-endforeach +- +-ping_tests_opt = [ +- [ '-c1' ], +- [ '-c5', '-i0.1' ], +- [ '-c1', '-I', 'lo' ], +- [ '-c1', '-w1' ], +- [ '-c1', '-W1' ], +- [ '-c1', '-W1.1' ], +-] +-foreach dst : [ '127.0.0.1' ] + ipv6_dst +- foreach args : ping_tests_opt +- args += [ dst ] +- name = 'ping ' + ' '.join(args) +- test(name, ping, args : args) +- endforeach +-endforeach +- +-ping_tests_opt_fail = [ +- [ '-c1.1' ], +- [ '-I', 'nonexisting' ], +- [ '-w0.1' ], +- [ '-w0,1' ], +-] +-foreach dst : [ '127.0.0.1' ] + ipv6_dst +- foreach args : ping_tests_opt_fail +- args += [ dst ] +- name = 'ping ' + ' '.join(args) +- test(name, ping, args : args, should_fail : true) +- endforeach +-endforeach +- +-ping_tests_user_fail = [ +- [ '-c1', '-i0.001' ], # -c1 required to quit ping when running as root +-] +-foreach dst : [ '127.0.0.1' ] + ipv6_dst +- foreach args : ping_tests_user_fail +- args += [ dst ] +- name = 'ping ' + ' '.join(args) +- test(name, ping, args : args, should_fail : not run_as_root) +- endforeach +-endforeach +diff --git a/ping/test/meson.build b/ping/test/meson.build +new file mode 100644 +index 0000000..43aed75 +--- /dev/null ++++ b/ping/test/meson.build +@@ -0,0 +1,81 @@ ++# TODO: ::1 generates DEPRECATION: ":" is not allowed in test name "ping -c1 ::1", it has been replaced with "_" ++ ++# GitHub CI does not have working IPv6 ++# https://github.com/actions/virtual-environments/issues/668 ++ipv6_dst = [] ++ipv6_switch = [] ++r = run_command('ip', '-6', 'a') ++if r.stdout().strip().contains('::1') ++ message('IPv6 enabled') ++ ipv6_dst = [ '::1' ] ++ ipv6_switch = [ '-6' ] ++else ++ message('WARNING: IPv6 disabled') ++endif ++ ++run_as_root = false ++r = run_command('id', '-u') ++if r.stdout().strip().to_int() == 0 ++ message('running as root') ++ run_as_root = true ++else ++ message('running as normal user') ++endif ++ ++foreach dst : [ 'localhost', '127.0.0.1' ] + ipv6_dst ++ foreach switch : [ '', '-4' ] + ipv6_switch ++ args = [ '-c1', dst ] ++ should_fail = false ++ ++ if switch != '' ++ args = [switch] + args ++ if (switch == '-4' and dst == '::1') or (switch == '-6' and dst == '127.0.0.1') ++ should_fail = true ++ endif ++ endif ++ ++ name = 'ping ' + ' '.join(args) ++ test(name, ping, args : args, should_fail : should_fail) ++ endforeach ++endforeach ++ ++ping_tests_opt = [ ++ [ '-c1' ], ++ [ '-c5', '-i0.1' ], ++ [ '-c1', '-I', 'lo' ], ++ [ '-c1', '-w1' ], ++ [ '-c1', '-W1' ], ++ [ '-c1', '-W1.1' ], ++] ++foreach dst : [ '127.0.0.1' ] + ipv6_dst ++ foreach args : ping_tests_opt ++ args += [ dst ] ++ name = 'ping ' + ' '.join(args) ++ test(name, ping, args : args) ++ endforeach ++endforeach ++ ++ping_tests_opt_fail = [ ++ [ '-c1.1' ], ++ [ '-I', 'nonexisting' ], ++ [ '-w0.1' ], ++ [ '-w0,1' ], ++] ++foreach dst : [ '127.0.0.1' ] + ipv6_dst ++ foreach args : ping_tests_opt_fail ++ args += [ dst ] ++ name = 'ping ' + ' '.join(args) ++ test(name, ping, args : args, should_fail : true) ++ endforeach ++endforeach ++ ++ping_tests_user_fail = [ ++ [ '-c1', '-i0.001' ], # -c1 required to quit ping when running as root ++] ++foreach dst : [ '127.0.0.1' ] + ipv6_dst ++ foreach args : ping_tests_user_fail ++ args += [ dst ] ++ name = 'ping ' + ' '.join(args) ++ test(name, ping, args : args, should_fail : not run_as_root) ++ endforeach ++endforeach +-- +2.30.2 + diff --git a/poky/meta/recipes-extended/iputils/iputils/0001-rarpd-rdisc-Drop-PrivateUsers.patch b/poky/meta/recipes-extended/iputils/iputils/0001-rarpd-rdisc-Drop-PrivateUsers.patch index d7367caf7..c61e39dc8 100644 --- a/poky/meta/recipes-extended/iputils/iputils/0001-rarpd-rdisc-Drop-PrivateUsers.patch +++ b/poky/meta/recipes-extended/iputils/iputils/0001-rarpd-rdisc-Drop-PrivateUsers.patch @@ -1,20 +1,20 @@ -From 6e51d529988cfc0bb357751fd767e9f1478e2b81 Mon Sep 17 00:00:00 2001 +From dfeeb3f1328d09f516edeb6349bd63e3c87f9397 Mon Sep 17 00:00:00 2001 From: Alex Kiernan <alex.kiernan@gmail.com> Date: Thu, 13 Feb 2020 06:08:45 +0000 -Subject: [PATCH] rarpd: rdisc: Drop PrivateUsers +Subject: [PATCH] rarpd:Drop PrivateUsers -Neither rarpd nor rdisc can gain the necessary capabilities with +rarpd cannot gain the necessary capabilities with PrivateUsers enabled. Upstream-Status: Pending Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> + --- systemd/rarpd.service.in | 1 - - systemd/rdisc.service.in | 3 ++- - 2 files changed, 2 insertions(+), 2 deletions(-) + 1 file changed, 1 deletion(-) diff --git a/systemd/rarpd.service.in b/systemd/rarpd.service.in -index e600c10c93e6..f5d7621a7ce8 100644 +index e600c10..f5d7621 100644 --- a/systemd/rarpd.service.in +++ b/systemd/rarpd.service.in @@ -12,7 +12,6 @@ AmbientCapabilities=CAP_NET_RAW @@ -25,22 +25,3 @@ index e600c10c93e6..f5d7621a7ce8 100644 ProtectSystem=strict ProtectHome=yes ProtectControlGroups=yes -diff --git a/systemd/rdisc.service.in b/systemd/rdisc.service.in -index 4e2a1ec9d0e5..a71b87d36b37 100644 ---- a/systemd/rdisc.service.in -+++ b/systemd/rdisc.service.in -@@ -8,9 +8,10 @@ After=network.target - EnvironmentFile=-/etc/sysconfig/rdisc - ExecStart=@sbindir@/rdisc -f -t $OPTIONS $SEND_ADDRESS $RECEIVE_ADDRESS - -+CapabilityBoundingSet=CAP_NET_RAW - AmbientCapabilities=CAP_NET_RAW - PrivateTmp=yes --PrivateUsers=yes -+DynamicUser=yes - ProtectSystem=strict - ProtectHome=yes - ProtectControlGroups=yes --- -2.17.1 - diff --git a/poky/meta/recipes-extended/iputils/iputils_20210202.bb b/poky/meta/recipes-extended/iputils/iputils_20210722.bb index 02a303782..2e8d9032e 100644 --- a/poky/meta/recipes-extended/iputils/iputils_20210202.bb +++ b/poky/meta/recipes-extended/iputils/iputils_20210722.bb @@ -12,8 +12,9 @@ DEPENDS = "gnutls" SRC_URI = "git://github.com/iputils/iputils \ file://0001-rarpd-rdisc-Drop-PrivateUsers.patch \ + file://0001-meson-Make-tests-optional.patch \ " -SRCREV = "cc16da6b574ce6637f3e6e9ab3c1a728663006ff" +SRCREV = "71bb2a6c72e9f658e90ac618c73d873a76bbaa81" S = "${WORKDIR}/git" @@ -38,11 +39,11 @@ PACKAGECONFIG[docs] = "-DBUILD_HTML_MANS=true -DBUILD_MANS=true,-DBUILD_HTML_MAN inherit meson systemd update-alternatives -EXTRA_OEMESON += "--prefix=${root_prefix}/" +EXTRA_OEMESON += "--prefix=${root_prefix}/ -DSKIP_TESTS=true" ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN}-ping = "ping" +ALTERNATIVE:${PN}-ping = "ping" ALTERNATIVE_LINK_NAME[ping] = "${base_bindir}/ping" SPLITPKGS = "${PN}-ping ${PN}-arping ${PN}-tracepath ${PN}-clockdiff ${PN}-rdisc \ @@ -51,21 +52,21 @@ SPLITPKGS = "${PN}-ping ${PN}-arping ${PN}-tracepath ${PN}-clockdiff ${PN}-rdisc ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '${PN}-traceroute6 ${PN}-ninfod', '', d)}" PACKAGES += "${SPLITPKGS}" -ALLOW_EMPTY_${PN} = "1" -RDEPENDS_${PN} += "${SPLITPKGS}" +ALLOW_EMPTY:${PN} = "1" +RDEPENDS:${PN} += "${SPLITPKGS}" -FILES_${PN} = "" -FILES_${PN}-ping = "${base_bindir}/ping.${BPN}" -FILES_${PN}-arping = "${base_bindir}/arping" -FILES_${PN}-tracepath = "${base_bindir}/tracepath" -FILES_${PN}-traceroute6 = "${base_bindir}/traceroute6" -FILES_${PN}-clockdiff = "${base_bindir}/clockdiff" -FILES_${PN}-tftpd = "${base_bindir}/tftpd ${sysconfdir}/xinetd.d/tftp" -FILES_${PN}-rarpd = "${base_sbindir}/rarpd ${systemd_unitdir}/system/rarpd@.service" -FILES_${PN}-rdisc = "${base_sbindir}/rdisc" -FILES_${PN}-ninfod = "${base_sbindir}/ninfod ${sysconfdir}/init.d/ninfod.sh" +FILES:${PN} = "" +FILES:${PN}-ping = "${base_bindir}/ping.${BPN}" +FILES:${PN}-arping = "${base_bindir}/arping" +FILES:${PN}-tracepath = "${base_bindir}/tracepath" +FILES:${PN}-traceroute6 = "${base_bindir}/traceroute6" +FILES:${PN}-clockdiff = "${base_bindir}/clockdiff" +FILES:${PN}-tftpd = "${base_bindir}/tftpd ${sysconfdir}/xinetd.d/tftp" +FILES:${PN}-rarpd = "${base_sbindir}/rarpd ${systemd_unitdir}/system/rarpd@.service" +FILES:${PN}-rdisc = "${base_sbindir}/rdisc" +FILES:${PN}-ninfod = "${base_sbindir}/ninfod ${sysconfdir}/init.d/ninfod.sh" SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '${PN}-ninfod', '', d)} \ ${PN}-rdisc" -SYSTEMD_SERVICE_${PN}-ninfod = "ninfod.service" -SYSTEMD_SERVICE_${PN}-rdisc = "rdisc.service" +SYSTEMD_SERVICE:${PN}-ninfod = "ninfod.service" +SYSTEMD_SERVICE:${PN}-rdisc = "rdisc.service" |