Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:u3_building_kernel [2015/02/03 18:03] charles.park [Installation] |
en:u3_building_kernel [2015/12/07 09:02] odroid [Toolchain] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Linux ====== | ||
+ | This page introduce how you can download and compile the Linux system kernel for **ODROID-U3**. We recommend to use the **gcc version 4.7.3** for Kernel building. | ||
+ | |||
+ | ===== Toolchain ===== | ||
+ | Click one of the site to download toolchain to build Linux system kernel. | ||
+ | * [[https://releases.linaro.org/13.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux.tar.bz2|Download #1]] | ||
+ | * [[http://dn.odroid.com/toolchains/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux.tar.bz2|Download #2]] | ||
+ | Once the download is done, extract the tarball to **/opt/toolchains/**. | ||
+ | <code> | ||
+ | $ sudo mkdir -p /opt/toolchains | ||
+ | $ sudo tar jxvf gcc-linaro-arm-linux-gnueabihf-4.7-2012.12-20121214_linux.tar.bz2 -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.7-2013.04-20130415_linux/bin:$PATH | ||
+ | </code> | ||
+ | You can apply the change if you login again or import | ||
+ | to apply this change, login again or evaluate **$HOME/.bashrc** with source command. | ||
+ | <code> | ||
+ | $ source ~/.bashrc | ||
+ | </code> | ||
+ | You can check if the toolchain installed above works properly while checking the version of toolchain. If you can find **gcc version 4.7.3 20130328 (prerelease)** at the end of the line, the toolchain is well installed. | ||
+ | <code> | ||
+ | $ arm-linux-gnueabihf-gcc -v | ||
+ | Using built-in specs. | ||
+ | COLLECT_GCC=arm-linux-gnueabihf-gcc | ||
+ | COLLECT_LTO_WRAPPER=/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04- | ||
+ | 20130415_linux/bin/../libexec/gcc/arm-linux-gnueabihf/4.7.3/lto-wrapper | ||
+ | Target: arm-linux-gnueabihf | ||
+ | Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.7- | ||
+ | 2013.04/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 --enable-multilib --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16 -- | ||
+ | with-float=hard --with-pkgversion='crosstool-NG linaro-1.13.1-4.7-2013.04-20130415 - Linaro GCC 2013.04' --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-ppl=/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 --with-host-libstdcxx='- | ||
+ | L/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static/lib - | ||
+ | lpwl' --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --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 | ||
+ | Thread model: posix | ||
+ | gcc version 4.7.3 20130328 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.04-20130415 - Linaro GCC 2013.04) | ||
+ | </code> | ||
+ | |||
+ | |||
+ | If your host PC has any x86-32bit library compatibility issue, install the related packages. | ||
+ | <code> | ||
+ | sudo dpkg --add-architecture i386 | ||
+ | sudo apt-get update | ||
+ | sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 | ||
+ | </code> | ||
+ | ===== Checkout ===== | ||
+ | You can checkout **Kernel** source tree from **[[https://github.com/hardkernel/linux/tree/odroid-3.8.y|Hardkernel'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/hardkernel/linux.git -b odroid-3.8.y | ||
+ | $ cd linux | ||
+ | </code> | ||
+ | |||
+ | |||
+ | ===== Compile ===== | ||
+ | Before compiling, you must configure for **ODROID-U3** with following command. | ||
+ | |||
+ | <code> | ||
+ | $ make odroidu_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 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 && 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 | ||
+ | $ rm -rf mount | ||
+ | </code> | ||
+ | |||