diff options
Diffstat (limited to 'meta/recipes-core/ifupdown')
-rw-r--r-- | meta/recipes-core/ifupdown/files/0001-Define-FNM_EXTMATCH-for-musl.patch | 45 | ||||
-rw-r--r-- | meta/recipes-core/ifupdown/files/0001-Makefile-do-not-use-dpkg-for-determining-OS-type.patch | 24 | ||||
-rw-r--r-- | meta/recipes-core/ifupdown/files/0001-ifupdown-skip-wrong-test-case.patch | 30 | ||||
-rw-r--r-- | meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch | 12 | ||||
-rw-r--r-- | meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch | 422 | ||||
-rw-r--r-- | meta/recipes-core/ifupdown/files/run-ptest | 4 | ||||
-rw-r--r-- | meta/recipes-core/ifupdown/files/tweak-ptest-script.patch | 57 | ||||
-rw-r--r-- | meta/recipes-core/ifupdown/ifupdown_0.8.41.bb (renamed from meta/recipes-core/ifupdown/ifupdown_0.8.16.bb) | 34 |
8 files changed, 190 insertions, 438 deletions
diff --git a/meta/recipes-core/ifupdown/files/0001-Define-FNM_EXTMATCH-for-musl.patch b/meta/recipes-core/ifupdown/files/0001-Define-FNM_EXTMATCH-for-musl.patch new file mode 100644 index 0000000000..6c4ed526bf --- /dev/null +++ b/meta/recipes-core/ifupdown/files/0001-Define-FNM_EXTMATCH-for-musl.patch @@ -0,0 +1,45 @@ +From 8dfbcf02e424ba1fdef587d81c9e08a37ab8c1b6 Mon Sep 17 00:00:00 2001 +From: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com> +Date: Tue, 2 Jul 2019 20:10:42 +0200 +Subject: [PATCH] Define FNM_EXTMATCH for musl + +Fixes the following compilation errors with musl that does not have +FNM_EXTMATCH defined: + +| main.c: In function 'expand_matches': +| main.c:700:40: error: 'FNM_EXTMATCH' undeclared (first use in this +function); did you mean 'FNM_NOMATCH'? +| 700 | if(fnmatch(pattern, ifa->ifa_name, FNM_EXTMATCH)) +| | ^~~~~~~~~~~~ +| | FNM_NOMATCH + +and + +| archlinux.c:40:28: error: 'FNM_EXTMATCH' undeclared (first use in this +function); did you mean 'FNM_NOMATCH'? +| 40 | if(fnmatch(pattern, buf, FNM_EXTMATCH) == 0) { +| | ^~~~~~~~~~~~ +| | FNM_NOMATCH + +Upstream-Status: Submitted [https://salsa.debian.org/debian/ifupdown/merge_requests/5] + +Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com> + +--- + archcommon.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/archcommon.h b/archcommon.h +index 818b0b6..ad9cd1a 100644 +--- a/archcommon.h ++++ b/archcommon.h +@@ -1,5 +1,9 @@ + #include "header.h" + ++#if !defined(FNM_EXTMATCH) ++#define FNM_EXTMATCH 0 ++#endif ++ + bool execable(const char *); + + #define iface_is_link() (!_iface_has(ifd->real_iface, ":.")) diff --git a/meta/recipes-core/ifupdown/files/0001-Makefile-do-not-use-dpkg-for-determining-OS-type.patch b/meta/recipes-core/ifupdown/files/0001-Makefile-do-not-use-dpkg-for-determining-OS-type.patch new file mode 100644 index 0000000000..6e15a25224 --- /dev/null +++ b/meta/recipes-core/ifupdown/files/0001-Makefile-do-not-use-dpkg-for-determining-OS-type.patch @@ -0,0 +1,24 @@ +From 7fe516cbaf9fda09d99dcb54d4645367cffc8a4d Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Thu, 9 Jan 2020 15:38:06 +0100 +Subject: [PATCH] Makefile: do not use dpkg for determining OS type + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 0ce2fa3..739aef2 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION ?= 0.8 + CFLAGS ?= -Wall -W -Wno-unused-parameter -g -O2 +-ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) ++ARCH := linux + + BASEDIR ?= $(DESTDIR) + diff --git a/meta/recipes-core/ifupdown/files/0001-ifupdown-skip-wrong-test-case.patch b/meta/recipes-core/ifupdown/files/0001-ifupdown-skip-wrong-test-case.patch new file mode 100644 index 0000000000..9ae24da51e --- /dev/null +++ b/meta/recipes-core/ifupdown/files/0001-ifupdown-skip-wrong-test-case.patch @@ -0,0 +1,30 @@ +From 782d8a869c266820d0f34974436f244f67afaea7 Mon Sep 17 00:00:00 2001 +From: Zqiang <qiang.zhang@windriver.com> +Date: Mon, 19 Apr 2021 14:15:45 +0800 +Subject: [PATCH] ifupdown: skip wrong test case + +The test parameters of testcase(12-15) file is not right, +it triggers a test failure, these test items are invalid +and are skipped directly. + +Upstream-Status: Inappropriate [oe-core specific] + +Signed-off-by: Zqiang <qiang.zhang@windriver.com> + +--- + tests/testbuild-linux | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/testbuild-linux b/tests/testbuild-linux +index 2fa1b8b..2c69856 100755 +--- a/tests/testbuild-linux ++++ b/tests/testbuild-linux +@@ -3,7 +3,7 @@ + dir=tests/linux + + result=true +-for test in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do ++for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19; do + if [ -e $dir/testcase.$test ]; then + args="$(cat $dir/testcase.$test | sed -n 's/^# RUN: //p')" + else diff --git a/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch b/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch index a24b8cda66..7b4b761e6a 100644 --- a/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch +++ b/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch @@ -1,7 +1,7 @@ -From 7af9db748974cb3a2c6ef8f9e03d7db1f9f8ee16 Mon Sep 17 00:00:00 2001 +From fc8e8d4cb19ff30e69aa1855332544f1017f974c Mon Sep 17 00:00:00 2001 From: Paul Gortmaker <paul.gortmaker@windriver.com> Date: Wed, 6 Aug 2014 14:54:12 -0400 -Subject: [PATCH 1/2] defn2[c|man]: don't rely on dpkg-architecture to set arch +Subject: [PATCH] defn2[c|man]: don't rely on dpkg-architecture to set arch In yocto we'll always be cross compiling, and we'll always be building on linux for linux (vs. *BSD, hurd, etc.) @@ -13,13 +13,14 @@ like the loopback device not being configured/enabled. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Upstream-Status: Pending + --- defn2c.pl | 6 +++--- defn2man.pl | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/defn2c.pl b/defn2c.pl -index c449de2f3d1c..38845e374c76 100755 +index fa7a02e..bb4987d 100755 --- a/defn2c.pl +++ b/defn2c.pl @@ -2,9 +2,9 @@ @@ -36,7 +37,7 @@ index c449de2f3d1c..38845e374c76 100755 # declarations my $address_family = ""; diff --git a/defn2man.pl b/defn2man.pl -index 6ddcfdd4fe68..c9c4dd046597 100755 +index 6ddcfdd..c9c4dd0 100755 --- a/defn2man.pl +++ b/defn2man.pl @@ -2,9 +2,9 @@ @@ -52,6 +53,3 @@ index 6ddcfdd4fe68..c9c4dd046597 100755 # declarations my $line; --- -1.9.1 - diff --git a/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch b/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch deleted file mode 100644 index 2013933b69..0000000000 --- a/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch +++ /dev/null @@ -1,422 +0,0 @@ -From d88af5aa0312ea18aac791d66661da79b7bcd032 Mon Sep 17 00:00:00 2001 -From: "Maxin B. John" <maxin.john@intel.com> -Date: Wed, 21 Dec 2016 15:32:07 +0200 -Subject: [PATCH] inet[6].defn: fix inverted checks for loopback - -Compared to the hurd link.defn for loopback, we see these -are inverted, meaning that you would only be able to configure -a loopback device that was _not_ named "lo" (unlikely to exist). - -The result was that we'd update /run/network/ifstate for "lo" -but never actually do anything for up/down, as shown below: - -root@localhost:~# ifconfig -s -Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg -eth0 1500 0 7736329 0 2016 0 5289422 0 0 0 BMRU -lo 65536 0 18 0 0 0 18 0 0 0 LRU -root@localhost:~# ifdown lo -root@localhost:~# echo $? -0 -root@localhost:~# ifconfig -s -Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg -eth0 1500 0 7736406 0 2016 0 5289455 0 0 0 BMRU -lo 65536 0 18 0 0 0 18 0 0 0 LRU -root@localhost:~# ifconfig lo down -root@localhost:~# ifconfig -s -Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg -eth0 1500 0 7736474 0 2016 0 5289481 0 0 0 BMRU -root@localhost:~# - -Also reverted the commit: -commit 80b878497663dae08f70b4d3cffe127b57a3cfc -which uses absolute paths to binaries called by ifup/ifdown. - -Upstream-Status: Inappropriate [OE specific] - -Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> -Signed-off-by: Maxin B. John <maxin.john@intel.com> ---- - inet.defn | 148 +++++++++++++++++++++++++++++++------------------------------- - 1 file changed, 74 insertions(+), 74 deletions(-) - -diff --git a/inet.defn b/inet.defn -index 75e6744..b5f5da2 100644 ---- a/inet.defn -+++ b/inet.defn -@@ -6,10 +6,10 @@ method loopback - This method may be used to define the IPv4 loopback interface. - - up -- /bin/ip link set dev %iface% up if (!iface_is_lo()) -+ ip link set dev %iface% up if (iface_is_lo()) - - down -- /bin/ip link set dev %iface% down if (!iface_is_lo()) -+ ip link set dev %iface% down if (iface_is_lo()) - - method static - description -@@ -36,17 +36,17 @@ method static - broadcast compute_v4_broadcast - - up -- /bin/ip addr add %address%[[/%netmask%]] [[broadcast %broadcast%]] \ -+ ip addr add %address%[[/%netmask%]] [[broadcast %broadcast%]] \ - [[peer %pointopoint%]] [[scope %scope%]] dev %iface% label %iface% -- /bin/ip link set dev %iface% [[mtu %mtu%]] [[address %hwaddress%]] up -+ ip link set dev %iface% [[mtu %mtu%]] [[address %hwaddress%]] up - -- [[ /bin/ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]] -+ [[ ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]] - - down -- [[ /bin/ip route del default via %gateway% [[metric %metric%]] dev %iface% 2>&1 1>/dev/null || true ]] -- /bin/ip addr del %address%[[/%netmask%]] [[broadcast %broadcast%]] \ -+ [[ ip route del default via %gateway% [[metric %metric%]] dev %iface% 2>&1 1>/dev/null || true ]] -+ ip addr del %address%[[/%netmask%]] [[broadcast %broadcast%]] \ - [[peer %pointopoint%]] [[scope %scope%]] dev %iface% label %iface% -- /bin/ip link set dev %iface% down \ -+ ip link set dev %iface% down \ - if (iface_is_link()) - - method manual -@@ -63,12 +63,12 @@ method manual - hwaddress cleanup_hwaddress - - up -- [[/bin/ip link set dev %iface% mtu %mtu%]] -- [[/bin/ip link set dev %iface% address %hwaddress%]] -- /bin/ip link set dev %iface% up 2>/dev/null || true -+ [[ip link set dev %iface% mtu %mtu%]] -+ [[ip link set dev %iface% address %hwaddress%]] -+ ip link set dev %iface% up 2>/dev/null || true - - down -- /bin/ip link set dev %iface% down 2>/dev/null || true \ -+ ip link set dev %iface% down 2>/dev/null || true \ - if (iface_is_link() && !do_all) - - method dhcp -@@ -93,33 +93,33 @@ method dhcp - hwaddress cleanup_hwaddress - - up -- [[/bin/ip link set dev %iface% address %hwaddress%]] -- /sbin/dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ -+ [[ip link set dev %iface% address %hwaddress%]] -+ dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ - [[-e IF_METRIC=%metric%]] \ - if (execable("/sbin/dhclient")) -- /sbin/pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]] \ -+ pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]] \ - elsif (execable("/sbin/pump")) -- /sbin/udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-x hostname:%hostname%]] \ -+ udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-x hostname:%hostname%]] \ - elsif (execable("/sbin/udhcpc")) -- /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \ -+ dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \ - [[-l %leasetime%]] [[-m %metric%]] %iface% \ - elsif (execable("/sbin/dhcpcd")) - echo 'No DHCP client software found!' >/dev/stderr; false \ - elsif (1) - - down -- /sbin/dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ -+ dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ - if (execable("/sbin/dhclient")) -- /sbin/pump -i %iface% -r \ -+ pump -i %iface% -r \ - elsif (execable("/sbin/pump")) -- if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface%.pid); fi \ -+ if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(cat /run/udhcpc.%iface%.pid); kill -TERM $(cat /run/udhcpc.%iface%.pid); fi \ - elsif (execable("/sbin/udhcpc")) -- /sbin/dhcpcd -k %iface% \ -+ dhcpcd -k %iface% \ - elsif (execable("/sbin/dhcpcd")) - echo 'No DHCP client software found!' >/dev/stderr; false \ - elsif (1) - -- /bin/ip link set dev %iface% down \ -+ ip link set dev %iface% down \ - if (iface_is_link()) - - method bootp -@@ -134,11 +134,11 @@ method bootp - whatever it really is. - - up -- /sbin/bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \ -+ bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \ - [[--hwaddr %hwaddr%]] --returniffail --serverbcast - - down -- /bin/ip link set dev %iface% down \ -+ ip link set dev %iface% down \ - if (iface_is_link()) - - method tunnel -@@ -158,13 +158,13 @@ method tunnel - ttl time -- TTL setting - mtu size -- MTU size - up -- /bin/ip tunnel add %iface% mode %mode% remote %endpoint% [[local %local%]] \ -+ ip tunnel add %iface% mode %mode% remote %endpoint% [[local %local%]] \ - [[ttl %ttl%]] -- /bin/ip link set %iface% up [[mtu %mtu%]] -- /bin/ip addr add %address%/%netmask% dev %iface% [[peer %dstaddr%]] -- [[ /bin/ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]] -+ ip link set %iface% up [[mtu %mtu%]] -+ ip addr add %address%/%netmask% dev %iface% [[peer %dstaddr%]] -+ [[ ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]] - down -- /bin/ip tunnel del %iface% -+ ip tunnel del %iface% - - method ppp - description -@@ -175,9 +175,9 @@ method ppp - unit number -- Use /number/ as the ppp unit number. - options string -- Pass /string/ as additional options to pon. - up -- /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]] -+ pon [[%provider%]] [[unit %unit%]] [[%options%]] - down -- /usr/bin/poff [[%provider%]] -+ poff [[%provider%]] - - method wvdial - description -@@ -186,10 +186,10 @@ method wvdial - options - provider name -- Use /name/ as the provider (from /etc/wvdial.conf). - up -- /sbin/start-stop-daemon --start -x /usr/bin/wvdial \ -+ start-stop-daemon --start -x /usr/bin/wvdial \ - -p /run/wvdial.%iface%.pid -b -m -- [[ %provider% ]] - down -- /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \ -+ start-stop-daemon --stop -x /usr/bin/wvdial \ - -p /run/wvdial.%iface%.pid -s 2 - - -@@ -200,9 +200,9 @@ method ipv4ll - known as APIPA or IPAC, and often colloquially referred to - as "Zeroconf address". - up -- /usr/sbin/avahi-autoipd -D %iface% -+ avahi-autoipd -D %iface% - down -- /usr/sbin/avahi-autoipd --kill %iface% -+ avahi-autoipd --kill %iface% - - architecture kfreebsd - -@@ -211,12 +211,12 @@ method loopback - This method may be used to define the IPv4 loopback interface. - - up -- /sbin/ifconfig %iface% 127.0.0.1 up \ -- if (!iface_is_lo()) -+ ifconfig %iface% 127.0.0.1 up \ -+ if (iface_is_lo()) - - down -- /sbin/ifconfig %iface% down \ -- if (!iface_is_lo()) -+ ifconfig %iface% down \ -+ if (iface_is_lo()) - - method static - description -@@ -238,15 +238,15 @@ method static - hwaddress cleanup_hwaddress - - up -- [[ /sbin/ifconfig %iface% link %hwaddress%]] -- /sbin/ifconfig %iface% %address% [[netmask %netmask%]] [[broadcast %broadcast%]] \ -+ [[ ifconfig %iface% link %hwaddress%]] -+ ifconfig %iface% %address% [[netmask %netmask%]] [[broadcast %broadcast%]] \ - [[pointopoint %pointopoint%]] [[media %media%]] [[mtu %mtu%]] \ - up -- [[ /sbin/route add default %gateway% ]] -+ [[ route add default %gateway% ]] - - down -- [[ /sbin/route del default %gateway% 2>&1 1>/dev/null || true ]] -- /sbin/ifconfig %iface% down -+ [[ route del default %gateway% 2>&1 1>/dev/null || true ]] -+ ifconfig %iface% down - - method manual - description -@@ -279,30 +279,30 @@ method dhcp - hwaddress cleanup_hwaddress - - up -- [[/sbin/ifconfig %iface% link %hwaddress%]] -- /sbin/dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ -+ [[ifconfig %iface% link %hwaddress%]] -+ dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ - [[-e IF_METRIC=%metric%]] \ - if (execable("/sbin/dhclient")) -- /sbin/udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]] \ -+ udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]] \ - [[-c %client%]] \ - elsif (execable("/sbin/udhcpc")) -- /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \ -+ dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \ - [[-l %leasetime%]] %iface% \ - elsif (execable("/sbin/dhcpcd")) - echo 'No DHCP client software found!' >/dev/stderr; false \ - elsif (1) - - down -- /sbin/dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ -+ dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ - if (execable("/sbin/dhclient")) -- if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface%.pid); fi \ -+ if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(cat /run/udhcpc.%iface%.pid); kill -TERM $(cat /run/udhcpc.%iface%.pid); fi \ - elsif (execable("/sbin/udhcpc")) -- /sbin/dhcpcd -k %iface% \ -+ dhcpcd -k %iface% \ - elsif (execable("/sbin/dhcpcd")) - echo 'No DHCP client software found!' >/dev/stderr; false \ - elsif (1) - -- /sbin/ifconfig %iface% down -+ ifconfig %iface% down - - method bootp - description -@@ -316,11 +316,11 @@ method bootp - whatever it really is. - - up -- /sbin/bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \ -+ bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \ - [[--hwaddr %hwaddr%]] --returniffail --serverbcast - - down -- /sbin/ifconfig %iface% down -+ ifconfig %iface% down - - method ppp - description -@@ -331,9 +331,9 @@ method ppp - unit number -- Use /number/ as the ppp unit number. - options string -- Pass /string/ as additional options to pon. - up -- /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]] -+ pon [[%provider%]] [[unit %unit%]] [[%options%]] - down -- /usr/bin/poff [[%provider%]] -+ poff [[%provider%]] - - method wvdial - description -@@ -342,10 +342,10 @@ method wvdial - options - provider name -- Use /name/ as the provider (from /etc/wvdial.conf). - up -- /sbin/start-stop-daemon --start -x /usr/bin/wvdial \ -+ start-stop-daemon --start -x /usr/bin/wvdial \ - -p /run/wvdial.%iface%.pid -b -m -- [[ %provider% ]] - down -- /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \ -+ start-stop-daemon --stop -x /usr/bin/wvdial \ - -p /run/wvdial.%iface%.pid -s 2 - - -@@ -356,9 +356,9 @@ method ipv4ll - known as APIPA or IPAC, and often colloquially referred to - as "Zeroconf address". - up -- /usr/sbin/avahi-autoipd -D %iface% -+ avahi-autoipd -D %iface% - down -- /usr/sbin/avahi-autoipd --kill %iface% -+ avahi-autoipd --kill %iface% - architecture hurd - - method loopback -@@ -367,11 +367,11 @@ method loopback - - up - inetutils-ifconfig --interface %iface% --address 127.0.0.1 --up \ -- if (!iface_is_lo()) -+ if (iface_is_lo()) - - down - inetutils-ifconfig --interface %iface% --down \ -- if (!iface_is_lo()) -+ if (iface_is_lo()) - - method static - description -@@ -432,23 +432,23 @@ method dhcp - - up - [[Warning: Option hwaddress: %hwaddress% not yet supported]] -- /sbin/dhclient -v -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \ -+ dhclient -v -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \ - if (execable("/sbin/dhclient")) -- /sbin/udhcpc -n -p /run/udhcpc.%iface///.%.pid -i %iface% [[-H %hostname%]] \ -+ udhcpc -n -p /run/udhcpc.%iface///.%.pid -i %iface% [[-H %hostname%]] \ - [[-c %client%]] \ - elsif (execable("/sbin/udhcpc")) -- /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \ -+ dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \ - [[-l %leasetime%]] %iface% \ - elsif (execable("/sbin/dhcpcd")) - echo 'No DHCP client software found!' >/dev/stderr; false \ - elsif (1) - - down -- /sbin/dhclient -v -r -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \ -+ dhclient -v -r -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \ - if (execable("/sbin/dhclient")) -- if test -f /run/udhcpc.%iface///.%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface///.%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface///.%.pid); fi \ -+ if test -f /run/udhcpc.%iface///.%.pid; then kill -USR2 $(cat /run/udhcpc.%iface///.%.pid); kill -TERM $(cat /run/udhcpc.%iface///.%.pid); fi \ - elsif (execable("/sbin/udhcpc")) -- /sbin/dhcpcd -k %iface% \ -+ dhcpcd -k %iface% \ - elsif (execable("/sbin/dhcpcd")) - echo 'No DHCP client software found!' >/dev/stderr; false \ - elsif (1) -@@ -482,9 +482,9 @@ method ppp - unit number -- Use /number/ as the ppp unit number. - options string -- Pass /string/ as additional options to pon. - up -- /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]] -+ pon [[%provider%]] [[unit %unit%]] [[%options%]] - down -- /usr/bin/poff [[%provider%]] -+ poff [[%provider%]] - - method wvdial - description -@@ -493,10 +493,10 @@ method wvdial - options - provider name -- Use /name/ as the provider (from /etc/wvdial.conf). - up -- /sbin/start-stop-daemon --start -x /usr/bin/wvdial \ -+ start-stop-daemon --start -x /usr/bin/wvdial \ - -p /run/wvdial.%iface///.%.pid -b -m -- [[ %provider% ]] - down -- /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \ -+ start-stop-daemon --stop -x /usr/bin/wvdial \ - -p /run/wvdial.%iface///.%.pid -s 2 - - -@@ -507,6 +507,6 @@ method ipv4ll - known as APIPA or IPAC, and often colloquially referred to - as "Zeroconf address". - up -- /usr/sbin/avahi-autoipd -D %iface% -+ avahi-autoipd -D %iface% - down -- /usr/sbin/avahi-autoipd --kill %iface% -+ avahi-autoipd --kill %iface% --- -2.4.0 - diff --git a/meta/recipes-core/ifupdown/files/run-ptest b/meta/recipes-core/ifupdown/files/run-ptest new file mode 100644 index 0000000000..8694042392 --- /dev/null +++ b/meta/recipes-core/ifupdown/files/run-ptest @@ -0,0 +1,4 @@ +#!/bin/sh + +CURDIR=$(dirname `readlink -f $0`) +cd $CURDIR/tests && ./testbuild-linux diff --git a/meta/recipes-core/ifupdown/files/tweak-ptest-script.patch b/meta/recipes-core/ifupdown/files/tweak-ptest-script.patch new file mode 100644 index 0000000000..fa6bb84df3 --- /dev/null +++ b/meta/recipes-core/ifupdown/files/tweak-ptest-script.patch @@ -0,0 +1,57 @@ +From a6bb2ac5f521c678abbbdb1960d28f750f4357a6 Mon Sep 17 00:00:00 2001 +From: Kai Kang <kai.kang@windriver.com> +Date: Mon, 3 Feb 2020 17:33:11 +0800 +Subject: [PATCH] Tweak tests of ifupdown to make it work with oe-core ptest + framework. + +Upstream-Status: Inappropriate [oe-core specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +--- + tests/testbuild-linux | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/tests/testbuild-linux b/tests/testbuild-linux +index 2c69856..05f0703 100755 +--- a/tests/testbuild-linux ++++ b/tests/testbuild-linux +@@ -1,6 +1,7 @@ + #!/bin/sh -e + +-dir=tests/linux ++curdir=$(dirname `readlink -f $0`) ++dir=$curdir/linux + + result=true + for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19; do +@@ -12,7 +13,7 @@ for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19; do + echo "Testcase $test: $args" + + exitcode=0 +- ./ifup -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \ ++ ifup -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \ + >$dir/up-res-out.$test 2>$dir/up-res-err.$test || exitcode=$? + + (echo "exit code: $exitcode"; +@@ -20,7 +21,7 @@ for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19; do + echo "====stderr===="; cat $dir/up-res-err.$test) > $dir/up-res.$test + + exitcode=0 +- ./ifdown -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \ ++ ifdown -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \ + >$dir/down-res-out.$test 2>$dir/down-res-err.$test || exitcode=$? + + (echo "exit code: $exitcode"; +@@ -28,9 +29,9 @@ for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19; do + echo "====stderr===="; cat $dir/down-res-err.$test) > $dir/down-res.$test + + if diff -ub $dir/up.$test $dir/up-res.$test && diff -ub $dir/down.$test $dir/down-res.$test; then +- echo "(okay)" ++ echo "PASS: $test" + else +- echo "(failed)" ++ echo "FAIL: $test" + result=false + fi + echo "==========" diff --git a/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb b/meta/recipes-core/ifupdown/ifupdown_0.8.41.bb index 5654528ae8..16425ea9e4 100644 --- a/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb +++ b/meta/recipes-core/ifupdown/ifupdown_0.8.41.bb @@ -1,22 +1,27 @@ SUMMARY = "ifupdown: basic ifup and ifdown used by initscripts" +HOMEPAGE = "https://salsa.debian.org/debian/ifupdown" DESCRIPTION = "High level tools to configure network interfaces \ This package provides the tools ifup and ifdown which may be used to \ configure (or, respectively, deconfigure) network interfaces, based on \ the file /etc/network/interfaces." -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" -SRC_URI = "git://anonscm.debian.org/git/collab-maint/ifupdown.git \ - file://defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch \ - file://inet-6-.defn-fix-inverted-checks-for-loopback.patch \ - file://99_network \ - " -SRCREV = "11b9f99f7ecc7052497e6786156cfed531f11823" +SRC_URI = "git://salsa.debian.org/debian/ifupdown.git;protocol=https;branch=master \ + file://99_network \ + file://run-ptest \ + file://0001-Define-FNM_EXTMATCH-for-musl.patch \ + file://0001-Makefile-do-not-use-dpkg-for-determining-OS-type.patch \ + file://0001-ifupdown-skip-wrong-test-case.patch \ + file://defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch \ + file://tweak-ptest-script.patch \ + " +SRCREV = "369d9d3c13a0c56ad09fd4f13b4a80eb9a94e270" S = "${WORKDIR}/git" -inherit update-alternatives +inherit ptest update-alternatives do_compile () { chmod a+rx *.pl *.sh @@ -37,10 +42,21 @@ do_install () { install -m 0644 ifup.8 ${D}${mandir}/man8 install -m 0644 interfaces.5 ${D}${mandir}/man5 cd ${D}${mandir}/man8 && ln -s ifup.8 ifdown.8 + + install -d ${D}${sysconfdir}/network/if-pre-up.d + install -d ${D}${sysconfdir}/network/if-up.d + install -d ${D}${sysconfdir}/network/if-down.d + install -d ${D}${sysconfdir}/network/if-post-down.d +} + +do_install_ptest () { + install -d ${D}${PTEST_PATH}/tests + cp -r ${S}/tests/testbuild-linux ${D}${PTEST_PATH}/tests/ + cp -r ${S}/tests/linux ${D}${PTEST_PATH}/tests/ } ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN} = "ifup ifdown" +ALTERNATIVE:${PN} = "ifup ifdown" ALTERNATIVE_LINK_NAME[ifup] = "${base_sbindir}/ifup" ALTERNATIVE_LINK_NAME[ifdown] = "${base_sbindir}/ifdown" |