For advanced users who want to customize their kernel or add hardware support.
Prerequisites
You need a Linux PC (x86_64) for cross-compilation:
Code: Select all
sudo apt install build-essential gcc-aarch64-linux-gnu bc bison flex libssl-dev
sudo apt install device-tree-compilerYou can use the mainline Linux kernel or the OpenStick fork:
Code: Select all
git clone https://github.com/OpenStick/linux.git
cd linuxThe device tree describes the hardware layout of your specific board. DTS files for MSM8916 devices are in:
Code: Select all
arch/arm64/boot/dts/qcom/Cross-Compile the Kernel
Code: Select all
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
# Use the OpenStick defconfig
make msm8916_defconfig
# Optional: customize config
make menuconfig
# Build
make -j$(nproc) Image.gz dtbs modulesMake sure these are enabled:
- — Qualcomm platform support
Code: Select all
CONFIG_ARCH_QCOM=y - or
Code: Select all
CONFIG_ATH10K=m— WiFi driverCode: Select all
CONFIG_WCN36XX=m - — USB gadget support
Code: Select all
CONFIG_USB_CONFIGFS=y - — Framebuffer for display support
Code: Select all
CONFIG_FB=y - — Modem data path
Code: Select all
CONFIG_QCOM_BAM_DMUX=y
The boot image combines the kernel, DTB, and initramfs. Use mkbootimg:
Code: Select all
mkbootimg --kernel arch/arm64/boot/Image.gz \
--dtb arch/arm64/boot/dts/qcom/msm8916-your-device.dtb \
--ramdisk initramfs.cpio.gz \
--base 0x80000000 \
--pagesize 2048 \
-o boot.imgCode: Select all
edl w boot boot.img --memory=emmcIf building your own kernel is too complex, consider Armbian images from the travis90x Armbian guide. These provide pre-built images with good hardware support.