利用buildroot构造powerpc交叉编译环境

来源:互联网 发布:北京linux培训哪家好 编辑:程序博客网 时间:2024/05/16 05:06

环境:fedora21(64bit)

下载buildroot:
http://www.buildroot.org/downloads/buildroot-2015.02.tar.gz

一、安装必要软件

 #yum install which sed make binutils build-essential gcc g++ bash patch gzip bzip2 perl tar cpio python unzip rsync # yum install ncurses-devel

二、解压

 # tar jxvf buildroot-2015.02.tar.bz2  # cd buildroot-2015.02

三、配置
(1)
在configs里面有不同板卡的配置,我这里选择的是ppc64。

 # make  configs/qemu_ppc64_pseries_defconfig 

这样会生成一个.config,然后
(2)

make menuconfig

根据需要选择不同的配置就可以,最后保存退出。

四、编译

 # make 

就 可以了
这个需要几个小时,中途不要断网。

PS:
make之后,在目录output里面会有下面几个子目录
images/ where all the images (kernel image, bootloader and root filesystem images) are stored. These are the files you need to put on your target system.
build/ where all the components are built (this includes tools needed by Buildroot on the host and packages compiled for the target). This directory contains one subdirectory for each of these components.
staging/ which contains a hierarchy similar to a root filesystem hierarchy. This directory contains the headers and libraries of the cross-compilation toolchain and all the userspace packages selected for the target. However, this directory is not intended to be the root filesystem for the target: it contains a lot of development files, unstripped binaries and libraries that make it far too big for an embedded system. These development files are used to compile libraries and applications for the target that depend on other libraries.
target/ which contains almost the complete root filesystem for the target: everything needed is present except the device files in /dev/ (Buildroot can’t create them because Buildroot doesn’t run as root and doesn’t want to run as root). Also, it doesn’t have the correct permissions (e.g. setuid for the busybox binary). Therefore, this directory should not be used on your target. Instead, you should use one of the images built in the images/ directory. If you need an extracted image of the root filesystem for booting over NFS, then use the tarball image generated in images/ and extract it as root. Compared to staging/, target/ contains only the files and libraries needed to run the selected target applications: the development files (headers, etc.) are not present, the binaries are stripped.
host/ contains the installation of tools compiled for the host that are needed for the proper execution of Buildroot, including the cross-compilation toolchain.

参考:http://www.buildroot.org/downloads/manual/manual.html#requirement-optional

0 0