Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
en:xu4_building_kernel [2015/09/21 10:53] brian.kim [Checkout] |
en:xu4_building_kernel [2015/09/21 11:19] (current) tobetter [Checkout] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Linux (v4.2 - experimental) ====== | ||
+ | This page introduce how you can download and compile the Linux kernel for **ODROID-XU4**, especially for mainline kernel. You need to use the **gcc version 4.9** to build the Linux Kernel. | ||
+ | ===== Toolchain (4.9.2)===== | ||
+ | Click one of the site to download toolchain to build Linux kernel. | ||
+ | * [[http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz|Download #1]] | ||
+ | * [[http://dn.odroid.com/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz|Download #2]] | ||
+ | Once the download is done, extract the tarball to **/opt/toolchains/**. | ||
+ | <code> | ||
+ | $ sudo mkdir -p /opt/toolchains | ||
+ | $ sudo tar xvf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz -C /opt/toolchains/ | ||
+ | </code> | ||
+ | In order to add the toolchain path to PATH, paste below lines to **$HOME/.bashrc**. | ||
+ | <code> | ||
+ | export ARCH=arm | ||
+ | export CROSS_COMPILE=arm-linux-gnueabihf- | ||
+ | export PATH=/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/:$PATH | ||
+ | </code> | ||
+ | You can check if the toolchain installed above works properly while checking the version of toolchain. If you can find **gcc version 4.9.2 20140904 (prerelease)** at the end of the line, the toolchain is well installed. | ||
+ | <code> | ||
+ | $ arm-linux-gnueabihf-gcc -v | ||
+ | Using built-in specs. | ||
+ | COLLECT_GCC=/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc | ||
+ | COLLECT_LTO_WRAPPER=/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../libexec/gcc/arm-linux-gnueabihf/4.9.2/lto-wrapper | ||
+ | Target: arm-linux-gnueabihf | ||
+ | Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.9-2014.09/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran --disable-multilib --enable-multiarch --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard --with-pkgversion='crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-plugin --enable-gold --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-c99 --enable-long-long --with-mode=thumb --disable-multilib --with-float=hard | ||
+ | Thread model: posix | ||
+ | gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) | ||
+ | |||
+ | </code> | ||
+ | ===== Checkout ===== | ||
+ | You can checkout **Kernel** source tree from **[[https://github.com/tobetter/linux/commits/odroidxu4-v4.2|tobetter's Github]]**. | ||
+ | Please note that we distribute the Linux kernel in different branches for Android and other Linux distributions. | ||
+ | |||
+ | <code> | ||
+ | $ git clone --depth 1 https://github.com/tobetter/linux -b odroidxu4-v4.2 | ||
+ | $ cd linux | ||
+ | </code> | ||
+ | |||
+ | |||
+ | ===== Compile ===== | ||
+ | Before compiling, you must configure for **ODROID-XU4** with following command. | ||
+ | |||
+ | <code> | ||
+ | $ make odroidxu4_defconfig | ||
+ | $ make | ||
+ | </code> | ||
+ | Then you can start to build Linux kernel image, **zImage**. This will create **arch/arm/boot/zImage**. You can also add **-j** option for fast compile. | ||
+ | ===== Installation ===== | ||
+ | <WRAP center round important 100%> | ||
+ | ** This explanation assume that your USB memory CARD reader is assigned at /dev/sdc. Be careful!** | ||
+ | </WRAP> | ||
+ | |||
+ | 1. Plug the Boot-Device(eMMC or SD) into the USB memory CARD reader and Connect the USB memory CARD reader to your HOST PC(Linux OS). | ||
+ | |||
+ | 2. Copy the zImage and DT(exynos5422-odroidxu4.dtb) to the FAT partition(1st partition) in the Boot-Device. | ||
+ | <code> | ||
+ | $ mkdir -p mount | ||
+ | $ sudo mount /dev/sdc1 mount/ | ||
+ | $ sudo cp arch/arm/boot/zImage mount/ | ||
+ | $ sudo cp arch/arm/boot/dts/exynos5422-odroidxu4.dtb mount/ | ||
+ | $ sync | ||
+ | $ sudo umount mount/ | ||
+ | </code> | ||
+ | |||
+ | 3. Copy the driver modules to the EXT4 partition(2nd partition) in the Boot-Device. | ||
+ | <code> | ||
+ | $ sudo mount /dev/sdc2 mount/ | ||
+ | $ sudo make modules_install ARCH=arm INSTALL_MOD_PATH=mount/ | ||
+ | $ sync | ||
+ | $ sudo umount mount/ | ||
+ | </code> |