Ads 468x60px

##EasyReadMore##

24 11月, 2017

Build Yocto morty image for Quark

#!/bin/bash

#set branch version:
 export BRANCH='morty'

#set image target:
 export IMG_TARGET='image-ecs'

#install essential library:
 sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
     build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
     xz-utils debianutils iputils-ping libsdl1.2-dev xterm

 #Fix Error: No valid terminal found, unable to open devshell
 sudo apt-get install screen

 #for node js 6.1 fix:
 #ERROR: Task (/home/ray/QX2_Yocto/poky_morty/meta-nodejs/recipes-devtools/nodejs/nodejs_7.10.0.bb:do_compile) failed with exit code '1'
 sudo apt-get install g++-multilib libssl-dev:i386 libcrypto++-dev:i386 zlib1g-dev:i386
 
#clone BSP source
 git clone -b ${BRANCH} git://git.yoctoproject.org/poky.git
 pushd poky
 git checkout 1b231d7b0628c5e19afc2987d25000f71030c000 || { echo "command failed"; exit 1; }
 popd
 cp -fa poky/. .
 rm -rf poky || { echo "command failed"; exit 1; }

 git clone -b ${BRANCH} git://git.yoctoproject.org/meta-intel
 pushd meta-intel || { echo "command failed"; exit 1; }
 git checkout 93e866a0d5bbff639b89424a9653c5602cd59cdd || { echo "command failed"; exit 1; }
 popd
 #MQTT : openembedded already remove mosquitto from morty

 git clone git://git.openembedded.org/meta-openembedded
 # git clone -b ${BRANCH} https://github.com/openembedded/meta-openembedded.git
 pushd meta-openembedded || { echo "command failed"; exit 1; }
 cp -r meta-oe/recipes-connectivity/mosquitto ..  || { echo "command failed"; exit 1; }
 git checkout -b ${BRANCH} origin/${BRANCH} || { echo "command failed"; exit 1; }
 git checkout b40116cf457b88a2db14b86fda9627fb34d56ae6 || { echo "command failed"; exit 1; }
 mv ../mosquitto meta-oe/recipes-connectivity  || { echo "command failed"; exit 1; }
 popd

#Shared middleware recipes for Intel IoT platforms
 git clone git://git.yoctoproject.org/meta-intel-iot-middleware
 pushd meta-intel-iot-middleware || { echo "command failed"; exit 1; }
 git checkout d666a98c60e6968f75c0acb6410fa0dfd59ac211 || { echo "command failed"; exit 1; }
 popd
 
 git clone http://git.yoctoproject.org/cgit/cgit.cgi/meta-oic/
 pushd meta-oic || { echo "command failed"; exit 1; }
 git checkout 0006fbdfcdb9e2f0e7ccceb33e26c7561fecd491 || { echo "command failed"; exit 1; }
 popd 

 git clone https://github.com/intel/iot-web-layers.git
 pushd iot-web-layers || { echo "command failed"; exit 1; }
 git checkout 533835587453d041319dc0951a3fb8f4adf2fea0 || { echo "command failed"; exit 1; }
 popd
 mv iot-web-layers/meta-iot-web . || { echo "command failed"; exit 1; }
 rm -rf iot-web-layers

 #nodejs
 #traps: node[767] trap invalid opcode ip:85f83a8 sp:bffa77c8 error:0 in node[8048000+ee4000]
 #need modify 0001-nodejs-add-compile-flag-options-for-quark.patch to fix platform issue.
 #add o['variables']['v8_target_arch']= 'x87' to configure
 git apply --check setup/bsp-patch/* || { echo "command failed"; exit 1; }
 git apply setup/bsp-patch/*

# bitbake information
cp meta-ecs-bsp/conf/conf-notes.txt meta-poky/conf/ || { echo "command failed"; exit 1; }

#Setup the yocto environment, source the open embedded script. This will automagically change your directory to build
 . oe-init-build-env
 #touch conf/sanity.conf

#Add the meta-intel BSP as a layer.
 #vim bblayers.conf add ${TOPDIR}/../meta-intel \
 bitbake-layers add-layer ../meta-intel
 bitbake-layers add-layer ../meta-intel-iot-middleware
 bitbake-layers add-layer ../meta-iot-web
 bitbake-layers add-layer ../meta-oic
 bitbake-layers add-layer ../meta-openembedded/meta-oe
 bitbake-layers add-layer ../meta-openembedded/meta-python
 bitbake-layers add-layer ../meta-openembedded/meta-networking
 bitbake-layers add-layer ../meta-ecs-bsp
 bitbake-layers show-layers

#Edit your local.conf, and change your machine type to “intel-quark”.
 sed -i 's#MACHINE ??= "qemux86"#MACHINE ??= "intel-quark"#g' conf/local.conf

#Refer /home/hans/workspace/QX2_Yocto/meta-clanton_v1.2.1.1/meta-intel-iot-devkit/recipes-core/images/image-full.bb

#Build Yocto, I usually build Poky’s minimal image - core-image-base.
 bitbake ${IMG_TARGET}
 #ERROR: Task (virtual:native:/home/hans/workspace/QX2_Yocto/poky/poky_morty/meta/recipes-core/util-linux/util-linux_2.28.1.bb:do_compile) failed with exit code '1'
 #ANS: update;upgrade check upgrade to Ubuntu 14.04.5 LTS version

#deploy image script
 cp -r../setup/image_stuff/* tmp/deploy/images/intel-quark || { echo "command failed"; exit 1; }

 #因為 BIOS 用之前 intel 提供的版本,所以將舊的 boot ,grub 複製到 image 下,接著 ssigne key 就行了

Refer:
    Building Yocto for the Intel Galileo - https://goo.gl/QjcXwQ
    Yocto · Intel® Galileo - https://goo.gl/AMswFn
    Build and deploy Yocto Linux on the Beaglebone Black – Using Android in Industrial Automation - https://goo.gl/pMnofu
    Yocto Project Quick Start - https://goo.gl/xXabPn
    BitBake User Manual - https://goo.gl/MM4TdD

0 意見:

張貼留言

 
Blogger Templates