summaryrefslogtreecommitdiff
path: root/build/build-kernel
blob: 4265e947a814fe7e425e592268b0d11b0659221e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

VERSION="6.12.11"
MAJOR_VERSION="$(echo "$VERSION" | sed -E 's/^([0-9]*)\..*$/\1/g')"

SRC_DIR=".kernel"
URL="https://cdn.kernel.org/pub/linux/kernel/v$MAJOR_VERSION.x/linux-$VERSION.tar.xz"

TARGET_KERNEL="linux-$VERSION/arch/x86_64/boot/bzImage"

mkdir -p "$SRC_DIR"
cd "$SRC_DIR"

if [ ! -e "linux-$VERSION" ]; then
	curl "$URL" | tar -J -xvf -
fi

if [ ! -e "$TARGET_KERNEL" ]; then
	cd "linux-$VERSION"
	make defconfig
	make -j$(nproc)
fi

echo "$SRC_DIR/$TARGET_KERNEL"