ODROID XU4 内核编译

准备材料
一个64位的Linux系统
一份内核源码
交叉编译工具链

添加交叉编译工具链。下载链接

$ sudo mkdir /opt/toolchains

$ sudo cp arm-eabi-4.6.tar.gz /opt/toolchains

$ cd /opt/toolchains

$ sudo tar zxvf arm-eabi-4.6.tar.gz

添加环境变量

在~/.bashrc里面添加

export ARCH=arm
export PATH=${PATH}:/opt/toolchains/arm-eabi-4.6/bin
export CROSS_COMPILE=arm-eabi-

source ~/.bashrc 然后看下编译环境是否已经配好了。

$ arm-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-eabi-gcc
COLLECT_LTO_WRAPPER=/opt/toolchain/arm-eabi-4.6/bin/../libexec/gcc/arm-eabi/4.6.x-google/lto-wrapper
Target: arm-eabi
Configured with: /tmp/android-15472/src/build/../gcc/gcc-4.6/configure –prefix=/usr/local –target=arm-eabi –host=x86_64-linux-gnu
–build=x86_64-linux-gnu –with-gnu-as –with-gnu-ld –enable-languages=c,c++ –with-gmp=/tmp/android-15472/obj/temp-install –with-
mpfr=/tmp/android-15472/obj/temp-install –with-mpc=/tmp/android-15472/obj/temp-install –without-ppl –without-cloog –disable-libs
sp –enable-threads –disable-nls –disable-libmudflap –disable-libgomp –disable-libstdc__-v3 –disable-sjlj-exceptions –disable-
shared –disable-tls –disable-libitm –with-float=soft –with-fpu=vfp –with-arch=armv5te –enable-target-optspace –with-abi=aapcs
–with-gcc-version=4.6 –with-binutils-version=2.21 –with-gmp-version=4.2.4 –with-mpfr-version=2.4.1 –with-gdb-version=7.3.x –w
ith-arch=armv5te –with-sysroot=/tmp/android-15472/install/sysroot –with-prefix=/tmp/android-15472/install –with-gold-version=2.21
–enable-gold –disable-gold –disable-multilib –program-transform-name=’s&^&arm-eabi-&’
Thread model: single
gcc version 4.6.x-google 20120106 (prerelease) (GCC)

还有一些工具没得话顺便装上

sudo apt-get install git gcc g++ build-essential

编译

$ git clone –depth 1 https://github.com/hardkernel/linux -b odroidxu4-4.14.y

$ cd linux

$ make odroidxu4_defconfig

$ make -j8

$ sudo make modules_install

$ sudo cp -f arch/arm/boot/zImage /media/boot

$ sudo cp -f arch/arm/boot/dts/exynos5422-odroidxu3.dtb /media/boot

$ sudo cp -f arch/arm/boot/dts/exynos5422-odroidxu4.dtb /media/boot

$ sudo cp -f arch/arm/boot/dts/exynos5422-odroidxu3-lite.dtb /media/boot

$ sync

你可能感兴趣的:(ODROID,XU4)