mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-21 01:01:18 -08:00
build-for-ubuntu.sh builds tswg.ko for a given Ubuntu kernel release in a private copy of src/, so test builds for different guest kernels don't share object files with each other or with a developer's in-place build. The Makefile's SRC is now overridable to allow that. vmtest.sh runs the tswg natlab vmtests, which live in a tailscale.com checkout (on the bradfitz/tswg branch) because they use its natlab framework and the Go tswg netlink client there. Updates #426 Signed-off-by: Brad Fitzpatrick <[email protected]> Change-Id: I00eb5cbf8df5a203d6d39d541779060db74da9a1
28 lines
660 B
Bash
Executable File
28 lines
660 B
Bash
Executable File
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# build-for-ubuntu.sh builds tswg.ko for the given Ubuntu kernel release
|
|
# (such as 6.8.0-106-generic) in a private copy of src/ under OUTDIR, and
|
|
# prints the path of the resulting tswg.ko to stdout. All build output goes
|
|
# to stderr.
|
|
#
|
|
# usage: build-for-ubuntu.sh KERNEL_RELEASE OUTDIR
|
|
|
|
set -eu
|
|
|
|
if [ $# -ne 2 ]; then
|
|
echo "usage: $0 KERNEL_RELEASE OUTDIR" >&2
|
|
exit 2
|
|
fi
|
|
kver=$1
|
|
out=$2
|
|
top=$(cd "$(dirname "$0")/.." && pwd)
|
|
|
|
kdir=$("$top/scripts/ubuntu-headers.sh" "$kver")
|
|
|
|
mkdir -p "$out"
|
|
rm -rf "$out/src"
|
|
cp -r "$top/src" "$out/src"
|
|
make -C "$top" KDIR="$kdir" SRC="$out/src" >&2
|
|
echo "$out/src/tswg.ko"
|