1. 下载解压源码包
1.1 将源码包下载到虚拟机/root/目录下(使用网盘里面的ubuntu22.04虚拟机)
1.2 执行 tar -zxvf longan-h618-2024-12-30.tar.gz
1.3 解压得出/root/longan-h618目录
sudo chmod -R 777 ./root
2. 配置
2.1 执行 cd /root/longan-h618/ 进入目录
2.2 执行 ./build.sh config 输入 1 1 0 0 0
3. 解压根文件
3.1 执行 cd /root/longan-h618/rootfile/ 进入目录
3.1 执行 rm -rf rootfs 删除老文件
3.2 执行 tar -zxvf rootfs-ds-hx1x-server-2024-12-30.tar.gz 解压根文件,如果要编译桌面版,则执行 tar -zxvf rootfs-ds-hx1x-desktop-2024-12-30.tar.gz
3.3 根文件系统目录:/root/longan-h618/rootfile/rootfs/
4. 往根文件增加软件包(如不需要添加则跳过)
4.1 cd /root/longan-h618/rootfile/ 进入目录
4.2 ./ch-mount.sh -m rootfs/ 进入仿真运行环境,使用apt命令,根据需要增加包。
4.3 exit 退出仿真环境
4.4 ./ch-mount.sh -u rootfs/ 取消挂载根文件
5. 如需修改内核配置,执行(如不需要则跳过)
5.1 cd /root/longan-h618/ 进入目录
5.2 加载默认内核配置./build.sh loadconfig
5.3 修改内核配置./build.sh menuconfig
5.4 保存当前配置为默认内核配置文件./build.sh saveconfig
6. 编译固件
6.1 执行 cd /root/longan-h618/ 进入目录
6.2 执行./build.sh 编译SDK,会自动编译内核、设备树、打包根文件系统(u-boot不会编译)
./build.sh 2>&1 | tee build_$(date +%Y%m%d_%H%M%S).log
6.3 执行./build.sh pack 生成固件,固件目录:/root/longan-h618/out/h618_dragonboard_1GB_uart0.img
7.设备树路径
U-BOOT路径
/brandy/brandy-2.0/u-boot-2018/arch/arm/dts
7.1 /root/longan-h618/device/config/chips/h618/configs/…/linux-5.4/board.dts
7.2 /root/longan-h618/kernel/linux-5.4/arch/arm64/boot/dts/sunxi/sun50iw9.dtsi
8.单独编译内核
9.1 ./build.sh kernel
./build.sh kernel 2>&1 | tee kernel_build_$(date +%Y%m%d_%H%M%S).log
9.2 重新执行./build.sh pack打包固件
9.单独编译u-boot
10.1 ./build.sh bootloader
10.2 重新执行./build.sh pack打包固件
apt install build-essential cmake g++ libgl1-mesa-dev
sudo apt install libxcb-xinerama0-dev # 解决可能的依赖问题
用到的dtb
arch/arm/dts/sun50iw9p1-soc-system.dtb
/root/longan-h618/brandy/brandy-2.0/u-boot-2018/arch/arm/dts/.board-uboot.dts
/root/longan-h618/device/config/chips/h618/configs/p1/uboot-board.dts
交叉编译链的位置
/root/longan-h618/out/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu
/root/longan-h618/out/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
ARM-QT路径
/opt/qt-5.15.2/bin/qmake
1.报错信息:
qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “” even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
2.解决方法(deepseek给的解决方法之一)
sudo apt install libxcb-xinerama0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinput0 libxcb-xfixes0 libxcb-randr0 libxcb-shape0 libxcb-sync1 libxcb-xkb1 libxkbcommon-x11-0 libxcb-util1
sudo apt install libxcb-cursor0 libxcb-cursor-dev
/opt/Qt/5.15.2/wasm_32/mkspecs/qconfig.pri
/opt/Qt/5.15.2/gcc_64/mkspecs/qconfig.pri
/opt/Qt/5.15.2/android/mkspecs/qconfig.pri
vi /opt/qt-5.15.2/mkspecs/qconfig.pri
将Qt库复制到ARM
scp /opt/qt-5.15.2/lib/* root@192.168.0.139:/usr/lib/
包含 struct disp_video_timings video_timing[]
//开启后 显示
export DISPLAY=:0
./t3 -platform xcb
//刷机
1:
sudo nmcli –ask dev wifi connect mini_5G password fsw2021fsw ifname wlan0
sudo nmcli –ask dev wifi connect TP-LINK_7787 password yyxlx18396870603 ifname wlan0
2:
//vi /root/.bashrc
vi /root/.profile
# 在文件末尾添加
export DISPLAY=:0
# 保存后立即生效
//source /root/.bashrc
source /root/.profile
3.将Qt库复制到ARM
scp /opt/qt-5.15.2/lib/* root@192.168.0.139:/usr/lib/
4.关闭自动更新
# 编辑自动更新配置
sudo vi /etc/apt/apt.conf.d/20auto-upgrades
将文件内容修改为:
APT::Periodic::Update-Package-Lists “1”;
APT::Periodic::Unattended-Upgrade “0”;
