Skip to content

Building U Boot and Linux kernel

Wenting Zhang edited this page Mar 25, 2022 · 2 revisions

The NekoInk uses out-of-tree U-boot and Linux kernel. This page describes how to get the source and build them.

First make sure you have all the tools installed for building. I am using Ubuntu 21.10 with GCC 10 to build the system. If your system have a higher GCC version and having issue building the system, probably consider using a linaro toolchain.

To install the dependencies on Ubuntu:

sudo apt install build-essential git gcc-arm-linux-gnueabihf flex bison libncurses5-dev

Note if you are on Ubuntu 21.10+, you should use gcc-arm-linux-gnueabihf-10 instead due to the issue: https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1824923.html. Then select to use gcc 10 for compiling:

update-alternatives --install /usr/bin/arm-linux-gnueabihf-cpp arm-linux-gnueabihf-cpp /usr/bin/arm-linux-gnueabihf-cpp-10 50
update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-10 50
update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc-ar arm-linux-gnueabihf-gcc-ar /usr/bin/arm-linux-gnueabihf-gcc-ar-10 50
update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc-ranlib arm-linux-gnueabihf-gcc-ranlib /usr/bin/arm-linux-gnueabihf-gcc-ranlib-10 50

To build the U-Boot:

git clone https://github.com/zephray/uboot-imx
cd uboot-imx
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make nekoink_defconfig
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j4

The u-boot-spl.imx is the file to use.

To build the linux:

git clone https://github.com/zephray/linux-imx
cd linux-imx
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make nekoink_defconfig
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j4

The arch/arm/boot/zImage and arch/arm/boot/dts/imx6ull-nekoink.dtb are the file to use.