wok rev 25437

Add wireguard for linux64
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Aug 31 17:31:14 2022 +0000 (19 months ago)
parents 01119cbefbc3
children 8ea0030e77cb
files linux64-wireguard/receipt linux64-wireguard/stuff/socket.u wireguard-tools/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/linux64-wireguard/receipt	Wed Aug 31 17:31:14 2022 +0000
     1.3 @@ -0,0 +1,46 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="linux64-wireguard"
     1.7 +VERSION="1.0.20220627"
     1.8 +CATEGORY="base-system"
     1.9 +MAINTAINER="pascal.bellard@slitaz.org"
    1.10 +LICENSE="GPL2"
    1.11 +SHORT_DESC="The Wireguard VPN kernel module."
    1.12 +WEB_SITE="https://www.wireguard.com/"
    1.13 +SOURCE="wireguard-linux-compat"
    1.14 +TARBALL="$SOURCE-$VERSION.tar.xz"
    1.15 +WGET_URL="https://git.zx2c4.com/$SOURCE/snapshot/$TARBALL"
    1.16 +
    1.17 +DEPENDS="linux64"
    1.18 +BUILD_DEPENDS="linux64-module-headers xz uclibc-cross-compiler-x86_64"
    1.19 +SUGGESTED="wireguard-tools"
    1.20 +
    1.21 +AUFS_NOT_RAMFS="uclibc-cross-compiler-x86_64 is not compatible with aufs+tmpfs 8("
    1.22 +
    1.23 +# Rules to configure and make the package.
    1.24 +
    1.25 +compile_rules()
    1.26 +{
    1.27 +	cd src
    1.28 +	sed -i '/Wframe-larger-than=2048/d' Kbuild
    1.29 +	patch -p0 < $stuff/socket.u
    1.30 +	make -k ARCH=x86_64 KERNELDIR="/usr/src/linux" && xz wireguard.ko
    1.31 +}
    1.32 +	
    1.33 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.34 +genpkg_rules()
    1.35 +{	
    1.36 +	EXTRAVERSION=_$kvers
    1.37 +	mkdir -p $fs/lib/modules/$kvers-slitaz64/kernel/misc
    1.38 +	cp $src/src/wireguard.ko.xz $fs/lib/modules/$kvers-slitaz64/kernel/misc
    1.39 +}
    1.40 +
    1.41 +post_install()
    1.42 +{
    1.43 +	chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz64
    1.44 +}
    1.45 +
    1.46 +post_remove()
    1.47 +{
    1.48 +	depmod -a
    1.49 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/linux64-wireguard/stuff/socket.u	Wed Aug 31 17:31:14 2022 +0000
     2.3 @@ -0,0 +1,25 @@
     2.4 +--- socket.c
     2.5 ++++ socket.c
     2.6 +@@ -358,7 +358,6 @@
     2.7 + 	struct socket *new4 = NULL, *new6 = NULL;
     2.8 + 	struct udp_port_cfg port4 = {
     2.9 + 		.family = AF_INET,
    2.10 +-		.local_ip.s_addr = htonl(INADDR_ANY),
    2.11 + 		.local_udp_port = htons(port),
    2.12 + 		.use_udp_checksums = true
    2.13 + 	};
    2.14 +@@ -366,12 +365,13 @@
    2.15 + 	int retries = 0;
    2.16 + 	struct udp_port_cfg port6 = {
    2.17 + 		.family = AF_INET6,
    2.18 +-		.local_ip6 = IN6ADDR_ANY_INIT,
    2.19 + 		.use_udp6_tx_checksums = true,
    2.20 + 		.use_udp6_rx_checksums = true,
    2.21 + 		.ipv6_v6only = true
    2.22 + 	};
    2.23 ++	memset(&port6.local_ip6, 0, 16); // port6.local_ip6 = IN6ADDR_ANY_INIT;
    2.24 + #endif
    2.25 ++	port4.local_ip.s_addr = htonl(INADDR_ANY);
    2.26 + 
    2.27 + 	rcu_read_lock();
    2.28 + 	net = rcu_dereference(wg->creating_net);
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/wireguard-tools/receipt	Wed Aug 31 17:31:14 2022 +0000
     3.3 @@ -0,0 +1,30 @@
     3.4 +# SliTaz package receipt.
     3.5 +
     3.6 +PACKAGE="wireguard-tools"
     3.7 +VERSION="1.0.20210914"
     3.8 +CATEGORY="base-system"
     3.9 +MAINTAINER="pascal.bellard@slitaz.org"
    3.10 +LICENSE="GPL2"
    3.11 +SHORT_DESC="Tools for configuring WireGuard VPN."
    3.12 +WEB_SITE="https://www.wireguard.com/"
    3.13 +TARBALL="$PACKAGE-$VERSION.tar.xz"
    3.14 +WGET_URL="https://git.zx2c4.com/$PACKAGE/snapshot/$TARBALL"
    3.15 +
    3.16 +DEPENDS=""
    3.17 +BUILD_DEPENDS=""
    3.18 +
    3.19 +# Rules to configure and make the package.
    3.20 +
    3.21 +compile_rules()
    3.22 +{
    3.23 +	cd src &&
    3.24 +	make &&
    3.25 +	make DESTDIR=$DESTDIR install
    3.26 +}
    3.27 +	
    3.28 +# Rules to gen a SliTaz package suitable for Tazpkg.
    3.29 +genpkg_rules()
    3.30 +{	
    3.31 +	mkdir $fs/usr
    3.32 +	cp -a $install/usr/bin $fs/usr
    3.33 +}