1) Raspberry Pi - loaded network modules for NAT
pi@T0020:~ $ lsmod
Module Size Used byiptable_filter 1245 1cdc_acm 16033 2rndis_host 5252 0cdc_ether 4293 1 rndis_hostip_tables 11417 1 iptable_filterx_tables 12611 2 ip_tables,iptable_filterbcm2835_gpiomem 2860 0i2c_bcm2708 4920 0bcm2835_rng 1763 0cp210x 8363 1usbserial 21779 3 cp210xuio_pdrv_genirq 2944 0uio 7753 1 uio_pdrv_genirqsnd_bcm2835 19802 0snd_pcm 73474 1 snd_bcm2835snd_timer 18848 1 snd_pcmsnd 50779 3 snd_bcm2835,snd_timer,snd_pcmi2c_dev 5671 2fuse 80694 1ipv6 338660 30
2) Yocto Kernel Build Structure
* linux-imx
./meta-fsl-arm/recipes-kernel/linux/linux-imx-4.1.15
./meta-fsl-arm/recipes-kernel/linux/linux-imx_4.1.15.bb
./meta-fsl-arm/recipes-kernel/linux/linux-imx-mfgtool_4.1.15.bb
./meta-fsl-arm/recipes-kernel/linux/linux-imx.inc
./meta-fsl-bsp-release/imx/meta-bsp/recipes-kernel/linux/linux-imx_4.1.15.bb
./meta-fsl-bsp-release/imx/meta-bsp/recipes-kernel/linux/linux-imx-mfgtool_4.1.15.bb
./meta-fsl-bsp-release/imx/meta-bsp/recipes-kernel/linux/linux-imx_%.bbappend
* imx_v7_defconfig
./imx6ull14x14evk-fb/tmp/work-shared/imx6ull14x14evk/kernel-source/arch/arm/configs/imx_v7_defconfig
[Before starting the next steps, Read the manual]
* http://www.yoctoproject.org/docs/1.8/kernel-manual/kernel-manual.html
* http://www.yoctoproject.org/docs/1.8/dev-manual/dev-manual.html#understanding-and-creating-layers
3) Add T0040 Layer to BitBake
* Folder Structure
${fsl-release-bsp}/sources/meta-t0040
${fsl-release-bsp}/sources/meta-t0040/conf
${fsl-release-bsp}/sources/meta-t0040/recipes-kernel
${fsl-release-bsp}/sources/meta-t0040/recipes-kernel/linux
${fsl-release-bsp}/sources/meta-t0040/recipes-kernel/linux/files
* ${fsl-release-bsp}/sources/meta-t0040/conf/layer.conf
# We have a conf and classes directory, append to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have a recipes directory, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "t0040"
BBFILE_PATTERN_t0040 := "^${LAYERDIR}/"
BBFILE_PRIORITY_t0040 = "9"
LAYERVERSION_t0040 = "1"
* ${fsl-release-bsp}/sources/meta-t0040/recipes-kernel/linux/linux-imx_%.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://fragment-t0040.cfg"
# support for TUN / RNDIS / IP_TABLES
do_configure_prepend () {
echo "CONFIG_NETFILTER=y" >> ${B}/.config
echo "CONFIG_NETFILTER_DEBUG=y" >> ${B}/.config
echo "CONFIG_NETFILTER_ADVANCED=n" >> ${B}/.config
echo "CONFIG_TUN=m" >> ${B}/.config
echo "CONFIG_USB_ETH_RNDIS=m" >> ${B}/.config
echo "CONFIG_USB_NET_RNDIS_HOST=m" >> ${B}/.config
echo "CONFIG_NETFILTER_XTABLES=m" >> ${B}/.config
echo "CONFIG_NF_CONNTRACK=m" >> ${B}/.config
echo "CONFIG_NF_TABLES=m" >> ${B}/.config
echo "CONFIG_NF_NAT=m" >> ${B}/.config
echo "CONFIG_NF_NAT_MASQUERADE_IPV4=m" >> ${B}/.config
echo "CONFIG_IP_NF_CONNTRACK=m" >> ${B}/.config
echo "CONFIG_IP_NF_NAT=m" >> ${B}/.config
echo "CONFIG_IP_NF_TARGET_MASQUERADE=m" >> ${B}/.config
}
* ${fsl-release-bsp}/sources/meta-t0040/recipes-kernel/linux/files/fragment-t0040.cfg
- It is created by below sequence
bitbake linux-imx -c menuconfig- And copy the fragment in
bitbake linux-imx -c diffconfig
./imx6ull14x14evk-fb/tmp/work/imx6ull14x14evk-poky-linux-gnueabi/linux-imx/4.1.15-r0/fragment.cfgto the destination directory(.../recipes-kernel/linux/!!)
4) Enable T0040 Layer on the Build Configuration
* ${fsl-release-bsp}/imx6ull14x14evk-fb/conf/bblayers.conf
LCONF_VERSION = "6"
BBPATH = "${TOPDIR}"
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"
BBFILES ?= ""
BBLAYERS = " \
${BSPDIR}/sources/poky/meta \
${BSPDIR}/sources/poky/meta-yocto \
\
${BSPDIR}/sources/meta-openembedded/meta-oe \
${BSPDIR}/sources/meta-openembedded/meta-multimedia \
\
${BSPDIR}/sources/meta-fsl-arm \
${BSPDIR}/sources/meta-fsl-arm-extra \
${BSPDIR}/sources/meta-fsl-demos \
${BSPDIR}/sources/meta-t0040 \
"
##Freescale Yocto Project Release layer
BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-bsp "
BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-sdk "
BBLAYERS += " ${BSPDIR}/sources/meta-browser "
BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-gnome "
BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-networking "
BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-python "
BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-filesystems "
BBLAYERS += " ${BSPDIR}/sources/meta-qt5 "
4) Rebuild the Image!!
bitbake -c clean virtual/kernel
bitbake fsl-image-gui
No comments:
Post a Comment