Skip to content

Building

Akari Tsuyukusa edited this page Jun 26, 2026 · 12 revisions
git clone https://github.com/TeamYogaBlade2/linux
# you may like
#  clone --filter=blob:none
#  clone --depth=1
cd linux
export ARCH=arm
export LLVM=1
make lenovo-blade_defconfig
make
cat arch/arm/boot/zImage arch/arm/boot/dts/mediatek/mt6589-lenovo-b8000-f.dtb > path_to_kernel
./scripts/clang-tools/gen_compile_commands.py

You may like make -j10 or export CROSS_COMPILE=arm-none-eabi- (CROSS_COMPILE=arm-linux-gnueabihf- ?)

cat ../linux/arch/arm/boot/zImage ../linux/arch/arm/boot/dts/mediatek/mt6589-lenovo-b8000-f.dtb > boot/boot.img-kernel && echo boot | ./repack_MTK_img boot && fastboot flash boot boot.img && fastboot reboot

Device Tree

The stock bootloader (lk) probably doesn't have Device Tree support. So, lenovo-blade_defconfig uses CONFIG_ARM_APPENDED_DTB.

Once you've built the kernel, you must always add dtb to the end of zImage.

Otherwise, the kernel might mistake the garbage data for Device Tree.

Clone this wiki locally