blob: 888d94ae400337efdd4178100fb76cf0df66b3b2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/bash
FETCH_SCRIPT="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/fetch.sh"
if ! cd "$1"; then
echo "$1 does not exist." >&2
exit 1
fi
if [[ ! -e net/Kconfig ]]; then
echo "You must specify the location of kernel sources as the first argument." >&2
exit 1
fi
[[ $(< net/Makefile) == *wireguard* ]] || sed -i "/^obj-\\\$(CONFIG_NETFILTER).*+=/a obj-\$(CONFIG_WIREGUARD) += wireguard/" net/Makefile
[[ $(< net/Kconfig) == *wireguard* ]] || sed -i "/^if INET\$/a source \"net/wireguard/Kconfig\"" net/Kconfig
[[ -f net/.gitignore && $(< net/.gitignore) == *wireguard* ]] || echo "wireguard/" >> net/.gitignore
cp "$FETCH_SCRIPT" scripts/fetch-latest-wireguard.sh
chmod +x scripts/fetch-latest-wireguard.sh
[[ $(< scripts/Kbuild.include) == *fetch-latest-wireguard.sh* ]] || echo '$(shell cd "$(srctree)" && ./scripts/fetch-latest-wireguard.sh)' >> scripts/Kbuild.include
if [[ -d .git ]]; then
git add scripts/Kbuild.include scripts/fetch-latest-wireguard.sh net/.gitignore net/Kconfig net/Makefile
git commit -s -m "net/wireguard: add wireguard importer" scripts/Kbuild.include scripts/fetch-latest-wireguard.sh net/.gitignore net/Kconfig net/Makefile
fi
|