Skip to content

Commit

Permalink
Merge pull request #2 from imikushin/headers
Browse files Browse the repository at this point in the history
build headers
  • Loading branch information
imikushin committed Sep 21, 2015
2 parents 9980dc0 + c2e570e commit f8fc2b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 8 additions & 3 deletions scripts/build-common
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ set -e
: ${KERNEL_URL:="https://github.com/rancher/linux/archive/Ubuntu-3.19.0-27.29.tar.gz"}
: ${KERNEL_SHA1:="84b9bc53bbb4dd465b97ea54a71a9805e27ae4f2"}
: ${ARTIFACTS:=$(pwd)/assets}
: ${BUILD:=$(pwd)/build}
: ${BUILD:=/usr/src}
: ${CONFIG:=$(pwd)/config}
: ${DIST:=$(pwd)/dist}

DOCKER_FILE=${CONFIG}/.dockerfile

mkdir -p ${BUILD} ${DIST}

write_base()
{
if [ "${BASE_WRITTEN}" = "true" ]; then
Expand Down Expand Up @@ -112,3 +110,10 @@ download()
return 1
fi
}

list_build_files() {
find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl
find $(find ./arch/${SRCARCH} -name include -o -name scripts -type d) ./include ./scripts -type f
find ./arch/${SRCARCH} -name module.lds -o -name Kbuild.platforms -o -name Platform
find . -name Module.symvers -type f
}
8 changes: 5 additions & 3 deletions scripts/build-kernel
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash
set -e

cd $(dirname $0)/..

source scripts/build-common

apt-get install -y build-essential libncurses5-dev bc ccache

export CCACHE_DIR="${HOME}/.kernel-ccache"
export CC="ccache gcc"
export PATH="/usr/lib/ccache:$PATH"
KERNEL=$(basename ${KERNEL_URL})
DIR=${KERNEL/.tar.*//}

mkdir -p ${BUILD}
cd ${BUILD}

if [ ! -e ${DIR} ]; then
Expand All @@ -31,7 +31,9 @@ cp ${CONFIG}/kernel-config .config
make oldconfig
make -j$(nproc) tar-pkg

list_build_files | tar -czf build.tar.gz -T /dev/stdin

mkdir -p ${DIST}/kernel
mv linux*.tar ${DIST}/kernel
gzip ${DIST}/kernel/linux*.tar
make headers_install INSTALL_HDR_PATH=${DIST}/kernel/headers
mv build.tar.gz ${DIST}/kernel

0 comments on commit f8fc2b7

Please sign in to comment.