# HG changeset patch # User Pascal Bellard # Date 1661967074 0 # Node ID 511d41fb7f7665d43b463c55cb7aee23e9739cb8 # Parent 01119cbefbc347789089180549517180d92b73c3 Add wireguard for linux64 diff -r 01119cbefbc3 -r 511d41fb7f76 linux64-wireguard/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux64-wireguard/receipt Wed Aug 31 17:31:14 2022 +0000 @@ -0,0 +1,46 @@ +# SliTaz package receipt. + +PACKAGE="linux64-wireguard" +VERSION="1.0.20220627" +CATEGORY="base-system" +MAINTAINER="pascal.bellard@slitaz.org" +LICENSE="GPL2" +SHORT_DESC="The Wireguard VPN kernel module." +WEB_SITE="https://www.wireguard.com/" +SOURCE="wireguard-linux-compat" +TARBALL="$SOURCE-$VERSION.tar.xz" +WGET_URL="https://git.zx2c4.com/$SOURCE/snapshot/$TARBALL" + +DEPENDS="linux64" +BUILD_DEPENDS="linux64-module-headers xz uclibc-cross-compiler-x86_64" +SUGGESTED="wireguard-tools" + +AUFS_NOT_RAMFS="uclibc-cross-compiler-x86_64 is not compatible with aufs+tmpfs 8(" + +# Rules to configure and make the package. + +compile_rules() +{ + cd src + sed -i '/Wframe-larger-than=2048/d' Kbuild + patch -p0 < $stuff/socket.u + make -k ARCH=x86_64 KERNELDIR="/usr/src/linux" && xz wireguard.ko +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + EXTRAVERSION=_$kvers + mkdir -p $fs/lib/modules/$kvers-slitaz64/kernel/misc + cp $src/src/wireguard.ko.xz $fs/lib/modules/$kvers-slitaz64/kernel/misc +} + +post_install() +{ + chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz64 +} + +post_remove() +{ + depmod -a +} diff -r 01119cbefbc3 -r 511d41fb7f76 linux64-wireguard/stuff/socket.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux64-wireguard/stuff/socket.u Wed Aug 31 17:31:14 2022 +0000 @@ -0,0 +1,25 @@ +--- socket.c ++++ socket.c +@@ -358,7 +358,6 @@ + struct socket *new4 = NULL, *new6 = NULL; + struct udp_port_cfg port4 = { + .family = AF_INET, +- .local_ip.s_addr = htonl(INADDR_ANY), + .local_udp_port = htons(port), + .use_udp_checksums = true + }; +@@ -366,12 +365,13 @@ + int retries = 0; + struct udp_port_cfg port6 = { + .family = AF_INET6, +- .local_ip6 = IN6ADDR_ANY_INIT, + .use_udp6_tx_checksums = true, + .use_udp6_rx_checksums = true, + .ipv6_v6only = true + }; ++ memset(&port6.local_ip6, 0, 16); // port6.local_ip6 = IN6ADDR_ANY_INIT; + #endif ++ port4.local_ip.s_addr = htonl(INADDR_ANY); + + rcu_read_lock(); + net = rcu_dereference(wg->creating_net); diff -r 01119cbefbc3 -r 511d41fb7f76 wireguard-tools/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wireguard-tools/receipt Wed Aug 31 17:31:14 2022 +0000 @@ -0,0 +1,30 @@ +# SliTaz package receipt. + +PACKAGE="wireguard-tools" +VERSION="1.0.20210914" +CATEGORY="base-system" +MAINTAINER="pascal.bellard@slitaz.org" +LICENSE="GPL2" +SHORT_DESC="Tools for configuring WireGuard VPN." +WEB_SITE="https://www.wireguard.com/" +TARBALL="$PACKAGE-$VERSION.tar.xz" +WGET_URL="https://git.zx2c4.com/$PACKAGE/snapshot/$TARBALL" + +DEPENDS="" +BUILD_DEPENDS="" + +# Rules to configure and make the package. + +compile_rules() +{ + cd src && + make && + make DESTDIR=$DESTDIR install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir $fs/usr + cp -a $install/usr/bin $fs/usr +}