您的位置:首页 > 其它

u-boot-2012.10 官方文档翻译-U-BOOT的修改、移植到新硬件

2012-12-20 16:41 330 查看
U-BOOT的修改、移植到新硬件

如果你修改了U-BOOT源码(例如增加了一个新板或者新的设备,一个新的CPU等等),你必须提供反馈给其他开发者。这个反馈通常是用"patch"文件的格式,即一个上下文差异对,一个确定的U-BOOT源码版本号。

但是在你提交补丁之前,请确认没有破坏现有的代码。最后确保所有支持的板在编译时没有任何警告。这样做,仅需要运行"MAKEALL"脚本,这将会配置和构建U-BOOT支持的所有系统。警告,这将需要一些时间。你可以通过传递一个"CROSS_COMPILE"环境变量给这个脚本,用来指定使用的交叉编译器,例如使用ELDK交叉编译器键入:

CROSS_COMPILE=ppc_8xx- MAKEALL

当使用MAKEALL脚本时,默认的行为是在U-BOOT源目录下构建。这个位置可以通过改变BUILD_DIR环境变量来设置。此外,对于每个目标的构建,MAKEALL脚本会在<source dir>LOG目录下存储两个日志文件(<target>.ERR 和<target>.MAKEALL)。这个默认位置可以通过改变MAKEALL_LOGDIR环境变量来设置。例如:

export BUILD_DIR=/tmp/build

export MAKEALL_LOGDIR=/tmp/log

CROSS_COMPILE=ppc_8xx- MAKEALL

使用上面的设置,建立的项目会存储在/tmp/build,日志存储在/tmp/log,并且源码树目录在整个构建期间会保持清洁。

接下来看"U-BOOT Porting Guide"(U-BOOT移植指南)

英文:

Testing of U-Boot Modifications, Ports to New Hardware, etc.:

==============================================================

If you have modified U-Boot sources (for instance added a new board

or support for new devices, a new CPU, etc.) you are expected to

provide feedback to the other developers. The feedback normally takes

the form of a "patch", i. e. a context diff against a certain (latest

official or latest in the git repository) version of U-Boot sources.

But before you submit such a patch, please verify that your modifi-

cation did not break existing code. At least make sure that *ALL* of

the supported boards compile WITHOUT ANY compiler warnings. To do so,

just run the "MAKEALL" script, which will configure and build U-Boot

for ALL supported system. Be warned, this will take a while. You can

select which (cross) compiler to use by passing a `CROSS_COMPILE'

environment variable to the script, i. e. to use the ELDK cross tools

you can type

CROSS_COMPILE=ppc_8xx- MAKEALL

or to build on a native PowerPC system you can type

CROSS_COMPILE=' ' MAKEALL

When using the MAKEALL script, the default behaviour is to build

U-Boot in the source directory. This location can be changed by

setting the BUILD_DIR environment variable. Also, for each target

built, the MAKEALL script saves two log files (<target>.ERR and

<target>.MAKEALL) in the <source dir>/LOG directory. This default

location can be changed by setting the MAKEALL_LOGDIR environment

variable. For example:

export BUILD_DIR=/tmp/build

export MAKEALL_LOGDIR=/tmp/log

CROSS_COMPILE=ppc_8xx- MAKEALL

With the above settings build objects are saved in the /tmp/build,

log files are saved in the /tmp/log and the source tree remains clean

during the whole build process.

See also "U-Boot Porting Guide" below.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: