Files
mu300-linux/kernel/build-linux.sh
T
Abdurrahman Kaan DikeçandClaude Opus 5 2e1650e3f1 MU300/ZTE F50: custom 5.4 kernel, Ubuntu 26.04 rootfs, modem/PM bring-up, Wi-Fi
Boot tooling, kernel config fragment and patches, systemd units, Android vendor
runtime extraction scripts and the technical findings for running Linux on the
ZTE F50 / MU300 (Unisoc T760).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 21:51:13 +03:00

32 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# Build the MU300 Linux kernel: stock F50 config + mu300-linux.fragment, ThinLTO
set -e
cd /src/zte-u30air
OUT=/src/out-linux
mkdir -p $OUT
M="make O=$OUT ARCH=arm64 LLVM=1 LLVM_IAS=1 CC=clang LD=ld.lld -j10"
cp /work/device.config $OUT/.config
./scripts/config --file $OUT/.config --enable THINLTO
KCONFIG_CONFIG=$OUT/.config ./scripts/kconfig/merge_config.sh -m -O $OUT $OUT/.config /work/mu300-linux.fragment > /work/merge.log 2>&1
$M olddefconfig
# report fragment options that Kconfig refused (dependency not met / symbol missing)
python3 - <<'P'
import re
want={}
for l in open('/work/mu300-linux.fragment'):
m=re.match(r'(CONFIG_[A-Z0-9_]+)=(.*)',l) or re.match(r'# (CONFIG_[A-Z0-9_]+) is not set',l)
if m: want[m.group(1)]=m.group(2) if m.lastindex==2 else 'n'
got={}
for l in open('/src/out-linux/.config'):
m=re.match(r'(CONFIG_[A-Z0-9_]+)=(.*)',l) or re.match(r'# (CONFIG_[A-Z0-9_]+) is not set',l)
if m: got[m.group(1)]=m.group(2) if m.lastindex==2 else 'n'
bad=[f'{k}: want {v} got {got.get(k,"absent")}' for k,v in want.items() if got.get(k,'n' if v=='n' else 'absent')!=v]
open('/work/fragment-rejected.txt','w').write('\n'.join(bad)+'\n'); print('fragment rejected:',len(bad))
P
cp $OUT/.config /work/linux.config
start=$(date +%s)
$M Image modules 2>&1 | grep -E "error|Error|warning: unused|LTO|^make" | tail -40
echo "BUILD_SECONDS $(( $(date +%s) - start ))"
ls -la $OUT/arch/arm64/boot/Image
find $OUT -name "*.ko" | wc -l