Add wireguard patch instructions

This commit is contained in:
RealStickman 2022-07-29 19:10:24 +02:00
parent 7ff7c7b943
commit eed146f01c

View File

@ -34,6 +34,7 @@ max_size = 30G
cache_dir = /var/lineageos-cache
```
`$ export PATH="${PATH}:/home/exu/.local/bin"`
`$ echo 'export USE_CCACHE=1' >> ~/.bashrc`
### Install repo tool
@ -63,12 +64,61 @@ Initialize the repo
Sync repo content
This can take a long time
`$ repo sync --force-sync`
`$ repo sync`
Repo fetches the latest version automatically, so we can use a symlink
`$ ln -sf /var/lineageos-build/lineage/.repo/repo/repo ~/.local/bin/repo`
### Download device source files
## Add Wireguard patch to kernel
### Fetch source
Create the file `(SRC_DIR)/.repo/local_manifests/wireguard.xml`
`(SRC_DIR)` is your `.../lineage/` directory
Make sure to replace `(KERNEL_DIR)` with your device's kernel directory.
For example `(SRC_DIR)/kernel/oneplus/msm8996`
```
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="zx2c4" fetch="https://git.zx2c4.com/" />
<project remote="zx2c4" name="wireguard-linux-compat" path="kernel/wireguard-linux-compat" revision="master" sync-s="true">
<linkfile src="src" dest="(KERNEL_DIR)/net/wireguard" />
</project>
</manifest>
```
Run `repo sync`
### Add kernel patch
Edit `(KERNEL_DIR)/net/Makefile`
```
obj-$(CONFIG_LLC) += llc/
obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/
obj-$(CONFIG_NETFILTER) += netfilter/
+obj-$(CONFIG_WIREGUARD) += wireguard/
obj-$(CONFIG_INET) += ipv4/
obj-$(CONFIG_XFRM) += xfrm/
obj-$(CONFIG_UNIX) += unix/
```
Edit `(KERNEL_DIR)/net/Kconfig`
```
if INET
source "net/ipv4/Kconfig"
source "net/ipv6/Kconfig"
source "net/netlabel/Kconfig"
+source "net/wireguard/Kconfig"
```
Edit `(KERNEL_DIR)/arch/(ARCH)/configs/lineageos_(DEVICE)_defconfig`
```
CONFIG_L2TP=y
CONFIG_BRIDGE=y
+CONFIG_WIREGUARD=y
```
## Download device source files
Activate the build environment
`$ . ./build/envsetup.sh`