yocto环境学习--环境搭建

开发环境:ubuntu14.04
开发板:IMX6UL


1.安装必要的工具

yangzhiwen@yzw-kingsee:~$sudo apt-get -y install gawk wget git-core diffstat unzip texinfo gcc-multilib
yangzhiwen@yzw-kingsee:~$sudo apt-get -y install build-essential chrpath socat libsdl1.2-dev
yangzhiwen@yzw-kingsee:~$sudo apt-get -y install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html
yangzhiwen@yzw-kingsee:~$sudo apt-get -y install docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils
yangzhiwen@yzw-kingsee:~$sudo apt-get -y install libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc


2.安装repo,googleapis下载不到了,我存了份可以试下,拷至~/bin目录下,不必再curl下载了。repo下载:http://download.csdn.net/detail/yangzhiwen56/9316477

yangzhiwen@yzw-kingsee:~$mkdir ~/bin
yangzhiwen@yzw-kingsee:~$curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
yangzhiwen@yzw-kingsee:~$chmod a+x ~/bin/repo
yangzhiwen@yzw-kingsee:~$export PATH=~/bin:$PATH


3.下载源码

yangzhiwen@yzw-kingsee:~$ cd /home/work/workspace/
yangzhiwen@yzw-kingsee:/home/work/workspace$mkdir fsl-release-bsp
yangzhiwen@yzw-kingsee:/home/work/workspace$cd fsl-release-bsp
yangzhiwen@yzw-kingsee:/home/work/workspace/fsl-release-bsp$repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-3.14.38-6UL_ga
yangzhiwen@yzw-kingsee:/home/work/workspace/fsl-release-bsp$repo sync


4.编译
yangzhiwen@yzw-kingsee:/home/work/workspace/fsl-release-bsp$mkdir build_qt5
yangzhiwen@yzw-kingsee:/home/work/workspace/fsl-release-bsp$MACHINE=imx6ulevk source fsl-setup-release.sh -b build_qt5 -e x11
yangzhiwen@yzw-kingsee:/home/work/workspace/fsl-release-bsp/build_qt5$bitbake fsl-image-qt5


5.编译结果在build_qt5/tmp/deploy/images/imx6ulevk

yangzhiwen@yzw-kingsee:/home/work/workspace/fsl-release-bsp/build_qt5$cd tmp/deploy/images/imx6ulevk
yangzhiwen@yzw-kingsee:/home/work/workspace/fsl-release-bsp/build_qt5/tmp/deploy/images/imx6ulevk$ ls
fsl-image-qt5-imx6ulevk-20151127094054.rootfs.ext3      fsl-image-qt5-imx6ulevk.tar.bz2                     zImage
fsl-image-qt5-imx6ulevk-20151127094054.rootfs.manifest  modules--3.14.38-r0-imx6ulevk-20151125061858.tgz    zImage--3.14.38-r0-imx6ul-14x14-evk-20151125061858.dtb
fsl-image-qt5-imx6ulevk-20151127094054.rootfs.sdcard    modules-imx6ulevk.tgz                               zImage--3.14.38-r0-imx6ul-14x14-evk-csi-20151125061858.dtb
fsl-image-qt5-imx6ulevk-20151127094054.rootfs.tar.bz2   README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt  zImage--3.14.38-r0-imx6ulevk-20151125061858.bin
fsl-image-qt5-imx6ulevk.ext3                            u-boot.imx                                          zImage-imx6ul-14x14-evk-csi.dtb
fsl-image-qt5-imx6ulevk.manifest                        u-boot-imx6ulevk.imx                                zImage-imx6ul-14x14-evk.dtb
fsl-image-qt5-imx6ulevk.sdcard                          u-boot-sd-2015.04-r0.imx                            zImage-imx6ulevk.bin
yangzhiwen@yzw-kingsee:/home/work/workspace/fsl-release-bsp/build_qt5/tmp/deploy/images/imx6ulevk$


6.烧录,TF卡分2个区,前面保留Uboot空间
#uboot
sudo dd if=u-boot-imx6ulevk.imx of=/dev/sdb bs=1k seek=1 conv=fsync
#kernel
sudo mount /dev/sdb1 /home/work/mountpoint
sudo cp ./zImage /home/work/mountpoint/
sudo cp ./zImage-imx6ul-14x14-evk.dtb /home/work/mountpoint/imx6ul-14x14-evk.dtb
sudo umount /dev/sdb1
#filesystem
sudo mount /dev/sdb2 /home/work/mountpoint/
sudo mount -o loop -t ext3 ./fsl-image-qt5-imx6ulevk.ext3 /home/work/rootfs
sudo cp -af /home/work/rootfs/* /home/work/mountpoint/
sudo umount /dev/sdb2
sudo umount /home/work/rootfs

7.上电,log如下

Running local boot scripts (/etc/rc.local).
Poky (Yocto Project Reference Distro) 1.8 imx6ulevk /dev/ttymxc0
imx6ulevk login: root
root@imx6ulevk:~# ls
root@imx6ulevk:~# ls /
bin   dev  home  lost+found  mnt  proc  sbin  tmp         usr
boot  etc  lib   media       opt  run   sys   unit_tests  var
root@imx6ulevk:~#

你可能感兴趣的:(环境,Linux驱动,yocto)