Skip to main content

Longan Configuration and Build

Longan builds the T527 bootloader, kernel, BSP, Device Tree, and firmware inputs. Run its configuration and build commands from the Longan root.

cd <ANDROID_TOP>/longan
pwd
ls build.sh bsp device kernel

Select a Target​

./build.sh config

A typical Linux BSP selection is:

platform : linux
linux_dev : bsp
kern_ver : linux-5.15
ic : t527
board : <BOARD>
flash : default

A typical Android selection is:

platform : android
ic : t527
board : <BOARD>
flash : default

Use the board list printed by the current branch. Common names include demo, demo_car, and demo_linux_aiot, but company branches may use custom targets.

Inspect the generated configuration:

cat .buildconfig

Important variables include LICHEE_PLATFORM, LICHEE_IC, LICHEE_BOARD, LICHEE_KERN_VER, LICHEE_KERN_DEFCONF, LICHEE_PACK_HOOK, and LICHEE_OUT_DIR.

Common Commands​

CommandPurpose
./build.sh configSelect platform, chip, board, and flash
./build.shBuild the current Longan target
./build.sh bootloaderBuild boot0 and U-Boot components
./build.sh kernelBuild kernel, BSP, DTS, and modules
./build.sh menuconfigOpen kernel configuration
./build.sh saveconfigSave kernel configuration
./build.sh loadconfig <defconfig>Load a selected defconfig
./build.sh buildrootBuild the Buildroot target
./build.sh buildroot_menuconfigOpen Buildroot configuration
./build.sh buildroot_saveconfigSave Buildroot configuration
./build.sh packPackage a Linux image or invoke the configured pack hook
./build.sh pack_debugPackage with the debug serial-port setting
./build.sh cleanClean the current target output
./build.sh distcleanRemove additional generated configuration and output

Full Android firmware is commonly packaged from the Android root with pack or build -p. Whether ./build.sh pack works for Android depends on the branch and LICHEE_PACK_HOOK.

Directory Shortcuts​

Some SDKs provide:

source build/envsetup.sh
cbsp
ckernel
cconfigs

Use direct paths and find when those shell functions are not available.

Locate Output​

find out -maxdepth 5 -type f \
\( -name 'vmlinux' -o -name '*.dtb' -o -name '*.ko' -o -name '*.img' \) \
-print | head -100

Common locations include out/t527/<BOARD>/kernel/build/, kernel/staging/, pack_out/, and the top-level image output.