Yocto Quick HowTo

Embed Size (px)

Citation preview

  • 8/10/2019 Yocto Quick HowTo

    1/3

    Yocto tutorial:- Razvan's experience---------------The process flow for testing a Yocto Image

    Usually on WED an email is received by the QA Team containing the latest MD5 checksums for different project branches such as: poky, meta-intel and so on.

    E.g.:The Autobuilder link: http://autobuilder.yoctoproject.org/pub/nightly/20130710-1/

    meta-fsl-arm 4a91984318cbc8c8b56f319a6eb7856e81fa9cacmeta-fsl-ppc 851c7ff26de131b871bd5a64274c1a2b13d60fc3meta-intel e7f77e4dc4490a10a597d3da7e85d6650ccb6fc3meta-minnow 286a72ba3f5e29432be1dd77127de5bdc2d988c3meta-qt3 b73552fb998fd30a01dbee5a172e432a16078222eclipse-poky 76df60597ae7cce069a5f1fd45089ea04c7394cdpoky a63229917a5708de2d161aba0d67168ce0da6365

    The autobuilder link is usefull when we create the TestRuns in Testopia (https://bugzilla.yoctoproject.org/tr_show_product.cgi).The MD5 checksums are used after git cloning the poky and the meta-intel project

    s in order to checkout the proper branches.

    There are two main perspectives for testing an image: BUILD Time and RUN Time.

    BUILD Time (e.g. Machine Sugarbay)----------------------------------In order to test a release from build time perspective you have to:a) clone the poky image: git clone git://git.yoctoproject.org/poky [optional poky_folder]b) checkout inside the poky_folder: git checkout a63229917a5708de2d161aba0d67168ce0da6365c) if needed, under poky, git clone the meta-intel folder: git clone git://git.yoctoproject.org/meta-intel

    d) checkout inside the meta-intel folder: git checkout e7f77e4dc4490a10a597d3da7e85d6650ccb6fc3e) go back to the poky folder and enter the following command: source oe-init-build-envf) in the poky folder there is the following folder structure: /build/conf and inside conf there are 2 config files: bblayers.conf and local.conf

    If needed, in bblayers.conf we have to add the meta-intel paths as described below:

    e.g. add the following line inside the BBLAYERS section:

    /home/razvan/yocto_work/poky/meta-intel \

    /home/razvan/yocto_work/poky/meta-intel/meta-sugarbay \

    In the local.conf file it is recommended to set the following parameters as follows:BB_NUMBER_THREADS = 8 and PARALLEL_MAKE = 8also the MACHINE should be set to sugarbay

    If no MACHINE will be set, then a default image for emulator (qemux86) will be built.

  • 8/10/2019 Yocto Quick HowTo

    2/3

    g) the building command should be run from the /poky_folder/build (after sourceoe-init-build-env was issued): bitbake core-image-sato (or bitbake core-image-sato-sdk)

    Observation:In case of a sanity.conf error, there is a workaround:Issue the following commands from /build folder:mv ../meta/conf/sanity.conf ../meta/conf/sanity_obsolete && touch ../meta/conf/sanity.conf

    After bitbake core-image-sato-sdk command succeeded, the output will be locatedunder tmp/deploy/images/sugarbay*.hddimgThis image should be written on a USB drive using the dd tool: (e.g.: dd if=sugarbay.hddimg of=/dev/sdc bs=1M; sync)Creating the test run in testopia:a) Go to Testopia -> Yocto Project Components -> BSPsb) Locate test plan 18 - BSP/QEMU: master branch - click on 18 -> the associatedtest runs list will be openedc) Locate Test Run 77 - TEMPLATE - Full Pass - core-image-sato-sdk-Sugarbay -> Right Click and clone it: When cloning a test run you need to select the test plan (in our case clickon BSP/QEMU: master branch), write the test run name which should have the following format:

    2013-07-10-1 - Full Pass - core-image-sato-sdk-SugarbayThen set accordingly the product version, build and environment.Check the Copy Test Cases checkbox and click Submit (only once).Remark: 2013-07-10-1 is coming from http://autobuilder.yoctoproject.org/

    pub/nightly/20130710-1/

    RUN Time--------The Runtime Testplans are located under:

    Runtime -> Runtime -> testplan 34 - Runtime: master branchLocate there TEMPLATE - Weekly and/or TEMPLATE - Full Pass Rele

    ase and clone the testruns in order to create the 2013-07-10-1 - Weekly and 2013

    -07-10-1 - Full Pass test runs.

    Under Runtime - Master Branch should be found also the Performance Testcases such as LTP and POSIX.

    Remark: LTP should be run as follows: ./runltp -p -l result-M2-201307101.log -C result-M2-201307101.fail -d /opt/ltp/tmp &> result-M2-201307101.fulllog - where M2 is the Milestone and 201307101 comes from: 20130710-1/.

    ./runltp -p -l result-M3_rc1-201307311.log -C result-M3_rc1-201307311.fail -d /opt/ltp/tmp &> result-M3_rc1-201307311.fulllog

    20130731120130818./runltp -p -l result-14_rc1-20130818.log -C result-14_rc1-20130818.fail

    -d /opt/ltp/tmp &> result-14_rc1-20130818.fulllog

    Testing Security Assessment Tools:----------------------------------links:Fedora's security assessment tool is:http://people.redhat.com/sgrubb/security/index.html

    Gentoo's security assessment tool is:http://www.gentoo.org/proj/en/hardened/pax-utils.xml

  • 8/10/2019 Yocto Quick HowTo

    3/3

    Prerequisite:1) clone poky-contrib (git clone git://git.yoctoproject.org/poky-contrib) and enter the poky-contrib folder2) checkout to the meta-security branch (git checkout adinux/meta-security; followed by 'cd ..') [or: git clone git://git.yoctoproject.org/meta-security]3) clone poky (git clone git://git.yoctoproject.org/poky)4) move meta-security into poky folder (mv poky-contrib poky/meta-security)5) add redhat-security and/or pax-utils in local.conf using: IMAGE_INSTALL_append (IMAGE_INSTALL_append = " pax-tools, redhat-security" ); also check the BB_NUMBER_THREADS = 8 and PARALLEL_MAKE = 8; machine should be set to default.6) add the meta-security layer in bblayers.conf (e.g. under BBLAYERS, add the following line /home/razvan/yocto_work/poky/meta-security \)7) build the image: bitbake core-image-sato8) run the image using the following command: runqemu qemux86 core-image-sato-sdkAfter the emulator is running with the core-image-sato image, you should be ableto locate the proper security scripts under /usr/bin/.

    Testing an image using the "test framework"--------------------------------------Steps:a) git clone poky: git clone git://git.yoctoproject.org/pokyb) have a look upon the following files: meta/classes/testimage.bbclass and in m

    eta/lib/oeqa. In meta/lib/oeqa/runtime are the tests.c) build a core-image-sato imaged) edit the local.conf by adding: INHERIT += "testimage"e) run the following command: bitbake core-image-sato -c testimage -> as a result: the qemu should start the testcases will be run.

    Very usefull link (with resources, such as smart test suite and media folders):http://10.237.112.202/rpmrepo/==================================