1
0
mirror of https://github.com/rancher/os-kernel.git synced 2025-04-29 19:13:18 +00:00
os-kernel/scripts/build-kernel

31 lines
864 B
Plaintext
Raw Normal View History

2015-08-05 16:53:05 +00:00
#!/bin/bash
2015-09-17 07:44:12 +00:00
set -e
2015-08-05 16:53:05 +00:00
cd $(dirname $0)/..
source scripts/build-common
2016-07-10 05:07:19 +00:00
source scripts/version
2015-08-05 16:53:05 +00:00
export CCACHE_DIR="${HOME}/.kernel-ccache"
export CC="ccache gcc"
export PATH="/usr/lib/ccache:$PATH"
2016-07-10 05:07:19 +00:00
DIR=${VERSION}
2015-10-01 15:43:09 +00:00
FIRMWARE=$(readlink -f scripts/firmware)
2016-04-20 04:58:56 +00:00
MODULE_LIST=$(readlink -f modules.list)
MODULE_EXTRA_LIST=$(readlink -f modules-extra.list)
2015-08-05 16:53:05 +00:00
if [ -e "/source/dist/kernel/linux-${KERNEL_VERSION}-x86.tar.gz" ]; then
2018-11-08 08:10:23 +00:00
echo "skipping kernel build - found linux-${KERNEL_VERSION}-rancher-x86.tar.gz in ./dist/kernel/"
else
2018-11-08 08:10:23 +00:00
cd ${BUILD}/${DIR}
make oldconfig
KVER=$(make kernelrelease)
if [ -e "linux-${KERNEL_VERSION}-x86.tar" ] \
&& [ "$KVER" == "$KERNEL_VERSION" ]; then
echo "Skipping kernel build, found linux-${KERNEL_VERSION}-x86.tar in $(pwd)"
else
echo "building $KVER"
make -j$(nproc) tar-pkg
fi
fi