20170920_jeffrey - silenceuncrio/diary GitHub Wiki
從上禮拜三開始一連 五天 的陪產假
一早 ariel 告知 M300 新版子 來囉
CTCU: -40 ~ 85 C
task 優先處理
ospf 要先停工
先幫忙準備 09-25 V1.58 的 mfgtool 版本
- Azuretec_LTR-101_v1.58_012C006815829BA3_mfgtools.rar
- Azuretec_LTR-102_v1.58_012C006815829BA3_mfgtools.rar
- Azuretec_LTRG-101_v1.58_0136006815829BA3_mfgtools.rar
- Azuretec_LTRG-102_v1.58_0136006815829BA3_mfgtools.rar
- Azuretec_OLTR-101_v1.58_012C006815829BA3_mfgtools.rar
- Azuretec_OLTR-102_v1.58_012C006815829BA3_mfgtools.rar
- Azuretec_OLTRG-101_v1.58_0136006815829BA3_mfgtools.rar
- Azuretec_OLTRG-102_v1.58_0136006815829BA3_mfgtools.rar
- M300_GENERIC_v1.58_012C000015829BA3_mfgtools.rar
- M300_GPS_v1.58_0136000015829BA3_mfgtools.rar
- M300_GPS_PLANET_v1.58_0136000215829BA3_mfgtools.rar
- M300_PLANET_v1.58_012C000215829BA3_mfgtools.rar
看一下 email
調整一下 schedule
- CTC: -40 ~ 85 C - 9/20 ~ 10/6
- OSPF - 10/11 ~ 10/17
- Airtel/CTC:BGP(Minimum routes capacity is 30k routes) - 10/18 ~ 11/10
- RSTP - 11/13 ~ 12/1
- VRRP(IPv6) - 12/4 ~ 12/15
- DMZ(IPv6) - 12/18 ~ 12/29
CTC: -40 ~ 85 C
開工
先從之前 aaron 幫忙準備的 wiki - Multi kernel uboot 出發
相關的修改看到 Add m300e machine config and machine specific files
我們目前都是在 M300 source code 根目錄下執行 source proenv.sh
build@2f192722794e:/var/m300$ source proenv.sh
Welcome to Freescale Community BSP
The Yocto Project has extensive documentation about OE including a
reference manual which can be found at:
http://yoctoproject.org/documentation
For more information about OpenEmbedded see their website:
http://www.openembedded.org/
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
meta-toolchain
meta-toolchain-sdk
adt-installer
meta-ide-support
Your configuration files at build_small have not been touched.
build@2f192722794e:/var/m300/build_small$
這會連動到 build_small/conf/local.conf
build@2f192722794e:/var/m300/build_small$ cat conf/local.conf
MACHINE ??= 'm300'
DISTRO ?= 'proscend-m300'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K"
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
ASSUME_PROVIDED += "libsdl-native"
CONF_VERSION = "1"
BB_NUMBER_THREADS = '4'
PARALLEL_MAKE = '-j 4'
DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = "1"
注意到 MACHINE
Specifies the target device for which the image is built. You define
MACHINE
in thelocal.conf
file found in the Build Directory. By default,MACHINE
is set to "qemux86", which is an x86-based architecture machine to be emulated using QEMU:MACHINE ?= "qemux86"
The variable corresponds to a machine configuration file of the same name, through which machine-specific configurations are set. Thus, when
MACHINE
is set to "qemux86" there exists the correspondingqemux86.conf
machine configuration file, which can be found in the Source Directory in meta/conf/machine.
因為 MACHINE ??= 'm300'
所以我們會知道有一個 m300.conf
machine configuration file
meta-proscend/conf/machine/m300.conf
#@TYPE: Machine
#@NAME: Freescale i.MX6UL Evaluation Kit
#@SOC: i.MX6UL
#@DESCRIPTION: Machine configuration for Freescale i.MX6UL EVK
#@MAINTAINER: Lauren Post <[email protected]>
include conf/machine/include/imx-base.inc
include conf/machine/include/tune-cortexa7.inc
include conf/machine/include/imx6ul-common.inc
NANDFLASH_ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.tar.bz2"
NANDFLASH_ROOTFS_NAME = "rootfs.tar.bz2"
IMAGE_CLASSES += "image_types_proscend"
SOC_FAMILY = "mx6ul"
KERNEL_DEVICETREE = "imx6ul-14x14-evk.dtb imx6ul-14x14-evk-csi.dtb imx6ul-14x14-evk-btwifi.dtb \
imx6ul-14x14-evk-usb-certi.dtb \
"
UBOOT_CONFIG ??= "sd"
UBOOT_CONFIG[sd] = "mx6ul_14x14_evk_config,sdcard"
UBOOT_CONFIG[nand] = "mx6ul_14x14_evk_nand_config,ubifs"
UBOOT_CONFIG[qspi1] = "mx6ul_14x14_evk_qspi1_config"
UBOOT_CONFIG[mfgtool] = "mx6ul_14x14_evk_config"
再注意到 build_small/conf/local.conf
的 DISTRO
MACHINE ??= 'm300'
DISTRO ?= 'proscend-m300'
...
The short name of the distribution. This variable corresponds to a distribution configuration file whose root name is the same as the variable's argument and whose filename extension is
.conf
. For example, the distribution configuration file for the Poky distribution is named poky.conf and resides in themeta-poky/conf/distro
directory of the Source Directory.Within that poky.conf file, the DISTRO variable is set as follows:
DISTRO = "poky"
Distribution configuration files are located in a
conf/distro
directory within the Metadata that contains the distribution configuration. The value forDISTRO
must not contain spaces, and is typically all lower-case.
由 DISTRO ?= 'proscend-m300'
我們可知
meta-proscend/conf/distro/proscend-m300.conf
include conf/distro/include/proscend-base.inc
DISTRO = "proscend-m300"
EXTRA_USERS_PARAMS = "usermod -P 2wsx#EDC root; \
useradd -P 2wsx#EDC proscend;"
再看到 meta-proscend/conf/distro/include/proscend-base.inc
...
ACCEPT_FSL_EULA = ""
UBOOT_CONFIG = "nand"
meta-proscend/conf/distro/proscend-m300.conf
的 UBOOT_CONFIG = "nand"
再加上
meta-proscend/conf/machine/m300.conf
定義的 UBOOT_CONFIG[nand] = "mx6ul_14x14_evk_nand_config,ubifs"
Configures the UBOOT_MACHINE and can also define IMAGE_FSTYPES for individual cases.
Following is an example from the
meta-fsl-arm
layer.UBOOT_CONFIG ??= "sd" UBOOT_CONFIG[sd] = "mx6qsabreauto_config,sdcard" UBOOT_CONFIG[eimnor] = "mx6qsabreauto_eimnor_config" UBOOT_CONFIG[nand] = "mx6qsabreauto_nand_config,ubifs" UBOOT_CONFIG[spinor] = "mx6qsabreauto_spinor_config"
In this example, "sd" is selected as the configuration of the possible four for the
UBOOT_MACHINE
. The "sd" configuration defines "mx6qsabreauto_config" as the value forUBOOT_MACHINE
, while the "sdcard" specifies the IMAGE_FSTYPES to use for the U-boot image.
先把上禮拜為了 ospf 做的一些些東西先備份一下
aaron 的 Multi kernel uboot 提到
Use the
proenv.sh
to switch the target machine.
- Switch to m300:
source proenv.sh
orsource proenv.sh m300
- Switch to m300e:
source proenv.sh m300e
直接試試看
build@2f192722794e:/var/m300$ source proenv.sh m300e
Welcome to Freescale Community BSP
The Yocto Project has extensive documentation about OE including a
reference manual which can be found at:
http://yoctoproject.org/documentation
For more information about OpenEmbedded see their website:
http://www.openembedded.org/
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
meta-toolchain
meta-toolchain-sdk
adt-installer
meta-ide-support
Your configuration files at build_small have not been touched.
build@2f192722794e:/var/m300/build_small$
重新產生的 build_small/conf/local.conf
如下
MACHINE ??= 'm300e'
DISTRO ?= 'proscend-m300'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K"
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
ASSUME_PROVIDED += "libsdl-native"
CONF_VERSION = "1"
BB_NUMBER_THREADS = '4'
PARALLEL_MAKE = '-j 4'
DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = "1"
就只有 MACHINE ??= 'm300e'
不一樣
看到 m300e.conf
這個 machine configuration file
meta-proscend/conf/machine/m300e.conf
#@TYPE: Machine
#@NAME: Freescale i.MX6UL Evaluation Kit
#@SOC: i.MX6UL
#@DESCRIPTION: Machine configuration for Freescale i.MX6UL EVK
#@MAINTAINER: Lauren Post <[email protected]>
include conf/machine/include/imx-base.inc
include conf/machine/include/tune-cortexa7.inc
include conf/machine/include/imx6ul-common.inc
NANDFLASH_ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.tar.bz2"
NANDFLASH_ROOTFS_NAME = "rootfs.tar.bz2"
IMAGE_CLASSES += "image_types_proscend"
SOC_FAMILY = "mx6ul"
KERNEL_DEVICETREE = "imx6ul-14x14-evk.dtb imx6ul-14x14-evk-csi.dtb imx6ul-14x14-evk-btwifi.dtb \
imx6ul-14x14-evk-usb-certi.dtb \
"
UBOOT_CONFIG ??= "sd"
UBOOT_CONFIG[sd] = "mx6ul_14x14_evk_config,sdcard"
UBOOT_CONFIG[nand] = "mx6ul_14x14_evk_nand_config,ubifs"
UBOOT_CONFIG[qspi1] = "mx6ul_14x14_evk_qspi1_config"
UBOOT_CONFIG[mfgtool] = "mx6ul_14x14_evk_config"
發現跟 meta-proscend/conf/machine/m300.conf
一模一樣
先試著解析 meta-proscend/conf/machine/m300.conf
內容
參考 commit - Use bitbake image type to generate M300 firmware
m300.conf
的以下內容都時當時的 commit 產生的
NANDFLASH_ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.tar.bz2"
NANDFLASH_ROOTFS_NAME = "rootfs.tar.bz2"
IMAGE_CLASSES += "image_types_proscend"
A list of classes that all images should inherit. You typically use this variable to specify the list of classes that register the different types of images the OpenEmbedded build system creates.
The default value for
IMAGE_CLASSES
isimage_types
. You can set this variable in yourlocal.conf
or in a distribution configuration file.For more information, see
meta/classes/image_types.bbclass
in the Source Directory.
由 IMAGE_CLASSES += "image_types_proscend"
可以追到 meta-proscend/classes/image_types_proscend.bbclass
aaron 表示這是參考 source/meta-fsl-arm/classes/image_types_fsl.bbclass
做修改的
直接看 meta-proscend/classes/image_types_proscend.bbclass
inherit image_types
IMAGE_BOOTLOADER ?= "u-boot"
# Handle u-boot suffixes
UBOOT_SUFFIX ?= "bin"
UBOOT_SUFFIX_SDCARD ?= "${UBOOT_SUFFIX}"
UBOOT_SUFFIX_NANDFLASH ?= "${UBOOT_SUFFIX}-nand"
#
# Handles i.MX mxs bootstream generation
#
MXSBOOT_NAND_ARGS ?= ""
FIRMWARE_DIR = "${DEPLOY_DIR_IMAGE}/firmware"
# IMX Bootlets Linux bootstream
IMAGE_DEPENDS_linux.sb = "elftosb-native:do_populate_sysroot \
imx-bootlets:do_deploy \
virtual/kernel:do_deploy"
IMAGE_LINK_NAME_linux.sb = ""
IMAGE_CMD_linux.sb () {
}
# Boot partition volume id
BOOTDD_VOLUME_ID ?= "Boot ${MACHINE}"
IMAGE_DEPENDS_nandflash = "parted-native:do_populate_sysroot \
dosfstools-native:do_populate_sysroot \
mtools-native:do_populate_sysroot \
virtual/kernel:do_deploy \
${@d.getVar('IMAGE_BOOTLOADER', True) and d.getVar('IMAGE_BOOTLOADER', True) + ':do_deploy' or ''}"
NANDFLASH= "${MACHINE}.tar"
NANDFLASH_GENERATION_COMMAND_mx6ul = "generate_imx_nandflash"
generate_imx_nandflash () {
# clean up
rm -rf ${FIRMWARE_DIR}
rm -f `readlink ${DEPLOY_DIR_IMAGE}/${NANDFLASH}`
rm -f ${DEPLOY_DIR_IMAGE}/${NANDFLASH}
mkdir -p ${FIRMWARE_DIR}
case "${IMAGE_BOOTLOADER}" in
imx-bootlets)
bberror "The imx-bootlets is not supported for i.MX based machines"
exit 1
;;
u-boot)
cp ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.${UBOOT_SUFFIX_NANDFLASH} ${FIRMWARE_DIR}
;;
barebox)
bberror "The imx-bootlets is not supported for i.MX based machines"
exit 1
;;
"")
;;
*)
bberror "Unknown IMAGE_BOOTLOADER value"
exit 1
;;
esac
if [ -z "${NANDFLASH_ROOTFS_NAME}" ]; then
bberror "NANDFLASH_ROOTFS_NAME is not defined. To use nandflash image from Proscend it needs to be defined."
exit 1
fi
cp ${NANDFLASH_ROOTFS} ${FIRMWARE_DIR}/${NANDFLASH_ROOTFS_NAME}
if [ $? != 0 ]; then
bberror "NANDFLASH_ROOTFS is not found. To use nandflash image from Proscend it needs to be generated."
exit 1
fi
# Copy device tree file
if test -n "${KERNEL_DEVICETREE}"; then
for DTS_FILE in ${KERNEL_DEVICETREE}; do
DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
if [ -e "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb" ]; then
cp "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb" ${FIRMWARE_DIR}
else
bbfatal "${DTS_FILE} does not exist."
fi
done
fi
if [ -e "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin" ]; then
cp "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin" ${FIRMWARE_DIR}/zImage
fi
filename=$(date "+${MACHINE}_%Y%m%d%H%M%S.tar")
cd ${DEPLOY_DIR_IMAGE}
tar -cf ${filename} firmware
ln -s ${filename} ${NANDFLASH}
cd -
}
IMAGE_CMD_nandflash () {
if [ -z "${NANDFLASH_ROOTFS}" ]; then
bberror "NANDFLASH_ROOTFS is undefined. To use nandflash image from Proscend it needs to be defined."
exit 1
fi
${NANDFLASH_GENERATION_COMMAND}
}
# The sdcard requires the rootfs filesystem to be built before using
# it so we must make this dependency explicit.
IMAGE_TYPEDEP_nandflash = "${@d.getVar('SDCARD_ROOTFS', 1).split('.')[-1]}"