Skip to content

Instantly share code, notes, and snippets.

@travisdowns
Last active November 29, 2018 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save travisdowns/3f9e68746fe961c5976825c3952676d3 to your computer and use it in GitHub Desktop.
Save travisdowns/3f9e68746fe961c5976825c3952676d3 to your computer and use it in GitHub Desktop.
#!/bin/bash
LINUX=linux-4.19.5
set -e
set -x
if [ -z "$THREADS" ]; then
echo "set THREADS to the number of compilation threads"
exit 1
fi
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi
sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
# kernel build deps
sudo apt-get install -y ccache flex bison bc fakeroot libncurses5-dev libssl-dev
TARFILE=${LINUX}.tar.xz
curl https://cdn.kernel.org/pub/linux/kernel/v4.x/${TARFILE} -o ${TARFILE}
time tar xf ${TARFILE}
cd ${LINUX}
# do the cross-compile
ARCH=arm make defconfig
time ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j${THREADS}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment