How to Build Linux Kernel for Myon I
This is only a quick-reference on how to build a Linux Kernel including Keith & Koep specific changes.
For details please view the Linux and Dragonboard 410c documentation from Linaro. Linaro Build instructions and 96boards Build & Update Linux kernel for Debian
1. Setup Machine:
You will need a debian based Linux Environment (we prefer Ubuntu):
$ mkdir toolchain $ wget releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/gcc-*-x86_64_aarch64-linux-gnu.tar.xz $ tar -xf gcc-*-x86_64_aarch64-linux-gnu.tar.xz -C ./toolchain --strip-components=1
sudo apt-get install git build-essential kernel-package fakeroot libncurses5-dev libssl-dev ccache abootimg android-tools-mkbootimg
Get the source Code from gitlab:
git clone http://gitlab.keith-koep.com/philipp/Myon-Linux-Kernel/tree/myon_4.14.0
2. Build Kernel
Set compilation environment variables
export ARCH=arm64 export CROSS_COMPILE=`pwd`/../toolchain/bin/aarch64-linux-gnu-
Generate Linux kernel config file
make defconfig distro.config kuk-myon.config
Make kernel
make -j4 Image.gz dtbs KERNELRELEASE=4.14.0-myon-arm64 make -j4 modules KERNELRELEASE=4.14.0-myon-arm64
Install modules
make modules_install KERNELRELEASE=4.14.0-myon-arm64 INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=myon_modules
Building a boot image
cat arch/$ARCH/boot/Image.gz arch/$ARCH/boot/dts/qcom/apq8016-kuk-myon.dtb > Image.gz+dtb
wget http://releases.linaro.org/96boards/dragonboard410c/linaro/debian/19.01/initrd.img-4.14.0-qcomlt-arm64 -O initrd.img
mkbootimg --kernel Image.gz+dtb \ --ramdisk initrd.img \ --output boot-db410c.img \ --pagesize 2048 \ --base 0x80000000 \ --cmdline "root=/dev/disk/by-partlabel/rootfs rw rootwait console=ttyMSM0,115200n8"
3. Booting/Install a custom boot Image
To boot or install the new boot Image, you have to switch to fastboot mode and connect the usb cable
sudo fastboot boot boot-db410c.img
sudo fastboot flash boot boot-db410c.img
Install a rootfs Image Get the latest Image from linaro
Install the kernel use the follwing commands to update the modules.
tar -cjf 4.14.0-myon-arm64.tar.bz2 4.14.0-myon-arm64/ scp 4.14.0-myon-arm64.r.bz2 linaro@ip_address_of_myon:~/ ssh linaro@ip_address_of_myon tar -xjvf 4.14.0-myon-arm64.tar.bz2 mv 4.14.0-myon-arm64 /lib/modules/ sudo depmod -a