add kernel build infra and introduce development guide to README

This commit is contained in:
Alex Zenla
2024-02-19 01:29:11 +00:00
parent 1985ab4081
commit 73f1e980cd
5 changed files with 5709 additions and 0 deletions

2
kernel/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
linux-*
target/

22
kernel/build.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
set -e
cd "$(dirname "${0}")"
# shellcheck source=config.sh
. "${PWD}/config.sh"
if [ ! -f "${SRC_DIR_NAME}/Makefile" ]
then
rm -rf "${SRC_DIR_NAME}"
curl -L -o "${SRC_DIR_NAME}.txz" "${KERNEL_SRC_URL}"
tar xvf "${SRC_DIR_NAME}.txz"
rm "${SRC_DIR_NAME}.txz"
fi
mkdir -p "${OUTPUT_DIR_NAME}"
cp hypha.config "${SRC_DIR_NAME}/.config"
make -C "${SRC_DIR_NAME}" "${@}" olddefconfig
make -C "${SRC_DIR_NAME}" "${@}" bzImage
cp "${SRC_DIR_NAME}/arch/x86/boot/bzImage" "${OUTPUT_DIR_NAME}/kernel"

5
kernel/config.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
KERNEL_VERSION="6.7.5"
KERNEL_SRC_URL="https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${KERNEL_VERSION}.tar.xz"
SRC_DIR_NAME="linux-${KERNEL_VERSION}"
OUTPUT_DIR_NAME="out"

5616
kernel/hypha.config Normal file

File diff suppressed because it is too large Load Diff