ubuntu14.04 下载安装 yocto平台

ubuntu 14.04 yocto平台安装编译

 

1.首先安装必须的软件包:


$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat

$ sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html \
docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils \
libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc

$ sudo apt-get install u-boot-tools

2 下载yocto

$ mkdir ~/bin
$ curl http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo > ~/bin/repo  //修改了这条命令,实测可行(一次没有连接上的话多试几次就可以)
$ chmod a+x ~/bin/repo
$ export PATH=~/bin:$PATH
$ mkdir fsl-release-bsp
$ cd fsl-release-bsp
$ git config --global user.name "Your Name"
$ git config --global user.email "Your Email"
$ git config --list
$ repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-3.14.28-1.0.0_ga

$ repo sync

3. 1编译 以IMX6QSABRESD为例

$ cd fslrelease-bsp
$ MACHINE=imx6qsabresd source fsl-setup-release.sh -b build-x11 -e x11 //在fsl-release-bsp 路径下设置环境
$ bitbake -c menuconfig virtual/kernel //内核配置
$ bitbake -c cleansstate linux-imx  //清理之前的编译状态
$ bitbake linux-imx //单独编译内核
$ bitbake fsl-image-gui //编译整个工程

3.2 交叉编译工具制作

 

如上在build 目录下执行命令
$ bitbake meta-toolchain
编译工具,然后在tmp/deploy/sdk/目录下看到poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.7.sh,在该目录下执行
$ sh poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.7.sh
然后出现
     [sudo] password for daiane:

    Enter target directory for SDK (default: /opt/poky/1.4.1):

    You are about to install the SDK to "/opt/poky/1.4.1". Proceed[Y/n]?y

    Extracting SDK...done

    Setting it up...done

    SDK has been successfully set up and is ready to be used.
表示成功安装了交叉编译工具。然后就可以使用环境变量
    source /opt/poky/1.7/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi

比如采用该工具编译hello.c

在使用前先配置

$  $CC -o hello hello.c   (注意CC 前面有符号$ 要带上)

 

 

 

 

 

 

你可能感兴趣的:(yocto平台)