使用docker干净又卫生地编译Pixhwark 4 Firmware固件(Pixhwark 2.4.8硬件)
下载源码
cd files
git clone https://github.com/PX4/Firmware.git
cd Firmware
下载docker镜像
docker pull px4io/px4-dev-nuttx-focal:2023-06-26
开始编译
docker run --rm -it --privileged \
-v $PWD:/tmp:rw \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-e DISPLAY=${DISPLAY} \
--network=bridge \
--name=px4-build-env px4io/px4-dev-nuttx-focal:2023-06-26 /bin/bash -c "export https_proxy=http://192.168.0.101:7890 http_proxy=http://192.168.0.101:7890 all_proxy=socks5://192.168.0.101:7890 && cd /tmp && make 'px4_fmu-v4_default'"
提示:仍然需要连接网络,因为源码还需要下载子模块,例如nuttx.
效果
参考文献
[https://docs.px4.io/main/zh/test_and_ci/docker.html]
[https://github.com/HCFlight/docker-px4]
[https://hub.docker.com/r/px4io/px4-dev-nuttx-focal]
[https://hub.docker.com/r/px4io/px4-dev-armhf]