yocto/hardknott/meta-igkboard/COPYING.MIT
yocto/hardknott/meta-igkboard/README.md
File was renamed from yocto/meta-igkboard/README.md @@ -71,7 +71,7 @@ 首先将该本文件夹Yocto针对IGKBoard的移植源码拷贝到 Yocto 系统中。 ``` guowenxue@ubuntu20:~/workspace/imx-yocto-bsp$ cp -rf ~/workspace/imx6ull/yocto/meta-igkboard/ sources/ guowenxue@ubuntu20:~/workspace/imx-yocto-bsp$ cp -rf ~/workspace/imx6ull/yocto/hardknott/meta-igkboard/ sources/ ``` yocto/hardknott/meta-igkboard/conf/bblayers.conf
yocto/hardknott/meta-igkboard/conf/layer.conf
yocto/hardknott/meta-igkboard/conf/local.conf
yocto/hardknott/meta-igkboard/conf/machine/igkboard.conf
yocto/hardknott/meta-igkboard/recipes-bsp/u-boot/files/uboot-imx-igkboard.patchcopy from yocto/meta-igkboard/recipes-bsp/u-boot/files/uboot-imx-igkboard.patch copy to yocto/hardknott/meta-igkboard/recipes-bsp/u-boot/files/uboot-imx-igkboard.patch
yocto/hardknott/meta-igkboard/recipes-bsp/u-boot/u-boot-imx_2021.04.bbappend
yocto/hardknott/meta-igkboard/recipes-core/base-files/base-files_3.0.14.bbappend
yocto/hardknott/meta-igkboard/recipes-drivers/drivers/drivers-mods_1.0.bb
yocto/hardknott/meta-igkboard/recipes-drivers/drivers/src/Makefile
yocto/hardknott/meta-igkboard/recipes-drivers/drivers/src/hello.c
yocto/hardknott/meta-igkboard/recipes-hello/hello/hello-apps_1.0.bb
yocto/hardknott/meta-igkboard/recipes-hello/hello/src/Makefilecopy from yocto/meta-igkboard/recipes-hello/hello/src/Makefile copy to yocto/hardknott/meta-igkboard/recipes-hello/hello/src/Makefile
yocto/hardknott/meta-igkboard/recipes-hello/hello/src/hello.ccopy from yocto/meta-igkboard/recipes-hello/hello/src/hello.c copy to yocto/hardknott/meta-igkboard/recipes-hello/hello/src/hello.c
yocto/hardknott/meta-igkboard/recipes-images/igkboard/linuxsys-image.bb
yocto/hardknott/meta-igkboard/recipes-kernel/linux/files/linux-imx-igkboard.patchcopy from yocto/meta-igkboard/recipes-kernel/linux/files/linux-imx-igkboard.patch copy to yocto/hardknott/meta-igkboard/recipes-kernel/linux/files/linux-imx-igkboard.patch
yocto/hardknott/meta-igkboard/recipes-kernel/linux/linux-imx-headers_5.10.bbappendcopy from yocto/meta-igkboard/recipes-kernel/linux/linux-imx-headers_5.10.bbappend copy to yocto/hardknott/meta-igkboard/recipes-kernel/linux/linux-imx-headers_5.10.bbappend
yocto/hardknott/meta-igkboard/recipes-kernel/linux/linux-imx_5.10.bbappend
yocto/hardknott/meta-igkboard/recipes-misc/expand-rootfs/expand-rootfs_1.0.bb
yocto/hardknott/meta-igkboard/recipes-misc/expand-rootfs/files/expand_rootfs
yocto/hardknott/meta-igkboard/recipes-misc/packagegroups/packagegroup-misc-utils.bb
yocto/hardknott/meta-igkboard/recipes-misc/sshswitch/files/sshswitch.service
yocto/hardknott/meta-igkboard/recipes-misc/sshswitch/sshswitch_1.0.bb
yocto/hardknott/meta-igkboard/recipes-misc/wpa-conf/files/wpa-conf.service
yocto/hardknott/meta-igkboard/recipes-misc/wpa-conf/wpa-conf_1.0.bb
yocto/hardknott/meta-igkboard/tools/igkboard-setup.shold mode 100644 new mode 100755
yocto/honister/meta-igkboard/COPYING.MITcopy from yocto/meta-igkboard/COPYING.MIT copy to yocto/honister/meta-igkboard/COPYING.MIT
yocto/honister/meta-igkboard/README.mdcopy from yocto/meta-igkboard/README.md copy to yocto/honister/meta-igkboard/README.md
File was copied from yocto/meta-igkboard/README.md @@ -1,4 +1,4 @@ 本目录为凌云实验室针对IGKBoard开发板移植的Yocto Hardknott (Yocto 3.3) 项目源码,关于Yocto系统的详细使用,大家可以参考NXP官方的用户手册文档,[点此链接下载](https://www.nxp.com/docs/en/user-guide/IMX_YOCTO_PROJECT_USERS_GUIDE.pdf) 。 本目录为凌云实验室针对IGKBoard开发板移植的Yocto Honister (Yocto 3.4) 项目源码,关于Yocto系统的详细使用,大家可以参考NXP官方的用户手册文档,[点此链接下载](https://www.nxp.com/docs/en/user-guide/IMX_YOCTO_PROJECT_USERS_GUIDE.pdf) 。 @@ -56,7 +56,7 @@ ``` guowenxue@ubuntu20:~$ mkdir -p ~/workspace/imx-yocto-bsp/ guowenxue@ubuntu20:~$ cd ~/workspace/imx-yocto-bsp/ guowenxue@ubuntu20:~/workspace/imx-yocto-bsp$ repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-hardknott -m imx-5.10.52-2.1.0.xml guowenxue@ubuntu20:~/workspace/imx-yocto-bsp$ repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-honister -m imx-5.15.5-1.0.0.xml guowenxue@ubuntu20:~/workspace/imx-yocto-bsp$ repo sync guowenxue@ubuntu20:~/workspace/imx-yocto-bsp$ ls imx-setup-release.sh README README-IMXBSP setup-environment sources @@ -71,7 +71,7 @@ 首先将该本文件夹Yocto针对IGKBoard的移植源码拷贝到 Yocto 系统中。 ``` guowenxue@ubuntu20:~/workspace/imx-yocto-bsp$ cp -rf ~/workspace/imx6ull/yocto/meta-igkboard/ sources/ guowenxue@ubuntu20:~/workspace/imx-yocto-bsp$ cp -rf ~/workspace/imx6ull/yocto/honister/meta-igkboard/ sources/ ``` @@ -83,15 +83,11 @@ Build directory is igkboard /home/guowenxue/workspace/imx-yocto-bsp Welcome LingYun IoT Gateway Kit Board Yocto BSP The Yocto Project has extensive documentation about OE including a reference manual which can be found at: http://yoctoproject.org/documentation You can now run 'bitbake <target>' Welcome LingYun IoT Gateway Kit Board Yocto BSP, You can run 'bitbake <target>' now. Common targets are: The targets should be: linuxsys-image core-image-minimal imx-image-full @@ -111,10 +107,10 @@ 编译过程中下载的软件包存放在 ***~/workspace/hardknott_packets/*** 路径下: 编译过程中下载的软件包存放在 ***~/workspace/honister_packets/*** 路径下: ``` guowenxue@ubuntu20:/workspace/imx-yocto-bsp/igkboard$ ls ~/workspace/hardknott_packets/ guowenxue@ubuntu20:/workspace/imx-yocto-bsp/igkboard$ ls ~/workspace/honister_packets/ ``` @@ -126,6 +122,4 @@ linuxsys-image-igkboard-*.rootfs.tar.bz2 --Yocto根文件系统压缩包 linuxsys-image-igkboard-*.rootfs.wic.bz2 --Yocto烧录系统镜像文件 ``` yocto/honister/meta-igkboard/conf/bblayers.conf
New file @@ -0,0 +1,32 @@ LCONF_VERSION = "7" BBPATH = "${TOPDIR}" BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}" BBFILES ?= "" BBLAYERS = " \ ${BSPDIR}/sources/poky/meta \ ${BSPDIR}/sources/poky/meta-poky \ \ ${BSPDIR}/sources/meta-openembedded/meta-oe \ ${BSPDIR}/sources/meta-openembedded/meta-multimedia \ ${BSPDIR}/sources/meta-openembedded/meta-python \ \ ${BSPDIR}/sources/meta-freescale \ ${BSPDIR}/sources/meta-freescale-3rdparty \ ${BSPDIR}/sources/meta-freescale-distro \ " # i.MX Yocto Project Release layers BBLAYERS += "${BSPDIR}/sources/meta-imx/meta-bsp" BBLAYERS += "${BSPDIR}/sources/meta-imx/meta-sdk" BBLAYERS += "${BSPDIR}/sources/meta-nxp-demo-experience" BBLAYERS += "${BSPDIR}/sources/meta-clang" BBLAYERS += "${BSPDIR}/sources/meta-openembedded/meta-networking" BBLAYERS += "${BSPDIR}/sources/meta-openembedded/meta-filesystems" BBLAYERS += "${BSPDIR}/sources/meta-qt6" BBLAYERS += "${BSPDIR}/sources/meta-python2" # Add IoT Gateway Kit Board Yocto Project Release layers BBLAYERS += "${BSPDIR}/sources/meta-igkboard" yocto/honister/meta-igkboard/conf/layer.conf
New file @@ -0,0 +1,13 @@ # We have a conf and classes directory, add to BBPATH BBPATH .= ":${LAYERDIR}" # We have recipes-* directories, add to BBFILES BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ ${LAYERDIR}/recipes-*/*/*.bbappend" BBFILE_COLLECTIONS += "meta-igkboard" BBFILE_PATTERN_meta-igkboard = "^${LAYERDIR}/" BBFILE_PRIORITY_meta-igkboard = "9" LAYERDEPENDS_meta-igkboard = "core" LAYERSERIES_COMPAT_meta-igkboard = "honister" yocto/honister/meta-igkboard/conf/local.conf
New file @@ -0,0 +1,23 @@ MACHINE ??= 'igkboard' DISTRO ?= 'fsl-imx-wayland' EXTRA_IMAGE_FEATURES ?= "debug-tweaks" USER_CLASSES ?= "buildstats" PATCHRESOLVE = "noop" BB_DISKMON_DIRS ??= "\ STOPTASKS,${TMPDIR},1G,100K \ STOPTASKS,${DL_DIR},1G,100K \ STOPTASKS,${SSTATE_DIR},1G,100K \ STOPTASKS,/tmp,100M,100K \ ABORT,${TMPDIR},100M,1K \ ABORT,${DL_DIR},100M,1K \ ABORT,${SSTATE_DIR},100M,1K \ ABORT,/tmp,10M,1K" PACKAGECONFIG:append:pn-qemu-system-native = " sdl" CONF_VERSION = "2" DL_DIR ?= "${BSPDIR}/../honister_packets/" ACCEPT_FSL_EULA = "1" # Switch to Debian packaging and include package-management in the image PACKAGE_CLASSES = "package_deb" EXTRA_IMAGE_FEATURES += "package-management" yocto/honister/meta-igkboard/conf/machine/igkboard.conf
New file @@ -0,0 +1,29 @@ #@TYPE: Machine #@NAME: LingYun IoT Gateway Kit Board #@SOC: i.MX6ULL ##@DESCRIPTION: Machine configuration for LingYun IoT Gateway Kit Board ##@MAINTAINER: Guo Wenxue <guowenxue@gmail.com> MACHINEOVERRIDES =. "mx6:mx6ul:mx6ull:" include conf/machine/include/imx-base.inc include conf/machine/include/arm/armv7a/tune-cortexa7.inc KERNEL_DEVICETREE = "imx6ull-14x14-evk-emmc.dtb" UBOOT_CONFIG ??= "sd" UBOOT_CONFIG[sd] = "mx6ull_14x14_evk_emmc_config,sdcard" IMAGE_BOOT_FILES = " \ ${KERNEL_IMAGETYPE} \ ${KERNEL_DEVICETREE} \ " # Remove unused optee bcm4339 bcm43455 MACHINE_FEATURES += "wifi bluetooth" # /etc/hostname hostname_pn-base-files = "igkboard" # Refer to linux-imx/drivers/tty/serial/imx.c SERIAL_CONSOLES = "115200;ttymxc0" yocto/honister/meta-igkboard/recipes-bsp/u-boot/files/uboot-imx-igkboard.patch
yocto/honister/meta-igkboard/recipes-bsp/u-boot/u-boot-imx_2021.04.bbappend
New file @@ -0,0 +1,10 @@ COMPATIBLE_MACHINE = "(mx6)" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" LOCALVERSION = "_5.10.52_2.1.0" SRCREV = "1c0116f3da250c5a52858c53efb8b38c0963f477" FILESEXTRAPATHS:prepend := "${THISDIR}/files:" SRC_URI:append = " file://uboot-imx-igkboard.patch " yocto/honister/meta-igkboard/recipes-core/base-files/base-files_3.0.14.bbappend
New file @@ -0,0 +1,17 @@ SUMMARY = "Update system configure files" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://licenses/GPL-2;md5=94d55d512a9ba36caa9b7df079bae19f" do_install_basefilesissue:append() { # Overwrite /etc/issue with a custom string printf "Welcome to LingYun IoT Gateway Kit Board GNU/Linux Yocto System, Default Password '12345'.\n" > ${D}${sysconfdir}/issue # Overwrite /etc/issue.net with a custom string printf "Welcome to LingYun IoT Gateway Kit Board GNU/Linux Yocto System, Default Password '12345'.\n" > ${D}${sysconfdir}/issue.net } do_install:append() { # add alias for ls with color display printf "alias ls='ls --color=auto'\n" >> ${D}${sysconfdir}/profile } yocto/honister/meta-igkboard/recipes-drivers/drivers/drivers-mods_1.0.bb
New file @@ -0,0 +1,19 @@ SUMMARY = "Linux kernel hello module" DESCRIPTION = "${SUMMARY}" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" inherit module FILESEXTRAPATHS:prepend := "${THISDIR}/src:" SRC_URI = "file://Makefile \ file://hello.c \ " S = "${WORKDIR}" # The inherit of module.bbclass will automatically name module packages with # "kernel-module-" prefix as required by the oe-core build environment. EXTRA_OEMAKE += "-C ${STAGING_KERNEL_BUILDDIR} M=${S}" EXTRA_OEMAKE:append:task-install = "-C ${STAGING_KERNEL_DIR} M=${S}" yocto/honister/meta-igkboard/recipes-drivers/drivers/src/Makefilecopy from yocto/meta-igkboard/recipes-drivers/drivers/src/Makefile copy to yocto/honister/meta-igkboard/recipes-drivers/drivers/src/Makefile
yocto/honister/meta-igkboard/recipes-drivers/drivers/src/hello.ccopy from yocto/meta-igkboard/recipes-drivers/drivers/src/hello.c copy to yocto/honister/meta-igkboard/recipes-drivers/drivers/src/hello.c
yocto/honister/meta-igkboard/recipes-hello/hello/hello-apps_1.0.bb
New file @@ -0,0 +1,44 @@ SUMMARY = "A simple Hello application" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" python do_display_banner() { bb.plain("***********************************************"); bb.plain("* *"); bb.plain("* Example recipe for hello application *"); bb.plain("* *"); bb.plain("***********************************************"); } # An example to add a new task addtask display_banner before do_build # Source file list, will auto search in the subdir FILESEXTRAPATHS:prepend := "${THISDIR}/src:" SRC_URI = "file://hello.c \ file://Makefile \ " # Application version and reversion PV = "1" PR = "r0" # Must add this line, or throw error: No GNU_HASH TARGET_CC_ARCH += "${LDFLAGS}" S = "${WORKDIR}" do_compile() { make } # There is /usr/bin/hello in lmbench: dpkg-query -S hello do_install() { install -d ${D}${sbindir} install -m 0755 ${S}/hello ${D}${sbindir} } # Install application to image file FILES:${PN} = "${sbindir}/hello" yocto/honister/meta-igkboard/recipes-hello/hello/src/Makefile
yocto/honister/meta-igkboard/recipes-hello/hello/src/hello.c
yocto/honister/meta-igkboard/recipes-images/igkboard/linuxsys-image.bb
New file @@ -0,0 +1,54 @@ SUMMARY = "Yocto Linux System Image for LingYun IoT Kit Gateway Board" LICENSE = "MIT" inherit core-image # additional free disk space created in Kbytes IMAGE_OVERHEAD_FACTOR = "1.0" IMAGE_ROOTFS_EXTRA_SPACE = "512000" ## Select Image Features IMAGE_FEATURES += " \ ssh-server-openssh \ package-management \ " CORE_IMAGE_EXTRA_INSTALL += " \ packagegroup-core-full-cmdline \ packagegroup-tools-bluetooth \ packagegroup-fsl-tools-audio \ packagegroup-fsl-gstreamer1.0 \ packagegroup-fsl-gstreamer1.0-full \ packagegroup-qt6-imx \ packagegroup-misc-utils \ firmwared \ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston-init', '', d)} \ " CORE_IMAGE_EXTRA_INSTALL:append = " \ bash \ drivers-mods \ hello-apps \ gnupg \ e2fsprogs \ e2fsprogs-resize2fs \ parted \ v4l-utils \ sudo \ nano \ hostapd \ evtest \ mtd-utils \ i2c-tools \ spitools \ xz \ udev-extraconf \ " inherit extrausers # generate by printf "%q\n" $(mkpasswd -m sha256crypt 12345) PASSWD= "\$5\$CZyCdtQE9Dp\$kuAmtCHtAv3X5gL1/imI.g1lf.JChVAEkdA3.8Yw8j8" EXTRA_USERS_PARAMS = "\ usermod -p '${PASSWD}' root; \ " yocto/honister/meta-igkboard/recipes-kernel/linux/files/linux-imx-igkboard.patch
yocto/honister/meta-igkboard/recipes-kernel/linux/linux-imx-headers_5.10.bbappend
yocto/honister/meta-igkboard/recipes-kernel/linux/linux-imx_5.10.bbappend
New file @@ -0,0 +1,15 @@ LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" require recipes-kernel/linux/linux-yocto.inc SRCREV = "a11753a89ec610768301d4070e10b8bd60fde8cd" FILESEXTRAPATHS:prepend := "${THISDIR}/files:" SRC_URI += " file://linux-imx-igkboard.patch " PATCHTOOL = "patch" do_copy_defconfig:append() { cp ${S}/arch/arm/configs/igkboard_defconfig ${WORKDIR}/defconfig cp ${S}/arch/arm/configs/igkboard_defconfig ${B}/.config } yocto/honister/meta-igkboard/recipes-misc/expand-rootfs/expand-rootfs_1.0.bb
New file @@ -0,0 +1,15 @@ DESCRIPTION = "Expand rootfs space on MMC" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" FILESEXTRAPATHS:prepend := "${THISDIR}/files:" SRC_URI += " file://expand_rootfs " FILES:${PN} += "${sbindir}/expand_rootfs" do_install() { install -d ${D}/${sbindir}/ install -m 0755 ${WORKDIR}/expand_rootfs ${D}/${sbindir}/ } RDEPENDS:expand-rootfs += "bash e2fsprogs util-linux" yocto/honister/meta-igkboard/recipes-misc/expand-rootfs/files/expand_rootfscopy from yocto/meta-igkboard/recipes-misc/expand-rootfs/files/expand_rootfs copy to yocto/honister/meta-igkboard/recipes-misc/expand-rootfs/files/expand_rootfs
yocto/honister/meta-igkboard/recipes-misc/packagegroups/packagegroup-misc-utils.bb
New file @@ -0,0 +1,6 @@ SUMMARY = "Useradd system service and system shell scripts tools package" PR = "r1" inherit packagegroup RDEPENDS:${PN} = "expand-rootfs sshswitch wpa-conf" yocto/honister/meta-igkboard/recipes-misc/sshswitch/files/sshswitch.servicecopy from yocto/meta-igkboard/recipes-misc/sshswitch/files/sshswitch.service copy to yocto/honister/meta-igkboard/recipes-misc/sshswitch/files/sshswitch.service
yocto/honister/meta-igkboard/recipes-misc/sshswitch/sshswitch_1.0.bb
New file @@ -0,0 +1,17 @@ DESCRIPTION = "Turn on SSH if /boot/ssh is present" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" inherit systemd SYSTEMD_AUTO_ENABLE = "enable" SYSTEMD_SERVICE:${PN} = "sshswitch.service" SRC_URI += " file://sshswitch.service " FILES:${PN} += "${systemd_unitdir}/system/sshswitch.service" do_install() { install -d ${D}/${systemd_unitdir}/system install -m 0644 ${WORKDIR}/sshswitch.service ${D}/${systemd_unitdir}/system } yocto/honister/meta-igkboard/recipes-misc/wpa-conf/files/wpa-conf.servicecopy from yocto/meta-igkboard/recipes-misc/wpa-conf/files/wpa-conf.service copy to yocto/honister/meta-igkboard/recipes-misc/wpa-conf/files/wpa-conf.service
yocto/honister/meta-igkboard/recipes-misc/wpa-conf/wpa-conf_1.0.bb
New file @@ -0,0 +1,17 @@ DESCRIPTION = "Copy user wpa_supplicant.conf" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" inherit systemd SYSTEMD_AUTO_ENABLE = "enable" SYSTEMD_SERVICE_${PN} = "wpa-conf.service" SRC_URI += " file://wpa-conf.service " FILES:${PN} += "${systemd_unitdir}/system/wpa-conf.service" do_install() { install -d ${D}/${systemd_unitdir}/system install -m 0644 ${WORKDIR}/wpa-conf.service ${D}/${systemd_unitdir}/system } yocto/honister/meta-igkboard/tools/igkboard-setup.sh
New file @@ -0,0 +1,173 @@ #!/bin/bash CWD=$(pwd) function log_error(){ echo -ne "\e[31m $1 \e[0m\n" } function usage(){ echo "Usage:" echo " MACHINE=<machine> source igkboard-setup.sh <build-dir>" echo "Options:" echo " <machine> machine name" echo " - igkboard" echo " * [-b build-dir]: Build directory, if unspecified script uses 'build' as output directory" echo " * [-h]: help" echo "Examples: " echo "$ MACHINE=igkboard source sources/meta-igkboard/tools/igkboard-setup.sh -b igkboard" echo } function cleanup_EULA(){ cd $CWD/sources/meta-freescale if [ -h EULA ]; then echo Cleanup meta-freescale/EULA... git checkout -- EULA fi if [ ! -f classes/fsl-eula-unpack.bbclass ]; then echo Cleanup meta-freescale/classes/fsl-eula-unpack.bbclass... git checkout -- classes/fsl-eula-unpack.bbclass fi cd - } function file_override() { source_path=$1 override_root=$2 if [ -f $source_path ]; then override_path=$override_root/`basename $source_path` if [ -f $override_path ]; then echo "\ WARNING: The file '$CWD/$source_path' is replacing the upstream file '$CWD/$override_path'. \ Overrides by file replacement are error-prone and discouraged. Please find an \ alternative override mechanism that uses meta-data only. " rm $override_path fi fi } function machine_overrides() { layer=$1 upstream_layer=$2 machines="../sources/$layer/conf/machine/*" machine_includes="../sources/$layer/conf/machine/include/*" for machine in $machines; do file_override $machine ../sources/$upstream_layer/conf/machine done for machine_include in $machine_includes; do file_override $machine_include ../sources/$upstream_layer/conf/machine/include done } function bbclass_overrides() { layer=$1 upstream_layer=$2 bbclasses="../sources/$layer/classes/*" for bbclass in $bbclasses; do file_override $bbclass ../sources/$upstream_layer/classes done } function hook_in_layer() { layer=$1 shift if [ "$1" = "" ]; then upstream_layers="meta-freescale" else upstream_layers="$@" fi # echo "BBLAYERS += \"\${BSPDIR}/sources/$layer\"" >> conf/bblayers.conf for upstream_layer in $upstream_layers; do machine_overrides $layer $upstream_layer bbclass_overrides $layer $upstream_layer done } function igkboard_conf_set(){ local build_dir=$1 if [ $MACHINE == "igkboard" ];then cp $CWD/sources/meta-igkboard/conf/local.conf $CWD/${build_dir}/conf/local.conf cp $CWD/sources/meta-igkboard/conf/bblayers.conf $CWD/${build_dir}/conf/bblayers.conf fi } function run(){ local build_dir=$1 local oeroot=$CWD/sources/poky if [ -e $CWD/sources/oe-core ]; then oeroot=$CWD/sources/oe-core fi . $oeroot/oe-init-build-env $CWD/$build_dir > /dev/null if [ ! -e conf/local.conf ]; then log_error "oe-init-build-env does not generated." exit -1 fi igkboard_conf_set $build_dir # Clean up PATH, because if it includes tokens to current directories somehow, # wrong binaries can be used instead of the expected ones during task execution export PATH="`echo $PATH | sed 's/\(:.\|:\)*:/:/g;s/^.\?://;s/:.\?$//'`" cat <<EOF Welcome LingYun IoT Gateway Kit Board Yocto BSP, You can run 'bitbake <target>' now. The targets should be: linuxsys-image core-image-minimal imx-image-full EOF hook_in_layer meta-imx/meta-bsp hook_in_layer meta-imx/meta-sdk hook_in_layer meta-nxp-demo-experience } function start(){ if [ "$(whoami)" = "root" ]; then echo "ERROR: do not use the BSP as root. Exiting..." exit -1 fi local BUILD_DIR; local OLD_OPTIND=$OPTIND while getopts "b:h" fsl_setup_flag do case $fsl_setup_flag in b) BUILD_DIR="$OPTARG"; echo -e "\n Build directory is " $BUILD_DIR ;; h) usage exit -1 ;; \?) usage exit -1;; esac done shift $((OPTIND-1)) OPTIND=$OLD_OPTIND if [ -z "$BUILD_DIR" ]; then BUILD_DIR='build' fi if [ -z "$MACHINE" ]; then echo setting to default machine MACHINE='igkboard' fi cleanup_EULA; mkdir -p $BUILD_DIR run $BUILD_DIR } start $@