在没有开发板的时候,如果想要对u-boot进行编译,运行,执行相应的命令,那么就可以使用U-boot的沙箱功能,编译出来的U-boot能在Linux主机上运行。
使用U-boot的sandbox功能的具体步骤
1、make sandbox_defconfig all
可能出现问题
‘sdl-config: Command not found’ you may need to
install libsdl1.2-dev or similar to get SDL support.
解决方法:sudo apt-get install libsdl1.2-devFatal Error: openssl/evp.h No such file or directory
解决方法:sudo apt-get install libssl-devYour dtc is too old, please upgrade to dtc 1.4 or newer,
解决方法:sudo apt-get install device- tree-compiler
另外要注意编译工具的配置
在最顶层makefile中,当我们编译arm开发板会写成下面这样,
ifeq ($(HOSTARCH),$(ARCH))
CROSS_COMPILE ?=
endif
CROSS_COMPILE ?= arm-linux-gnueabi-
上面的写法会导致编译出错,因为现在是在Linux主机上运行,不能使用arm-linux-gnueabi-gcc编译器,故要写成