【寫在前面】:下載:YOCTO的安裝鏡像可以從http://www.freescale.com/zh-Hans/webapp/sps/site/prod_summary.jsp?code=SDKLINUX 下載
使用手冊可以從 http://pan.baidu.com/s/1hqIhtEO 下載
環境:Ubuntu14.04
YOCTO_1.7
開發板2020rdb
一、YOCTO 安裝
1.
(准備安裝目錄 /work ,並在mount下創建源文件掛載目錄 /mnt/yocto_cdrom)
# cd /
# mkdir work
# chmod 777 work
# cd /mnt/
# mkdir yocto_cdrom
# chmod 777 yocto_cdrom
2.
# cd (源文件目錄)
# sudo mount -o loop QorIQ-Linux-SDK-V1.7-Yocto-Source-ISO.iso
# /mnt/yocto_cdrom
3.
#/mnt/yocto_cdrom/install
(在彈出的窗口中選擇安裝目錄 /work , 生成/work/QorIQ-SDK-V1.7-20141218-yocto)
4.
# cd /work/QorIQ-SDK-V1.7-20141218-yocto
( 如果不能執行 apt-get,輸入/usr/sbin/visudo向彈出的文件中添加
root ALL = NOPASSWD: /usr/bin/apt-get
apollosun ALL = NOPASSWD: /usr/bin/apt-get)
# ./poky/scripts/host-prepare.sh
(執行完此命令后,ubuntu會下載安裝一些yocto運行時需要的東西。)
4.
# cd /work/QorIQ-SDK-V1.7-20141218-yocto
(進入QorIQ 安裝目錄執行,在那里執行,build_..._release生成在那里>)
#source ./fsl-setup-poky -m p2020rdb
(會生成一個目錄:/work/QorIQ-SDK-V1.7-20141218-yocto /build_p2020rdb_release)
5.
# cd /work/QorIQ-SDK-V1.7-20141218-yocto /build_p2020rdb_release
# bitbake fsl-image-minimal
執行完后,在目錄<yocto_install_path>/build_p2020rdb_release/tmp/deploy/images里生成uboot,kernel,rootfs images等一些東西
二、YOCTO 編譯
1.u-boot
# cd /work/QorIQ-SDK-V1.7-20141218-yocto
# bitbake -c cleansstate u-boot (兩個s)
# bitbake -c patch u-boot (如此才可以從本地編譯,不從網上fetch代碼)
# cd /work/QorIQ-SDK-V1.7-20141218-yocto /build_p2020rdb_release
# bitbake -e u-boot |grep ^S= (獲得u-boot代碼路徑,進入后可修改)
<修改完成,進入release>
# cd /work/QorIQ-SDK-V1.7-20141218-yocto /build_p2020rdb_release
# source SOURCE_THIS
# bitbake -c compile -f u-boot >> log.txt (將輸出結果顯示在log.txt 中)
# bitbake u-boot
2.kernel
# cd /work/QorIQ-SDK-V1.7-20141218-yocto
# bitbake -c cleansstate virtual/kernel
# bitbake -c patch virtual/kernel
# bitbake -e virtual/kernel |grep ^S=
# update KERNEL_DEFCONFIG variable in meta-fsl-ppc/conf/machine/<machine>.conf (修改 kernel defconfig )
# update KERNEL_DEVICETREE variable in meta-fsl-ppc/conf/machine/<machine>.conf (修改 dts)
# bitbake -c menuconfig virtual/kernel (進入內核配置菜單菜單配置)
# screen -r devshell
# cd /work/QorIQ-SDK-V1.7-20141218-yocto /build_p2020rdb_release
# bitbake -c compile -f virtual/kernel
# bitbake virtual/kernel (編譯后的內核文件,會在build_<machine>_release/tmp/deploy/images/)
正在進行中。。。