2014年9月4日 星期四

Bitbake .... what a Fxxx

先看這篇
http://www.eettaiwan.com/ART_8800658883_676964_TA_def90a4a.HTM?jumpto=view_welcomead_1409798439009

Hello Bitbake World
http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/

How should you create your Bitbake recipe
http://stackoverflow.com/questions/20853404/bitbake-default-bb-base-bbclass-does-not-define-a-useful-default-task

in sources/meta-fsl-arm/classes/image_types_fsl.bbclass :

#
# Create an image that can by written onto a SD card using dd for use
# with i.MX SoC family
#
# External variables needed:
# ${SDCARD_ROOTFS} - the rootfs image to incorporate
# ${IMAGE_BOOTLOADER} - bootloader to use {u-boot, barebox}
#
# The disk layout used is:
#
# 0 -> IMAGE_ROOTFS_ALIGNMENT - reserved to bootloader (not partitioned)
# IMAGE_ROOTFS_ALIGNMENT -> BOOT_SPACE - kernel and other data
# BOOT_SPACE -> SDIMG_SIZE - rootfs
#
# Default Free space = 1.3x
# Use IMAGE_OVERHEAD_FACTOR to add more space
# <--------->
# 4MiB 8MiB SDIMG_ROOTFS 4MiB
# <-----------------------> <----------> <----------------------> <------------------------------>
# ------------------------ ------------ ------------------------ -------------------------------
# | IMAGE_ROOTFS_ALIGNMENT | BOOT_SPACE | ROOTFS_SIZE | IMAGE_ROOTFS_ALIGNMENT |
# ------------------------ ------------ ------------------------ -------------------------------
# ^ ^ ^ ^ ^
# | | | | |
# 0 4096 4MiB + 8MiB 4MiB + 8Mib + SDIMG_ROOTFS 4MiB + 8MiB + SDIMG_ROOTFS + 4MiB

generate_imx_sdcard() {
        ....
}

in sources/poky/meta/classes/image_types.bbclass :

runimagecmd () {
    //各家算法可能不同
    ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{size = $1 * ${IMAGE_OVERHEAD_FACTOR}; print (size > ${IMAGE_ROOTFS_SIZE} ? size : ${IMAGE_ROOTFS_SIZE}) }'`
}

in sources/poky/meta/conf/bitbake.conf
....
IMAGE_ROOTFS_SIZE ?= "65536"
....


配置文件主要分為兩類:設備配置與發行版(distro)配置。另外還有本地配置文件以及名為‘bitbake.conf’的文件。Bitbake.conf是BitBake讀取的第一個文件,包含所有其它配置文件。此外,它還可定義許多全局變量,並稱之為bitbake.conf。不建議直接修改bitbake.conf,建議在distro配置文件或本地配置文件中進行覆蓋。設備配置文件可定義特定目標電路板。發行版配置文件可為一台以上的設備定義特定的Linux發行版(如各種數據封包版本)。

沒有留言:

張貼留言