Commit b15f89ba authored by Ophélie Gagnard's avatar Ophélie Gagnard Committed by Ophélie Gagnard

generation: Add kernel compiling script.

parent 7f8c707d
......@@ -5,6 +5,7 @@ GIT_ROOT=`git rev-parse --show-toplevel`
PROJECT_DIR=$GIT_ROOT
### TO BE MODIFIED BY USERS ###
KERNEL_VERSION=5.10.157
## Packages
MCA_PACKAGE_NAME=mca--static
FLB_PACKAGE_NAME=fluent-bit
......@@ -16,6 +17,8 @@ PLG_VERSION=0.2.1+1.0.293.nodep-1
SIGNING_KEY_NAME=db.key
### DO NOT MODIFY ###
KERNEL_COMPILATION_DIR="$GIT_ROOT"/generation/kernel-compilation
KERNEL_DIR="$KERNEL_COMPILATION_DIR"/extracted-image-package
# used mainly in dracut.module/configure
MCA_NAME_AND_VERSION=${MCA_PACKAGE_NAME}_${MCA_VERSION}
FLB_NAME_AND_VERSION=${FLB_PACKAGE_NAME}_${FLB_VERSION}
......
......@@ -16,6 +16,7 @@ git config --local user.name "Ophelie Gagnard"
# building initramfs
apt -y install dracut-core dracut dracut-network sbsigntool pip
apt -y build-dep linux
#pip install slapos.libnetworkcache
NC_DIR=strategies_slapos.libnetworkcache
cd ..
......
#!/bin/bash
set -e
# get the root of the git repository
GIT_ROOT=$(git rev-parse --show-toplevel)
cd "$GIT_ROOT"
source generation/00env.sh
KERNEL_COMPILATION_DIR=kernel-compilation
nproc=32
apt -y build-dep linux
mkdir -p "$KERNEL_COMPILATION_DIR" && cd "$KERNEL_COMPILATION_DIR"
if [ ! -f linux-"$KERNEL_VERSION".tar.xz ]; then
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-"$KERNEL_VERSION".tar.xz
tar -xaf linux-"$KERNEL_VERSION".tar.xz
fi
cd linux-"$KERNEL_VERSION"
make olddefconfig
make menu config
./scripts/config \
-d CONFIG_MODULE_SIG_ALL \
-d CONFIG_MODULE_SIG_KEY \
-d CONFIG_SYSTEM_TRUSTED_KEYS \
-d CONFIG_DEBUG_INFO \
-e CONFIG_EFI_STUB
# include every modules in the kernel
cp .config .config.backup
sed -i 's/=m$/=y/g' .config
make deb-pkg -j"$(nproc)" LOCALVERSION=-"$(dpkg --print-architecture)" KDEB_PKGVERSION="$(make $KERNEL_VERSION)-1"
cd ..
dpkg -x linux-image-"$KERNEL_VERSION"-amd64_"$KERNEL_VERSION"-1_amd64.deb "$KERNEL_DIR"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment