summaryrefslogtreecommitdiff
path: root/build/build-kernel
diff options
context:
space:
mode:
Diffstat (limited to 'build/build-kernel')
-rwxr-xr-xbuild/build-kernel24
1 files changed, 24 insertions, 0 deletions
diff --git a/build/build-kernel b/build/build-kernel
new file mode 100755
index 0000000..4265e94
--- /dev/null
+++ b/build/build-kernel
@@ -0,0 +1,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"