File: jury-rig.sh

package info (click to toggle)
wireguard-linux-compat 1.0.20210219-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,132 kB
  • sloc: ansic: 29,468; perl: 10,790; asm: 3,245; sh: 646; makefile: 425
file content (16 lines) | stat: -rwxr-xr-x 543 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.

K="$1"
WG="$(readlink -f "$(dirname "$(readlink -f "$0")")/../src/")"

if [[ ! -e $K/net/Kconfig ]]; then
	echo "You must specify the location of kernel sources as the first argument." >&2
	exit 1
fi

ln -sfT "$WG" "$K/net/wireguard"
sed -i "/^obj-\\\$(CONFIG_NETFILTER).*+=/a obj-\$(CONFIG_WIREGUARD) += wireguard/" "$K/net/Makefile"
sed -i "/^if INET\$/a source \"net/wireguard/Kconfig\"" "$K/net/Kconfig"