首页 > 解决方案 > 主机 PC 中 u-boot 的依赖关系是什么?

问题描述

我正在尝试在 Cygwin 上交叉编译 u-boot。但是在安装了 arm 工具链之后,我发现仍然缺少大量的 require 库。例如,柔性野牛...

我在 u-boot 的自述文件中搜索了这些,但没有看到这样的关键字。那么有没有关于构建入门和主机要求的文档?

标签: cross-compilingu-boot

解决方案


在从VirtualBox 6.1.0 中的 lubuntu-18.04-desktop-amd64.iso启动的实时 Lubuntu 系统上,将通过以下命令安装所需的依赖项:

sudo apt install make gcc bison flex device-tree-compiler python3-distutils swig python3-dev

在实时 lubuntu-18.04-desktop-amd64 系统上构建最新 u-boot 的过程可以是:

# Using lubuntu-18.04-desktop-amd64.iso ISO image

wget "https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz?revision=fed31ee5-2ed7-40c8-9e0e-474299a3c4ac&la=en&hash=76DAF56606E7CB66CC5B5B33D8FB90D9F24C9D20"  -O gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz
sudo mkdir -p /opt/arm/9
sudo tar Jxf gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz -C /opt/arm/9

wget https://github.com/u-boot/u-boot/archive/v2020.01.tar.gz
tar zxf v2020.01.tar.gz

# in the case we would run live fron an ISO image
rm  https://github.com/u-boot/u-boot/archive/v2020.01.tar.gz v2020.01.tar.gz

sudo apt install make gcc bison flex device-tree-compiler python3-distutils swig python3-dev

make -C u-boot-2020.01 CROSS_COMPILE=/opt/arm/9/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf- mrproper nanopi_m1_defconfig  all

ls -g -G u-boot-2020.01/u-boot.*
-rw-rw-r-- 1  423674 Jan 10 20:16 u-boot-2020.01/u-boot.bin
-rw-rw-r-- 1   13103 Jan 10 20:15 u-boot-2020.01/u-boot.cfg
-rw-rw-r-- 1    8053 Jan 10 20:16 u-boot-2020.01/u-boot.cfg.configs
-rw-rw-r-- 1   19970 Jan 10 20:16 u-boot-2020.01/u-boot.dtb
-rw-rw-r-- 1   20113 Jan 10 20:16 u-boot-2020.01/u-boot.dtb.out
-rw-rw-r-- 1  423738 Jan 10 20:16 u-boot-2020.01/u-boot.img
-rw-rw-r-- 1    2343 Jan 10 20:16 u-boot-2020.01/u-boot.lds
-rw-rw-r-- 1  615871 Jan 10 20:16 u-boot-2020.01/u-boot.map
-rwxrwxr-x 1 1211266 Jan 10 20:16 u-boot-2020.01/u-boot.srec
-rw-rw-r-- 1  164646 Jan 10 20:16 u-boot-2020.01/u-boot.sym

如果在 Cygwin 上构建不是您的最终目标,我强烈建议在您的 Windows PC 上使用VirtualBoxWSL:您将节省大量时间并确保您能够构建 u-boot。


推荐阅读