kernel

Required packages

Before building kernel for Odroid Go advance on Ubuntu desktop, you need to install the required packages as follows.

$ sudo apt-get update &&\
sudo apt-get install -y git lzop build-essential gcc \
    bc libncurses5-dev libc6-i386 lib32stdc++6 zlib1g:i386

Toolchain (6.3.1)

Download toolchain and extract the tarball to /opt/toolchains/.

$ sudo mkdir -p /opt/toolchains &&\
wget https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/aarch64-linux-gnu/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu.tar.xz &&\
sudo tar Jxvf gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu.tar.xz -C /opt/toolchains/

To set up information for compilation, paste below lines to $HOME/.bashrc.

export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
export PATH=/opt/toolchains/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/:$PATH

Execute the below command to apply the setting.

$ source ~/.bashrc

Check the toolchain version to confirm compatibility.

$ aarch64-linux-gnu-gcc -v
...
COLLECT_LTO_WRAPPER=/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/../libexec/gcc/aarch64-linux-gnu/6.3.1/lto-wrapper
...
gcc version 6.3.1 20170109 (Linaro GCC 6.3-2017.02)

Cloning kernel from Git

$ git clone https://github.com/hardkernel/linux.git -b odroidgoA-4.4.y

Building kernel

$ cd linux &&\
make odroidgo2_defconfig

If memory and disk size are enough and it has no other tasks, run 'make -j $(expr $(expr $(nproc) \* 6) \/ 5)' instead of 'make' for quick compilation.

$ make [-j4]
$ ls arch/arm64/boot/Image
arch/arm64/boot/Image
 
$ ls arch/arm64/boot/dts/rockchip/rk3326-odroidgo2-linux.dtb 
arch/arm64/boot/dts/rockchip/rk3326-odroidgo2-linux.dtb

Linux

This explanation assume that your USB memory CARD reader is assigned at /dev/sdc. Be careful!

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 Image and DT(rk3326-odroidgo2-linux.dtb) to the FAT partition(1st partition) in the Boot-Device.

$ mkdir -p mount
$ sudo mount /dev/sdc1 ./mount
$ sudo cp arch/arm64/boot/Image arch/arm64/boot/dts/rockchip/rk3326-odroidgo2-linux.dtb ./mount && sync && sudo umount ./mount

3. Copy the driver modules to the EXT4 partition(2nd partition) in the Boot-Device.

$ sudo mount /dev/sdc2 ./mount
$ sudo make modules_install ARCH=arm64 INSTALL_MOD_PATH=./mount && sync && sudo umount ./mount
$ rm -rf mount