====== Linux ====== This page introduce how you can download and compile the Linux system kernel for **ODROID-XU3/XU4**. Generic Linux system needs **gcc version 4.6** to build the Kernel. ===== Step-by-Step guide to building an ODROID-XU3/4 Kernel ===== === Download the cross tool chain package === [ http://dn.odroid.com/ODROID-XU/compiler/arm-eabi-4.6.tar.gz ] Note * This toolchain only used to build the kernel. * This toolchain is included in the Android source package. ($ANDROID_ROOT/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6) === Copy the cross tool package to /opt/toolchains === If the '/opt/toolchains' directory does not exist in host pc, then create the directory. $ 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 === Uncompress the cross tool with tar command === $ cd /opt/toolchains $ sudo tar xvfz arm-eabi-4.6.tar.gz === Add Path in your environment file === Modify your ~/.bashrc file to add a new path with editor (gedit or vi) export ARCH=arm export PATH=${PATH}:/opt/toolchains/arm-eabi-4.6/bin export CROSS_COMPILE=arm-eabi- To apply this change, login again or restart the .bashrc $ source ~/.bashrc === Check the tool-chain path to see if it is set up correctly or not. === $ 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) ====== Linux ====== Linux ODROID-XU3/4 works as follow: It must have at least two partitions. First Partition must be a FAT32/EXT4 partition. Second Partition can be whatever the Filesystem that your kernel supports (must be built in). Note: It is possible to use the first partition as ext4, however its strongly not recommended due to Windows Users lost the capability of changing boot.ini === Partition Contents === Partition 1: * Kernel Image (zImage) * boot.scr * exynos5422-odroidxu3.dtb * uInitrd (if applicable) Partition 2: * rootfs (a.k.a. File System) === Currently Supported Linux Distributions === * Ubuntu 16.04 [[en:xu3_release_linux_ubuntu|Software Release for Linux/Ubuntu on XU4/XU3]] Note: More distribution support will come with time. === HDMI Support On Linux === HDMI support should work out-of-box for everyone including framebuffer console if you experience any issue please contact us on the [[http://forum.odroid.com|ODROID Forums]] On the provided Ubuntu image there are several examples on how to configure the HDMI to your specific resolution or even lock to a certain resolution. You can check the configuration file on /media/boot/boot.ini of the Ubuntu Image === DisplayPort Support on Linux === For displayport configuration please follow this guide [[http://forum.odroid.com/viewtopic.php?f=95&t=5976|Displayport Guide on ODROID Forums]] === Kernel Sources === Kernel sources for ODROID-XU3/4 is on our [[http://github.com/hardkernel/linux|Github]]. Branch is **odroidxu3-3.10.y** defconfig is **odroidxu3_defconfig** === Kernel Rebuild Guide === Note You must do this steps in **ODROID-XU3/4 board**. You can compile kernel & dtb images in host PC using the cross compiler. But, you cannot create uInitrd ramdisk image in host PC. Because the binary files in ramdisk image refer to current root file system during the executing 'update-initramfs' command. Please follow the instructions below to rebuild the Linux Kernel for ODROID. Those instructions cover native build of the Kernel. Install dependencies: odroid@odroid:~$ sudo apt-get install build-essential libqt4-dev libncurses5-dev git Clone Repo: odroid@odroid:~$ git clone --depth 1 https://github.com/hardkernel/linux.git -b odroidxu3-3.10.y odroidxu3-3.10.y odroid@odroid:~$ cd odroidxu3-3.10.y Configure Kernel: odroid@odroid:~$ make odroidxu3_defconfig Do changes if you need/want: odroid@odroid:~$ make menuconfig Build Kernel and Modules: odroid@odroid:~$ make -j8 ** This explanation assume that your USB memory CARD reader is assigned at /dev/sdb. Be careful!** Install zImage & DTB file: odroid@odroid:~$ mkdir -p mount odroid@odroid:~$ sudo mount /dev/sdb1 ./mount odroid@odroid:~$ sudo cp arch/arm/boot/zImage arch/arm/boot/dts/exynos5422-odroidxu3.dtb /media/boot && sync && sudo umount ./mount Install Modules: odroid@odroid:~$ sudo mount /dev/sdb2 ./mount odroid@odroid:~$ sudo make modules_install ARCH=arm INSTALL_MOD_PATH=./mount && sync && sudo umount ./mount odroid@odroid:~$ rm -rf mount Copy .config to /boot for initramfs creation: odroid@odroid:~$ sudo cp .config /boot/config-`make kernelrelease` Create initramfs: odroid@odroid:~$ sudo update-initramfs -c -k `make kernelrelease` Create uInitrd: odroid@odroid:~$ sudo mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n uInitrd -d /boot/initrd.img-`make kernelrelease` /boot/uInitrd-`make kernelrelease` Install new uInitrd: odroid@odroid:~$ sudo cp /boot/uInitrd-`make kernelrelease` /media/boot/uInitrd reboot: odroid@odroid:~$ sudo sync && reboot Your new kernel should be installed. Note for your own convenience we provide daily builds of Linux kernel that can be easily installed on Supported distros by using a ODROID Utility. odroid@odroid:~$ sudo -s root@odroid:~$ wget -O /usr/local/bin/odroid-utility.sh https://raw.githubusercontent.com/mdrjr/odroid-utility/master/odroid-utility.sh root@odroid:~$ chmod +x /usr/local/bin/odroid-utility.sh root@odroid:~$ odroid-utility.sh