#!/bin/bash ROOT_DIR=$(readlink -f $(dirname $(readlink -f $0))/..) . $ROOT_DIR/config/setup.conf cd $ROOT_DIR/build if [ ! -d linux-${kernel_version} ]; then echo -e "[build-kernel] \t\t Can't find kernel-sources. Re-run kernel env setup." $ROOT_DIR/bin/env.setup-kernel.sh fi echo -e "[build-kernel]\t\t Update Kernel config." cd linux-${kernel_version} cp ${ROOT_DIR}/config/kernel.config ./.config mkdir -p $ROOT_DIR/build/log yes "" | linux32 make oldconfig > $ROOT_DIR/build/log/kernel-oldconfig.log 2>&1 echo -e "[build-kernel]\t\t Build Kernel (Could take some time)." linux32 make -j $make_num_jobs > $ROOT_DIR/build/log/kernel-compile.log 2>&1 cp arch/x86/boot/bzImage ../kernel-preboot-latest KERNEL_SIZE=$(stat -c %s ${ROOT_DIR}/build/kernel-preboot-latest) echo -e "[build-kernel] \t\t New Kernel build successfully." echo -e "\t\t\t Location: ${ROOT_DIR}/build/kernel-preboot-latest ." echo -e "\t\t\t Size: ${KERNEL_SIZE} bytes." cd - >/dev/null 2>&1