mirror of
https://github.com/rancher/os-kernel.git
synced 2025-09-04 22:30:32 +00:00
hello world
This commit is contained in:
35
scripts/build-kernel
Executable file
35
scripts/build-kernel
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
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="$(cd ${ARTIFACTS}; echo Ubuntu-*.tar.*)"
|
||||
DIR=linux-${KERNEL/.tar.*//}
|
||||
|
||||
cd ${BUILD}
|
||||
|
||||
if [ ! -e ${DIR} ]; then
|
||||
echo Extracting ${ARTIFACTS}/Ubuntu-*.tar.*
|
||||
TEMP=$(mktemp -d -p ${BUILD})
|
||||
trap "rm -rf ${TEMP}" exit
|
||||
|
||||
tar xf ${ARTIFACTS}/Ubuntu-*.tar.* -C $TEMP
|
||||
mv ${TEMP}/${DIR} ${DIR}
|
||||
fi
|
||||
|
||||
|
||||
cd ${DIR}
|
||||
cp ${CONFIG}/kernel-config .config
|
||||
|
||||
make oldconfig
|
||||
make -j$(nproc) tar-pkg
|
||||
|
||||
mkdir -p ${DIST}/kernel
|
||||
mv linux*.tar ${DIST}/kernel
|
||||
make headers_install INSTALL_HDR_PATH=${DIST}/kernel/headers
|
Reference in New Issue
Block a user